CasperSecurity
<?php
session_start();
include '../../../web/connection/connection.php';
include '../../../web/connection/con.php';
include '../../../web/connection/functions/encryption.php';
$purchase_order_id = $_REQUEST['purchase_order_id'];
$gross_amount = $_REQUEST['gross_amount'];
$discount_amount = $_REQUEST['discount_amount'];
$netamount = $_REQUEST['netamount'];
$date = date("Y-m-d");
$userId = $_SESSION['USER_ID'];
$netamount = $_REQUEST['netamount'];
if(!empty($purchase_order_id)){
$db_handle = new DBController();
$newUpdate = $db_handle->runMyUpdate("UPDATE purchase_order SET gross_amount = '$gross_amount', po_discount_amount = '$discount_amount',po_net_amount = '$netamount',modified_on='$date',modified_by='$userId' WHERE purchase_order_id = '$purchase_order_id'");
$jj = $_SESSION['LAST_NO'];
for($i=1;$i<$jj;$i++){
$purchase_terms = $_POST['purchase_terms_'.$i];
$db_handle = new DBController();
$newInsertz = $db_handle->tableinsert("INSERT INTO purchase_order_terms(purchase_order_id,terms_condition)
VALUES ('$purchase_order_id','$purchase_terms')");
}
if($newInsertz == TRUE){
$_SESSION['ERROR_MSG'] = "Success";
$_SESSION['MSG_ALRT'] = "TRUE";
header('location:../../../web/home/modules/stock/purchase_order/purchase_order.php');
}else{
$_SESSION['ERROR_MSG'] = "Unsuccess";
$_SESSION['MSG_ALRT'] = "FALSE";
header('location:../../../web/home/modules/stock/purchase_order/purchase_order.php');
}
}