48 lines
1.7 KiB
PHP
48 lines
1.7 KiB
PHP
<?php
|
|
include ('includes/config/config.php');
|
|
include ('includes/functions.php');
|
|
error_reporting ( E_ALL & ~ E_NOTICE & ~ E_DEPRECATED & ~ E_WARNING );
|
|
// include log entry header file
|
|
include ('log_entry.php');
|
|
error_log ( "Start Printing Request Attributes" );
|
|
foreach ( $_REQUEST as $key => $value ) {
|
|
error_log ( $key . " : " . $value . "<br />\r\n" );
|
|
}
|
|
error_log ( "End Printing Request Attributes" );
|
|
// error_reporting(E_ERROR | E_PARSE);
|
|
$issue_id = $_POST ['issue_log_id'];
|
|
$issue_qty = $_REQUEST['issue_qty'];
|
|
$approval_status = $_POST['approval_status'];
|
|
$approval_comments = $_POST['approval_comments'];
|
|
// echo $appointment_id;
|
|
$data = array ();
|
|
|
|
$query = "";
|
|
$query_initial = "";
|
|
$query_end = " ";
|
|
begin ();
|
|
|
|
if (!empty($issue_id)) {
|
|
$data ['message'] = "update";
|
|
$query_initial = " update direct_medicine_issue_log ";
|
|
$query_end = " where issue_log_id='".$issue_id."' ";
|
|
} else {
|
|
$query_initial = "insert into direct_medicine_issue_log ";
|
|
$data ['message'] = "save";
|
|
}
|
|
|
|
$query = " set date_of_issue= STR_TO_DATE('".$_POST['issue_date']."', '%d/%m/%Y %h:%i %p') ,issue_point_id='".$_POST['point_id']."',comments = '".$_POST['comment']."',ohc_location_id='".$_SESSION['current_ohcttype']."',approval_status = '$approval_status',approval_comments='$approval_comments',modified_by='" . $_SESSION ['user_id'] . "'";
|
|
$query = $query_initial . " " . $query . " " . $query_end;
|
|
error_log("sndsj".$query);
|
|
|
|
if (! $result = @mysqli_query($conn,$query )) {
|
|
error_log ( "Exception while saving direct_medicine_issue_log:" . mysqli_error($conn) );
|
|
error_log ( "Failing Query: " . $query );
|
|
rollback ();
|
|
exit ( mysqli_error($conn) );
|
|
}
|
|
|
|
commit ();
|
|
$data ['issue_log_id'] = $issue_id;
|
|
echo json_encode ( $data );
|
|
?>
|