D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
shubmkcj
/
urbane.createerp.com
/
Filename :
getInvoicePrefix.php
back
Copy
<?php include 'config.php'; $id = $_GET["companyId"]; $invoice_prifixvalue = ""; $invoiceNumber = 0; $invoice_prifix = "SELECT * FROM `company_details` WHERE id = '$id'"; $invoiceprifixresult = mysqli_query($conn, $invoice_prifix) or die("error"); if($invoiceprifixresult){ if(mysqli_num_rows($invoiceprifixresult) > 0){ while($rowinvoiceprifix = mysqli_fetch_assoc($invoiceprifixresult)){ $invoice_prifixvalue = $rowinvoiceprifix['invoice_prifix']; } } } $sqlGetInvoiceNumber = "SELECT max(invoice_number) as invoice_number FROM invoice_new WHERE company_id = '$id' AND invoice_type != 'Performa Invoice' ORDER BY id DESC LIMIT 1"; $resultGetInvoiceNumber = mysqli_query($conn, $sqlGetInvoiceNumber); if($resultGetInvoiceNumber){ if(mysqli_num_rows($resultGetInvoiceNumber) > 0){ while($rowGetInvoiceNumber = mysqli_fetch_assoc($resultGetInvoiceNumber)){ $invoiceNumber = $rowGetInvoiceNumber["invoice_number"]; } } } $invoiceNumber1 = $invoiceNumber+1; echo $invoice_prifixvalue.",".$invoiceNumber1; ?>