D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
thread-self
/
root
/
proc
/
thread-self
/
root
/
home
/
shubmkcj
/
urbane.createerp.com
/
Filename :
get-po-details.php
back
Copy
<?php error_reporting(0); include 'config.php'; $a = array(); $a = $_POST['invoiceRow_ID']; $arrLength = count( $a ); $Client_invoice_Id=''; $Client_invoice_ref_Id=''; $Client_invoice_row_Id=''; $Client_invoice_amt=''; $amount_paid = 0; for ( $i = 0; $i < $arrLength; $i++ ) { $sql1 = "SELECT * FROM `purchase_order` where `id` = '$a[$i]'"; $result1 = mysqli_query($conn,$sql1); $count2 = mysqli_num_rows( $result1 ); $po_row_Id.=$a[$i]; if($count2){ $result = mysqli_fetch_assoc( $result1 ); $proforma_id .= $result['proforma_id']; $po_id .= $result['po_id']; $amount_paind += $result['amount_paind']; $Client_po_amt .= $result['amount_paind']; if ( $i < ( $arrLength-1 ) ) { $po_id .= ','; $proforma_id .= ','; $po_row_Id .= ','; $Client_po_amt .= ','; } }else{ $msg['status'] = "false"; $msg['msg'] = "Error"; echo json_encode( $msg ); } } $msg['status'] = "true"; $msg['po_row_Ids'] = $po_row_Id; $msg['po_id'] = $po_id; $msg['proforma_id'] = $proforma_id; $msg['client_po_amt'] = $Client_po_amt; $msg['amount_paid'] = $amount_paind; echo json_encode( $msg ); ?>