36 lines
1.0 KiB
PHP
36 lines
1.0 KiB
PHP
<?php
|
|
include('includes/config/config.php');
|
|
include ('includes/functions.php');
|
|
include ('log_entry.php');
|
|
error_log ( "Start Printing Request Attributes" );
|
|
$requestStr="";
|
|
foreach ( $_REQUEST as $key => $value ) {
|
|
$requestStr.=$key . " : " . $value . "\n";
|
|
error_log ( $key . " : " . $value . "<br />\r\n" );
|
|
}
|
|
error_log ( "End Printing Request Attributes" );
|
|
save_log($requestStr,'Oxygen Cylinder','SAVE','save_oxygen_cylinder.php');
|
|
|
|
$query_initial="";
|
|
$endquery="";
|
|
begin();
|
|
if(!empty($id)){
|
|
$query_initial="update ";
|
|
$endquery=" where id = '".$id."' ";
|
|
}else{
|
|
$query_initial="insert into ";
|
|
}
|
|
|
|
|
|
$query=$query_initial." oxygen_cylinder set type='".$_POST['type']."',oxygen_kit_no='".$_POST['cylinder_number']."',date_n_time=STR_TO_DATE('".$_POST['date_n_time']."', '%d/%m/%Y %h:%i %p') ".$endquery;
|
|
|
|
//echo $query;
|
|
|
|
if (!$result = mysqli_query($conn,$query)) {
|
|
rollback();
|
|
exit(mysqli_error($conn));
|
|
}
|
|
|
|
commit();
|
|
?>
|
|
|