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

33 lines
1.1 KiB
PHP

<?php
include ('includes/config/config.php');
error_reporting(E_ERROR | E_PARSE);
$Id = $_REQUEST['emp_id'];
// $query = "select checkup_form_value,checkup_date from checkup_form inner join checkup_form_key_value on checkup_form_key_value.checkup_form_id=checkup_form.checkup_id where emp_id ='$Id' and checkup_form_key='dbp' order by checkup_date asc limit 6";
$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 = 2 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]['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);
?>