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

27 lines
786 B
PHP

<?php
include('includes/config/config.php');
include('includes/functions.php');
include_once('log_entry.php');
$id=$_REQUEST['id'];
$app_type = $_REQUEST['app_type'];
$date_filter="";
if($app_type!="MED"){
$date_filter=" and date(date)=str_to_date('".$_POST["app_date"]."','%Y-%m-%d')";
}
$sql = "SELECT * from appointment_details where emp_id='".$id."' and ohc_type_id='".$_SESSION['current_ohcttype']."' and app_type='".$app_type."' and status='BOOKED' $date_filter ";
error_log("have_app ".$sql);
if (!$result = @mysqli_query($conn,$sql)) {
die(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);
?>