ok

Mini Shell

Direktori : /home2/selectio/www/y1jobportal.in/admin/api/
Upload File :
Current File : //home2/selectio/www/y1jobportal.in/admin/api/get-district-api.php

<?php include "config/config.php";

// Get Student Room Payment Details

if($_POST['type']=="get_district"){
    $state_id = $_POST['state_id'];

$where="";
$condition  ='';
$city = $_SESSION['y1_jobs']['city'] ?? null;

if($_SESSION['y1_jobs']['role_json'] == 2){
    $condition.=  " and id  IN ($city)" ;
    
}
    
        $statement = $pdo->prepare("SELECT * FROM `district` WHERE state_id=$state_id  $condition");
		$statement->execute();
		$result = $statement->fetchAll(PDO::FETCH_ASSOC);
		$totalrow = $statement->rowCount();
		
		if($result){
		    
		    
		    $response['data']=$result;
		    $response['error']=false;
		    $response['message']="District Details Fetched Successfully";
		}else{
		    $response['count']=0;
		    $response['error']=true;
		    $response['message']='failed';
		}
		
		echo json_encode($response);
 
}

?>

Zerion Mini Shell 1.0