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

31 lines
936 B
PHP

<?php
error_reporting(0);
include "../includes/config/config.php";
include "functions.php";
include 'log_entry.php';
$response = array();
if($conn) {
$sql = "select * from employee_appointment where emp_id='".$_REQUEST['emp_id']."'";
error_log("errr".$sql);
$result = mysqli_query($conn,$sql);
if($result) {
$i=0;
$d=1;
while($row = mysqli_fetch_assoc($result)){
$response[$i]['srno'] =$d;
if ($row['appointment_type'] == 'O'){
$type = "OPD";
}else{
$type = "INJURY";
}
$response[$i]['type'] = $type;
$response[$i]['appointment_date'] =date_format(date_create($row['appointment_date']), "d-M-Y ");
$emp_id=getTableFieldValue('tbl_users', 'emp_id', 'user_id', $row['doctor_last_attended']);
$response[$i]['doctor_last_attended'] =getTableFieldValue('patient_master', 'patient_name', 'id', $emp_id);
$i++;
$d++;
}
error_log(print_r($response,true));
echo json_encode($response, JSON_PRETTY_PRINT);
}
}