ok

Mini Shell

Direktori : /home2/selectio/public_html/subamangala/admin/api/waste-files/
Upload File :
Current File : /home2/selectio/public_html/subamangala/admin/api/waste-files/get-desgination-api.php

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

if($_POST['type']=="get_desgination"){
    $departement_id = $_POST['departement_id'];


   $where="";
if($departement_id!='all' && $departement_id!=''){
    $where="WHERE department_id=$departement_id";
}
    
        $statement = $pdo->prepare("SELECT * FROM `tbl_desgination` $where");
		$statement->execute();
		$result = $statement->fetchAll(PDO::FETCH_ASSOC);
		$totalrow = $statement->rowCount();
		
		if($result){
		    $response['data']=$result;
		    $response['error']=false;
		    $response['message']="desgination details fetched Successfuly";
		}else{
		    $response['error']=true;
		    $response['message']='failed';
		}
		
		echo json_encode($response);
 
}
?>

Zerion Mini Shell 1.0