ESH/select_medical_appointment_slots.php

25 lines
1010 B
PHP
Raw Normal View History

2024-10-23 18:28:06 +05:30
<?php
include('includes/config/config.php');
include('includes/functions.php');
include_once('log_entry.php');
$doc=$_REQUEST['doc'];
$date = $_REQUEST['appointment_book_date'];
// $day= var_dump($date);
$role_id=getTableFieldValue('role_master','role_id','role_code','"LAB"');
$sql = "SELECT DISTINCT(d.slot_id),TIME_FORMAT(slot, '%h:%i %p') as slot,TIME_FORMAT(p.slot_end, '%h:%i %p') as slot_end ,slot_count,d.status from doc_slots d left join appoinment_slots p on d.slot_id=p.slot_id where slot_date=str_to_date('".$date."','%Y-%m-%d') and d.ohc_type_id='".$_SESSION['current_ohcttype']."' and emp_id in (select emp_id from tbl_users where FIND_IN_SET('".$role_id."',role_id) > 0 ) ";
error_log($sql."select_slot");
if (!$result = @mysqli_query($conn,$sql)) {
exit(mysqli_error($conn));
}
$data = array();
while ($row = mysqli_fetch_assoc($result)) {
array_push($data, $row);
}
$data['count']=mysqli_num_rows($result);
error_log('data '.print_r($data,true));
echo json_encode($data);
?>