60 lines
2.4 KiB
PHP
60 lines
2.4 KiB
PHP
<?php
|
|
include('includes/config/config.php');
|
|
include('log_entry.php');
|
|
$ailmentId = $_REQUEST['id'];
|
|
$data = [];
|
|
$i = 0;
|
|
$query = "select a.*, b.patient_name, b.gender, b.dob, b.personal_phone, b.village, c.name, d.result_name, e.type_name, f.dept_name from covid_monitoring a left join patient_master b on a.emp_id = b.id left join covid_patient_staying c on a.staying_id = c.id left join covid_test_result_master d on a.covid_test_result_id = d.id left join covid_contact_type_master e on a.covid_contact_id = e.id left join department f on b.dept_id = f.dept_id where a.emp_id ='".$ailmentId."' order by a.id DESC";
|
|
error_log("query: ".$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)) {
|
|
$dateStrVal = strtotime($row['resumed_duties_from']);
|
|
if(empty($dateStrVal)) {
|
|
$resumed_duties_from = 'NA';
|
|
} else {
|
|
$resumed_duties_from = date( 'd-m-Y', strtotime($row['resumed_duties_from']));
|
|
}
|
|
|
|
$dateStrVal2 = strtotime($row['tested_positive_on']);
|
|
if(empty( $dateStrVal2)) {
|
|
$tested_positive_on = 'NA';
|
|
} else {
|
|
$tested_positive_on = date( 'd-m-Y h:i A', strtotime($row['tested_positive_on']));
|
|
}
|
|
|
|
$dateStrVal3 = strtotime($row['discharge_on']);
|
|
if(empty($dateStrVal3)) {
|
|
$discharge_on = 'NA';
|
|
} else {
|
|
$discharge_on = date( 'd-m-Y h:i A', strtotime($row['discharge_on']));
|
|
}
|
|
$data[$i]['date_added'] = $row['date_added'];
|
|
$data[$i]['patient_name'] = $row['patient_name'];
|
|
$data[$i]['dob'] = $row['dob'];
|
|
$data[$i]['gender'] = $row['gender'];
|
|
$data[$i]['result_name'] = $row['result_name'];
|
|
$data[$i]['type_name'] = $row['type_name'];
|
|
$data[$i]['personal_phone'] = $row['personal_phone'];
|
|
$data[$i]['name'] = $row['name'];
|
|
$data[$i]['dept_name'] = $row['dept_name'];
|
|
$data[$i]['remarks'] = $row['remarks'];
|
|
$data[$i]['spo2_basis'] = $row['spo2_basis'];
|
|
$data[$i]['resumed_duties_from']=$resumed_duties_from;
|
|
$data[$i]['tested_positive_on']=$tested_positive_on;
|
|
$data[$i]['discharge_on']=$discharge_on;
|
|
$i++;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
$data['status'] = 200;
|
|
$data['message'] = "Data not found!";
|
|
}
|
|
// error_log(print_r($data, true));
|
|
echo json_encode($data);
|
|
?>
|