51 lines
1.6 KiB
PHP
51 lines
1.6 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,'Ambulance Master','SAVE','save_ambulance_list.php');
|
|
$noOfRows=$_POST['count_items'];
|
|
error_log("rows: ".$noOfRows);
|
|
// $dis_agncy = $_POST['dis_agncy'];
|
|
|
|
//echo "hello".$noOfRows;
|
|
$id = $_POST['id'];
|
|
for($i=0;$i<$noOfRows;$i++){
|
|
|
|
$id_str="id".$i;
|
|
$id=$_REQUEST[$id_str];
|
|
// echo $id;
|
|
error_log("id".$id);
|
|
|
|
|
|
|
|
//echo $procurement_refno;
|
|
$query_initial="";
|
|
$endquery="";
|
|
begin();
|
|
if(!empty($id)){
|
|
$query_initial="update ";
|
|
$endquery=" where id = '".$id."' ";
|
|
}else{
|
|
$query_initial="insert into ";
|
|
}
|
|
|
|
|
|
$query=$query_initial." ambulance_details_new set ambulance_category_id = '".${"amb_category_id$i"}."', ohc_type_id = '".${"ohc_type_id$i"}."', ambulance_name ='".${"ambulance_name$i"}."', ambulance_number ='".${"ambulance_number$i"}."',modified_by = '".$_SESSION['user_id']."' , state='".${"state$i"}."' , city='".${"city$i"}."' , placement_location='".${"placement_location$i"}."' ".$endquery;
|
|
|
|
// echo $query;
|
|
error_log($query."dmdm");
|
|
if (!$result = @mysqli_query($conn,$query)) {
|
|
rollback();
|
|
exit(error_log(mysqli_error($conn)));
|
|
}
|
|
}
|
|
commit();
|
|
?>
|
|
|