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

34 lines
1.1 KiB
PHP

<?php
include('includes/config/config.php');
$query = "select * from employee_appointment where doctor_attended_flag = 'N'";
if (!$result = @mysqli_query($conn,$query)) {
exit(mysqli_error($conn));
}
$data = array();
$i=0;
if(mysqli_num_rows($result) > 0) {
while ($row = mysqli_fetch_assoc($result)) {
$empId = $row['emp_id'];
$emp_query = "select fname,lname from employee where id ='$empId'";
$result_emp = @mysqli_query($conn,$emp_query);
$row_emp = mysqli_fetch_assoc($result_emp);
$data[$i]['id'] = $row['appointment_id'];
$data[$i]['title'] = $row_emp['fname']." ".$row_emp['lname'].", ".$row['ticket_no'] ;
$data[$i]['start'] = $row['appointment_date'];
$data[$i]['eventName'] = "appointment";
$data[$i]['type'] = $row['appointment_type'];
$data[$i]['appointment_id'] = $row['appointment_id'];
$data[$i]['emp_id'] = $row['emp_id'];
$i++;
}
}
else
{
$data['status'] = 200;
$data['message'] = "Data not found!";
}
echo json_encode($data);
?>