26 lines
988 B
PHP
26 lines
988 B
PHP
<?php
|
|
include ('includes/config/config.php');
|
|
include ('log_entry.php');
|
|
|
|
$appointment_id = $_POST['appointment_id'];
|
|
$time = $_POST['entry_time'];
|
|
$hos_remark = $_POST['hos-remark'];
|
|
$data = [];
|
|
|
|
if ($appointment_id > 0 && !empty($time)) {
|
|
|
|
$query = "insert into hospitalization_details set appointment_id = '" . $appointment_id . "', remark = '".$hos_remark."' ,entry_time = STR_TO_DATE('" . $time . "', '%d/%m/%Y %h:%i %p') , modified_by = '" . $_SESSION['user_id'] . "'";
|
|
|
|
error_log("saving hospitalization details " . $query);
|
|
|
|
if (!mysqli_query($conn, $query)) {
|
|
error_log("went wrong while saving hospitalization details " . mysqli_error($conn));
|
|
$data['status'] = 500;
|
|
$data['message'] = 'Error occurred while saving hospitalization details.';
|
|
} else {
|
|
$data['status'] = 200;
|
|
$data['message'] = 'Hospitalization details saved successfully.';
|
|
}
|
|
}
|
|
error_log(" final data " . print_r($data,true));
|
|
echo json_encode($data); |