D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
shubmkcj
/
urbane.createerp.com
/
Filename :
insert-packing-list.php
back
Copy
<?php ob_start(); session_start(); include 'config.php'; $bill_display_name = $conn -> real_escape_string($_POST['bill_display_name']); $contact = $conn -> real_escape_string($_POST['contact']); $date = $conn -> real_escape_string($_POST['date']); $packaging_type = $_POST['packaging_type']; $gross_weight_t = $conn -> real_escape_string($_POST['gross_weight_t']); $net_weight = $_POST['net_weight']; $total_volume = $_POST['total_volume']; $total_carton_no = $_POST['total_carton_no']; $invoice_id = $_POST['invoice_id']; $proforma_id = $_POST['proforma_id']; $invoice_reference = $_POST['invoice_reference']; $item_code = $_POST['item_code']; $item = $_POST['item']; $color = $_POST['color']; $unit_of_measure = $_POST['unit_of_measure']; $ctn_roll = $_POST['ctn_roll']; $qty_box_pcs = $_POST['qty_box_pcs']; $gross_wt = $_POST['gross_wt']; $net_wt = $_POST['net_wt']; $measurement = $_POST['measurement']; $qty_mult = $_POST['qty_mult']; $sqlInsertInvoice = "INSERT INTO `packing_list`(`bill_display_name`, `mobile`, `date`, `package_type`, `invoice_id`, `proforma_id`, `invoice_reference`) VALUES ('$bill_display_name','$contact','$date','$packaging_type','$invoice_id','$proforma_id','$invoice_reference')"; $resultM = $conn->query($sqlInsertInvoice); if ($resultM === TRUE) { $iif = $conn->insert_id; for($j = 0; $j < count($item); $j++){ $item1 = $item[$j] ; $item_code1 = $item_code[$j] ; $color1 = $color[$j] ; $unit_of_measure1 = $unit_of_measure[$j] ; $ctn_roll1 = $ctn_roll[$j] ; $qty_box_pcs1 = $qty_box_pcs[$j] ; $qty_mult1 = $qty_mult[$j] ; $gross_wt1 = $gross_wt[$j] ; $net_wt1 = $net_wt[$j] ; $measurement1 = $measurement[$j] ; $mult_qty_box_pcs = $qty_box_pcs1*$qty_mult1; $mult_gross_wt = $gross_wt1*$qty_mult1; $mult_net_wt = $net_wt1*$qty_mult1; $sqlInsertInvoice2 = "INSERT INTO `packing_item`(`item_code`, `item`, `color`, `unit_of_measure`, `ctn_roll`, `qty_box_pcs`, `qty_mult`, `gross_wt`, `net_wt`, `measurement`, `packing_id`, `invoice_id`, `invoice_reference`) VALUES ('$item_code1','$item1','$color1','$unit_of_measure1','$ctn_roll1','$mult_qty_box_pcs','$qty_mult1','$mult_gross_wt','$mult_net_wt','$measurement1','$iif','$invoice_id','$invoice_reference')"; $resultN = $conn->query($sqlInsertInvoice2); } echo '<script>localStorage.setItem("InvoiceInserted", "true");</script>'; echo '<script>location.replace("manage-packing.php")</script>'; }else{ echo '<script>alert("fail !")</script>'; } ?>