CasperSecurity
<?php
session_start();
include '../../../../web/connection/connectionv2.php';
include '../../../../web/connection/con.php';
include '../../../../web/connection/encryption.php';
//echo $daily_item_dimension_id = $_REQUEST['daily_item_dimension_id'];
$item_group_id = $_REQUEST['item_group_id'];
$item_subgroup_id = $_REQUEST['item_subgroup_id'];
$item_group_name = $_REQUEST['item_group_name'];
$stdate = $_REQUEST['stdate'];
date_default_timezone_set("Asia/Kolkata");
$date = date("Y-m-d H:i:s");
$active = 'yes';
$userId = $_SESSION['USER_ID'];
$jj = $_SESSION['LAST_NO'];
for($ii=1;$ii<=$jj;$ii++){
$editcheckbox = $_POST['editcheckbox_'.$ii];
if($editcheckbox == 'on'){
$minimumqty = $_POST['minimumqty_'.$ii];
$item_id = $_POST['item_id_'.$ii];
$dimension_id = $_POST['dimension_id_'.$ii];
$brand_id = $_POST['brand_id_'.$ii];
$purchaseitemid = $_POST['purchaseitemid_'.$ii];
$db_handle = new DBController();
$newInsert = $db_handle->tableinsert("INSERT INTO canteen_item_dimensions (item_id,dimension_id,brand_id,purchase_item_id,minimun_quantity,created_on,created_by,is_active)
VALUES ('$item_id','$dimension_id','$brand_id','$purchaseitemid','$minimumqty','$date','$userId','$active')");
$db_handle = new DBController();
$selectbrand=$db_handle-> runQuery("SELECT * FROM canteen_item_dimensions WHERE purchase_item_id='$purchaseitemid'");
foreach ($selectbrand as $resselectbrand){
$item_dimensions_id =$resselectbrand['item_dimensions_id'];
$purchase_item_idid =$resselectbrand['purchase_item_id'];
}
if(!empty($item_dimensions_id) && (!empty($purchase_item_idid))){
$db_handle = new DBController();
$newInsert = $db_handle->runMyUpdate("UPDATE canteen_item_dimensions SET minimun_quantity = '$minimumqty',modified_on='$date',modified_by='$userId' WHERE item_dimensions_id = '$item_dimensions_id'");
}
}
}
if($newInsert == TRUE){
$_SESSION['ERROR_MSG'] = "Success";
$_SESSION['MSG_ALRT'] = "TRUE";
header('location:../../../../web/home/modules/university/Canteen/minimum_stock_qty/item_minimum_stock.php');
//header('location:../../../../web/home/modules/stock/minimum_stock_qty/stock_detail.php?item_group_id='.$item_group_id.'&itemg='.$item_group_name.'&item_id='.$item_id.'&item_dimensions_id='.$newInsert);
}else{
$_SESSION['ERROR_MSG'] = "Unsuccess";
$_SESSION['MSG_ALRT'] = "FALSE";
header('location:../../../../web/home/modules/university/Canteen/minimum_stock_qty/item_minimum_stock.php');
}
?>