29 lines
1.0 KiB
PHP
29 lines
1.0 KiB
PHP
|
<?php
|
||
|
include('includes/config/config.php');
|
||
|
include('includes/functions.php');
|
||
|
|
||
|
$id = $_REQUEST['id'];
|
||
|
|
||
|
$query_initial="";
|
||
|
$endquery="";
|
||
|
begin();
|
||
|
if(!empty($id)){
|
||
|
$query_initial="update ";
|
||
|
$endquery=" where id = '".$id."' ";
|
||
|
}else{
|
||
|
$query_initial="insert into ";
|
||
|
}
|
||
|
|
||
|
|
||
|
$query=$query_initial." oxygen_cylinder_issue set oxygen_cylinder='".$_POST['oxygen_cylinder']."',dept_deployed='".$_POST['dept_deployed']."',emp_deployed='".$_POST['emp_deployed']."',issued_date=STR_TO_DATE('".$_POST['issued_date']."', '%d/%m/%Y %h:%i %p'),exp_return_date=STR_TO_DATE('".$_POST['exp_return_date']."', '%d/%m/%Y %h:%i %p'),act_return_date=STR_TO_DATE('".$_POST['act_return_date']."', '%d/%m/%Y %h:%i %p'), issued_by='".$_POST['issued_by']."',comments='".$_POST['comments']."' ".$endquery;
|
||
|
|
||
|
error_log("ehwifhew".$query);
|
||
|
|
||
|
if (!$result = mysqli_query($conn,$query)) {
|
||
|
rollback();
|
||
|
exit(mysqli_error($conn));
|
||
|
}
|
||
|
|
||
|
commit();
|
||
|
?>
|
||
|
|