41 lines
950 B
PHP
41 lines
950 B
PHP
|
<?php
|
||
|
include('includes/config/config.php');
|
||
|
include_once('log_entry.php');
|
||
|
$where_key = $_REQUEST['key'];
|
||
|
$where_val = $_REQUEST['key_val'];
|
||
|
|
||
|
if($where_key=='id'){
|
||
|
$where_cls =" where id = '".$where_val."' ";
|
||
|
|
||
|
}else if($where_key=='aadhar'){
|
||
|
$where_cls =" where aadhar_no='".$where_val."' ";
|
||
|
|
||
|
}else if($where_key=='ecode'){
|
||
|
$where_cls =" where emp_code='".$where_val."' ";
|
||
|
|
||
|
}else{
|
||
|
exit(mysqli_error($conn));
|
||
|
}
|
||
|
|
||
|
$query = "select * from canteen_master where id = '".$where_val."' ";
|
||
|
error_log("canteen:".$query);
|
||
|
if (!$result = @mysqli_query($conn,$query)) {
|
||
|
exit(mysqli_error($conn));
|
||
|
}
|
||
|
$data = array();
|
||
|
if(mysqli_num_rows($result) > 0) {
|
||
|
while ($row = mysqli_fetch_assoc($result)) {
|
||
|
//extract($row);
|
||
|
$data = $row;
|
||
|
|
||
|
|
||
|
}
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
$data['status'] = 200;
|
||
|
$data['message'] = "Data not found!";
|
||
|
}
|
||
|
// echo $data;
|
||
|
echo json_encode($data);
|
||
|
?>
|