ok

Mini Shell

Direktori : /home2/selectio/www/subamangala/admin/api/waste-files/
Upload File :
Current File : /home2/selectio/www/subamangala/admin/api/waste-files/get_employee_by_designation_id.php

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

if($_POST['type']=="get_employee_by_designation_id"){
    $designation_id = $_POST['designation_id'];

$where="";
if($designation_id!='all'){
    $where=" and designation_id=".$designation_id;
}
   
    
        $statement = $pdo->prepare("SELECT * FROM `tbl_user` WHERE id!=1 and status=1 $where");
		$statement->execute();
		$result = $statement->fetchAll(PDO::FETCH_ASSOC);
		$totalrow = $statement->rowCount();
		
		if($result){
		    $response['data']=$result;
		    $response['error']=false;
		    $response['message']="employee details fetched Successfuly";
		}else{
		    $response['error']=true;
		    $response['message']='failed';
		}
		
		echo json_encode($response);
 
}
?>

Zerion Mini Shell 1.0