ESH/api2/appointment_view.php

29 lines
1013 B
PHP
Raw Permalink Normal View History

2024-10-23 18:28:06 +05:30
<?php
error_reporting(0);
include "../includes/config/config.php";
include "functions.php";
include 'log_entry.php';
$response = array();
if($conn) {
$sql = "SELECT * from appointment_details 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;
$response[$i]['doctor_id'] = getTableFieldValue('patient_master', 'patient_name', 'id', $row['doctor_id'], '');
$response[$i]['date'] =date_format( date_create($row['date']) ,"d-m-Y");
$time_in_12_hour_format = date("g:i a", strtotime(getTableFieldValue('appoinment_slots', 'slot', 'slot_id', $row['slot_id'], '')));
$response[$i]['time'] = $time_in_12_hour_format;
$response[$i]['day'] = $row['day'];
$response[$i]['app_type'] = $row['app_type'];
$response[$i]['status'] = $row['status'];
$i++;
$d++;
}
error_log(print_r($response,true));
echo json_encode($response, JSON_PRETTY_PRINT);
}
}