ok

Mini Shell

Direktori : /home2/selectio/www/y1jobportal.in/apps-api/
Upload File :
Current File : /home2/selectio/www/y1jobportal.in/apps-api/executive-address-update.php

<?php
include_once('config/config.php');
include_once('config/custom-functions.php');
include 'config/send-sms.php';
$fn = new custom_functions();
date_default_timezone_set('Asia/Kolkata');
/*login*/
if ((isset($_POST['type'])) && ($_POST['type'] == 'update_address')) {
    $update_time = date('Y-m-d h:i:s');
    error_log('Executive Live Location Updated:'.$update_time);
   
    if (empty(($_POST['id']))) {
        $response['error'] = true;
        $response['message'] = "id required!";
        print_r(json_encode($response));
        return false;
        exit();
    }
    $latitude = (isset($_POST['latitude']) && !empty(trim($_POST['latitude']))) ? trim($fn->xss_clean($_POST['latitude'])) : '';
    $longitude = (isset($_POST['longitude']) && !empty(trim($_POST['longitude']))) ? trim($fn->xss_clean($_POST['longitude'])) : '';
    $address = (isset($_POST['address']) && !empty(trim($_POST['address']))) ? trim($fn->xss_clean($_POST['address'])) : '';
    $update_time = date('Y-m-d H:i:s');
    $id=$_POST['id'];
    error_log($update_time);
    $statement = $pdo->prepare("UPDATE `employee` SET latitude='".$latitude."',longitude='".$longitude."',current_employee_address='".$address."',update_date='".$update_time."' where id=$id");
    $result=$statement->execute();
    
    if($result){
        $response["error"]   = false;
        $response["message"] = "Exceicuitive Updated Successfully";
    }else{
        $response['error'] = true;
        $response['message'] = "Something Went Wrong...";
    }
    print_r(json_encode($response));
    
}else{
    $response['error'] = true;
    $response['message'] = "Function not Call...";
    print_r(json_encode($response));
}

Zerion Mini Shell 1.0