ohctech_p8/api2/medical_exam_slot.php
Dushant Mali 899fb3e65a Upgrade 7 to 8
Upgrade 7 to 8
2024-11-02 18:03:13 +05:30

29 lines
1.1 KiB
PHP

<?php
error_reporting(0);
include "../includes/config/config.php";
include "functions.php";
include 'log_entry.php';
$doc=$_REQUEST['doc'];
$emp_id=$_REQUEST['emp_id'];
$date = $_REQUEST['appointment_book_date'];
$app_type = $_REQUEST['app_type'];
// $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 ,d.slot_count,d.status from doc_slots d left join appoinment_slots p on d.slot_id=p.slot_id where p.app_type='MED' and slot_date=str_to_date('".$_REQUEST['slot_date']."' , '%m/%d/%Y') and d.ohc_type_id='".$_REQUEST['ohc_type_id']."' and emp_id in (select emp_id from tbl_users where FIND_IN_SET('".$role_id."',role_id) > 0 ) ";
error_log($sql."sqltrdr");
if (!$result = @mysqli_query($conn,$sql)) {
die(mysqli_error($conn));
}
$data = array();
while ($row = mysqli_fetch_assoc($result)) {
array_push($data, $row);
}
error_log('data '.print_r($data,true));
echo json_encode($data);
?>