31 lines
1019 B
PHP
31 lines
1019 B
PHP
<?php
|
|
include('includes/config/config.php');
|
|
include('includes/functions.php');
|
|
|
|
|
|
$query_initial="";
|
|
$endquery="";
|
|
|
|
// begin();
|
|
$id= $_REQUEST['oxygen_cyl_id'];
|
|
error_log($id."pre_id");
|
|
if(!empty($id)){
|
|
$query_initial="update";
|
|
$endquery=" where oxygen_cylinder_id = '".$id."' ";
|
|
}else{
|
|
$query_initial="insert into";
|
|
}
|
|
|
|
|
|
$query=$query_initial." oxygen_cylinder_details set oxygen_kit_id='".$_POST['oxygen_cylinder_id']."',issued_date=STR_TO_DATE('".$_POST['issued_date']."', '%d/%m/%Y'),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("save oxy ".$query);
|
|
|
|
if (!$result = mysqli_query($conn,$query)) {
|
|
rollback();
|
|
exit(mysqli_error($conn));
|
|
}
|
|
|
|
commit();
|
|
?>
|
|
|