ok
Direktori : /home2/selectio/www/y1jobportal.in/apps-api/ |
Current File : /home2/selectio/www/y1jobportal.in/apps-api/get-district.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'); $today=date('d-m-Y h:m:s A'); try{ $id = (isset($_POST['state_id']) && !empty(($_POST['state_id']))) ? ($fn->xss_clean($_POST['state_id'])) : '0'; $id=$_POST['state_id']; error_log('ID:'.$id); $sql="SELECT id,district_name as name FROM district where status=1 and state_id='".$id."'"; $statement = $pdo->prepare($sql); $statement->execute(); $res = $statement->fetchAll(PDO::FETCH_ASSOC); if (!empty($res)) { $response['error'] = false; $response['message'] = "State fatched successfully."; $response['data'] = $res; } else { $response['error'] = true; $response['error_info'] = "Seleted State City Not Available"; $response['message'] = "Something went wrong, please try again leter."; } $pdo = null; print_r(json_encode($response)); }catch(Exception $e){ $response["error"] = true; $response["status_code"] = '403'; $response["status"] = 'Forbidden'.$e; $pdo = null; print_r(json_encode($response)); return 0; } ?>