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-inoice-id.php
back
Copy
<?php 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 `generate_invoice` where `id` = '$a[$i]'"; $result1 = mysqli_query($conn,$sql1); $count2 = mysqli_num_rows( $result1 ); $Client_invoice_row_Id.=$a[$i]; if($count2){ $result = mysqli_fetch_assoc( $result1 ); $Client_invoice_ref_Id .= $result['invoice_reference']; $Client_invoice_Id .= $result['invoice_Id']; $amount_paid += $result['amount_paid']; $Client_invoice_amt .= $result['amount_paid']; if ( $i < ( $arrLength-1 ) ) { $Client_invoice_Id .= ','; $Client_invoice_ref_Id .= ','; $Client_invoice_row_Id .= ','; $Client_invoice_amt .= ','; } }else{ $msg['status'] = "false"; $msg['msg'] = "Error"; echo json_encode( $msg ); } } $msg['status'] = "true"; $msg['Client_invoice_row_Id'] = $Client_invoice_row_Id; $msg['Client_invoice_Id'] = $Client_invoice_Id; $msg['Client_invoice_ref_Id'] = $Client_invoice_ref_Id; $msg['Client_invoice_amt'] = $Client_invoice_amt; $msg['amount_paid'] = $amount_paid; echo json_encode( $msg ); ?>