56 lines
1.8 KiB
PHP
56 lines
1.8 KiB
PHP
<?php
|
|
include('includes/config/config.php');
|
|
|
|
include('includes/functions.php');
|
|
include('log_entry.php');
|
|
$value = $_REQUEST['value'];
|
|
$query = "select a.*,b.* from employee_appointment a left join patient_master b on a.emp_id = b.id where a.appointment_id = '".$value."' and a.ohc_type_id = '".$_SESSION['current_ohcttype']."'";
|
|
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)) {
|
|
|
|
|
|
|
|
$complaint_ids = $row['complaints'];
|
|
$complaint_ids_array = array();
|
|
$complaint_ids_array = explode(",", $complaint_ids);
|
|
$complaints = "";
|
|
for ($i = 0; $i < count($complaint_ids_array); $i++) {
|
|
if ($i == 0) {
|
|
if (is_numeric($complaint_ids_array[$i])) {
|
|
$complaints = getTableFieldValue('complaints', 'complaint', 'complaint_id', $complaint_ids_array[$i]);
|
|
} else {
|
|
$complaints = $complaint_ids_array[$i];
|
|
}
|
|
} else {
|
|
if (is_numeric($complaint_ids_array[$i])) {
|
|
$complaints = $complaints . "," . getTableFieldValue('complaints', 'complaint', 'complaint_id', $complaint_ids_array[$i]);
|
|
} else {
|
|
$complaints = $complaints . "," . $complaint_ids_array[$i];
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
$row['complaints']=$complaints;
|
|
|
|
$row['examination_remarks'] = getCommaSeperatedValuesForInClause("select examination_finding from examination_findings ", "id", $row['examination_remarks']);
|
|
|
|
$data = $row;
|
|
}
|
|
|
|
|
|
}
|
|
else
|
|
{
|
|
$data['status'] = 200;
|
|
$data['message'] = "Data not found!";
|
|
}
|
|
error_log('emp_data'.print_r($data,true));
|
|
echo json_encode($data);
|
|
?>
|