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

36 lines
968 B
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='sbp' 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]['checkup_form_value']=$row['checkup_form_value'];
$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);
?>