35 lines
1.3 KiB
PHP
35 lines
1.3 KiB
PHP
|
<?php
|
||
|
include ('includes/config/config.php');
|
||
|
error_reporting(E_ERROR | E_PARSE);
|
||
|
$Id = $_REQUEST['emp_id'];
|
||
|
$query = "select h.hygiene_parameter,hyg_para_id, hyg_param_val, checkup_date from emp_hyg_check_master em inner join emp_hyg_check_items ei on em.hyg_check_id=ei.hyg_check_id left join hygiene h on ei.hyg_para_id=h.hygiene_id where em.emp_id='$Id' order by hyg_para_id,checkup_date asc";
|
||
|
//$query = "select ei.hyg_param_val,em.checkup_date from emp_hyg_check_master em inner join emp_hyg_check_items ei on em.hyg_check_id=ei.hyg_check_id where em.emp_id='$Id' and ei.hyg_para_id = 1 order by em.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]['hyg_para_id'] = $row['hyg_para_id'];
|
||
|
$data[$x]['hygiene_parameter'] = $row['hygiene_parameter'];
|
||
|
$data[$x]['checkup_form_value'] = $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);
|
||
|
?>
|