D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
thread-self
/
root
/
home
/
shubmkcj
/
urbane.createerp.com
/
Filename :
update-proforma.php
back
Copy
<?php ob_start(); session_start(); include 'config.php'; $id = $_POST['id']; $bill_pay_name = $conn -> real_escape_string($_POST['bill_pay_name']); $proforma_id = $_POST['proforma_id']; $date = $_POST['date']; $terms = $conn -> real_escape_string($_POST['terms']); $due_date = $_POST['due_date']; $billingCompanyAddress = $conn -> real_escape_string($_POST['billingAddress']); $pincode = $_POST['pincode']; $client_name = $conn -> real_escape_string($_POST['client_name']); $mobile = $_POST['mobile']; $email = $_POST['email']; $gstin = $_POST['gstin']; $type = $_POST['type']; $buyerreference = $conn -> real_escape_string($_POST['buyerreference']); $delivery_type = $_POST['delivery_type']; $delivery_terms = $conn -> real_escape_string($_POST['delivery_terms']); $mode_of_shipment = $_POST['mode_of_shipment']; $shipping_date = $conn -> real_escape_string($_POST['shipping_date']); $post_of_loading = $_POST['post_of_loading']; $port_of_delivery = $_POST['port_of_delivery']; $payment_method = $conn -> real_escape_string($_POST['payment_method']); $hs_code = $conn -> real_escape_string($_POST['hs_code']); $termsofpayment = $conn -> real_escape_string($_POST['termsofpayment']); $bank_details = $conn -> real_escape_string($_POST['bank_details']); $other_charges = $conn -> real_escape_string($_POST['other_charges']); $short_msg = $conn -> real_escape_string($_POST['short_msg']); $comment = $conn -> real_escape_string($_POST['comment']); $invoice_item_id = $_POST['invoice_item_id']; $item = $_POST['item']; $item_code = $_POST['item_code']; $qty = $_POST['qty']; $price = $_POST['price']; $total_amt = $_POST['total_amt']; $other_charges_t = $_POST['other_charges_t']; $subtotal = $_POST['subtotal']; $bank_charges = $_POST['bank_charges']; $amount_paid = $_POST['amount_paid']; $companySign = ""; $sqlGetCompanyDetail = "SELECT * FROM company_details"; $resultGetCompanyDetail = mysqli_query($conn, $sqlGetCompanyDetail); if($resultGetCompanyDetail){ if(mysqli_num_rows($resultGetCompanyDetail) > 0){ while($rowGetCompanyDetail = mysqli_fetch_assoc($resultGetCompanyDetail)){ $companySign = $rowGetCompanyDetail["signature"]; } } } $revised_date = date('d F Y'); $sqlInsertInvoice = "UPDATE `proforma` SET `bill_pay_name`='$bill_pay_name',`proforma_id`='$proforma_id',`date`='$date',`terms`='$terms',`due_date`='$due_date',`billingAddress`='$billingCompanyAddress',`deliver_address`='$billingCompanyAddress',`pincode`='$pincode',`client_name`='$client_name',`mobile_no`='$mobile',`email`='$email',`gstin`='$gstin',`type`='$type',`buyer_reference`='$buyerreference',`delivery_type`='$delivery_type',`delivery_terms`='$delivery_terms',`mode_of_shipment`='$mode_of_shipment',`shipping_date`='$shipping_date',`port_of_loading`='$post_of_loading',`port_of_delivery`='$port_of_delivery',`payment_method`='$payment_method',`hs_code`='$hs_code',`terms_of_payment`='$termsofpayment',`bank_details`='$bank_details',`other_charges`='$other_charges',`other_charge_msg`='$short_msg',`other_price`='$other_charges_t',`subtotal_price`='$subtotal',`bank_charge`='$bank_charges',`amount_paid`='$amount_paid',`signature`='$companySign',`comment`='$comment',`revised_date`='$revised_date' WHERE id='$id'"; $resultM = $conn->query($sqlInsertInvoice); if ($resultM === TRUE) { $iif = $conn->insert_id; $delete = mysqli_query($conn,"DELETE FROM `proforma_item` WHERE proforma_id='$proforma_id'"); for($j = 0; $j < count($item); $j++){ $invoice_item_id1 = $invoice_item_id[$j] ; $item1 = $item[$j] ; $item_code1 = $item_code[$j] ; $price1 = $price[$j] ; $qty1 = $qty[$j] ; $total_amt1= $total_amt[$j] ; $sqlInsertInvoice2 = "INSERT INTO `proforma_item`(`proforma_id`, `item_id`, `item_code`, `qty`, `price`, `row_total`) VALUES ('$proforma_id','$item1','$item_code1','$qty1','$price1','$total_amt1')"; $resultN = $conn->query($sqlInsertInvoice2); } echo '<script>localStorage.setItem("ProformaUpdate", "true");</script>'; echo '<script>location.replace("proforma.php")</script>'; }else{ echo '<script>alert("fail !")</script>'; echo '<script>location.replace("proforma.php")</script>'; } ?>