2024-10-16 19:18:52 +05:30
|
|
|
<?php
|
|
|
|
include('includes/config/config.php');
|
|
|
|
include('includes/functions.php');
|
|
|
|
$noOfRows=$_POST['count_items'];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$forward_status = $_POST['forward_status'];
|
|
|
|
$waste_gen_date = $_POST['waste_gen_date'];
|
|
|
|
//echo $procurement_refno;
|
|
|
|
for($i=0;$i<$noOfRows;$i++){
|
|
|
|
$waste_id_str="waste_id".$i;
|
|
|
|
$waste_id =$_REQUEST[$waste_id_str];
|
|
|
|
//echo "wastevalue".$waste_id;
|
|
|
|
|
|
|
|
$query_initial="";
|
|
|
|
$endquery="";
|
|
|
|
begin();
|
|
|
|
|
|
|
|
$sql="SELECT * FROM `bio_medical_waste_new` WHERE waste_gen_date=STR_TO_DATE('".${"waste_gen_date$i"}."','%d/%m/%Y')";
|
|
|
|
$resultl = mysqli_query($conn,$sql);
|
|
|
|
$rowl=mysqli_fetch_array($resultl);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(!empty($waste_id)){
|
|
|
|
$query_initial="update ";
|
|
|
|
$endquery=" where waste_id = '".$waste_id."' ";
|
|
|
|
}else{
|
|
|
|
$query_initial="insert into ";
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$query=" bio_medical_waste_new set waste_gen_date=STR_TO_DATE('".${"waste_gen_date$i"}."','%d/%m/%Y'),mines_yellow_qty = '".${"mines_yellow_qty$i"}."',yellow_qty_total ='".${"mines_yellow_qty$i"}."'+plant_yellow_qty,mines_white_qty='".${"mines_white_qty$i"}."',white_qty_total='".${"mines_white_qty$i"}."'+ plant_white_qty,mines_blue_qty='".${"mines_blue_qty$i"}."',blue_qty_total='".${"mines_blue_qty$i"}."'+plant_blue_qty, mines_red_qty='".${"mines_red_qty$i"}."',red_qty_total='".${"mines_red_qty$i"}."'+ plant_red_qty,modified_by = '".$_SESSION['user_id']."' ";
|
|
|
|
|
|
|
|
|
|
|
|
$query=$query_initial.$query.$endquery;
|
|
|
|
error_log($query);
|
|
|
|
|
|
|
|
if (!$result = mysqli_query($conn,$query)) {
|
|
|
|
rollback();
|
2024-11-02 18:03:13 +05:30
|
|
|
die(mysqli_error($conn));
|
2024-10-16 19:18:52 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
commit();
|
|
|
|
|
|
|
|
|
|
|
|
?>
|
|
|
|
|