ESH/select_employee_hygiene_parameter.php
2024-10-23 18:28:06 +05:30

39 lines
1.1 KiB
PHP

<?php
include('includes/config/config.php');
include ('includes/functions.php');
error_reporting(E_ERROR | E_PARSE);
$Id = $_REQUEST['emp_id'];
$query = "select * from emp_level_hyg_check a inner join emp_checkup_hyg_parameter b on a.emp_hyg_id=b.emp_hyg_id where hyg_parameter_id='1' and emp_id='1' order by checkup_date asc limit 6";
///echo $query;
if (!$result = @mysqli_query($conn,$query )) {
exit(mysqli_error($conn));
}
$data = array();
$x=0;
if(mysqli_num_rows($result) > 0) {
while ($row = mysqli_fetch_assoc($result)) {
// $data[$x] = $row;
//$data[]=$row;
//$x++;
//$data[$x]=$row;
$parameter_name=getTableFieldValue('hygiene','hygiene_parameter','hygiene_id',$row['hyg_parameter_id']);
$data[$x]['parameter_name']=$parameter_name;
$data[$x]['hyg_parameter_val']=$row['hyg_param_val'];
$data[$x]['checkup_date']=date_format(date_create($row['checkup_date']),"d-M-Y");
$x++;
}
}
else
{
$data['status'] = 200;
$data['message'] = "Data not found!";
}
echo json_encode($data);
?>