28 lines
956 B
PHP
28 lines
956 B
PHP
|
|
<?php
|
||
|
|
include('includes/config/config.php');
|
||
|
|
include('includes/functions.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_details set oxygen_cylinder_id='".$_POST['oxygen_cylinder_id']."',issued_date=STR_TO_DATE('".$_POST['issued_date']."', '%d/%m/%Y %h:%i %p'),reading='".$_POST['reading']."',knob_condition='".$_POST['key_knob']."', regulator_key_knob_condition='".$_POST['regulator_knob']."',checked_by='".$_POST['checked_by']."',department_personnel='".$_POST['dept_pers']."',remarks='".$_POST['remarks']."' ".$endquery;
|
||
|
|
|
||
|
|
error_log("ehwifhew".$query);
|
||
|
|
|
||
|
|
if (!$result = mysqli_query($conn,$query)) {
|
||
|
|
rollback();
|
||
|
|
exit(mysqli_error($conn));
|
||
|
|
}
|
||
|
|
|
||
|
|
commit();
|
||
|
|
?>
|
||
|
|
|