File manager - Edit - /home/autoph/public_html/connect/home/PRF_LoadPOForPayment.php
Back
<?php include_once 'core/init.php'; $prfDate = date_create() ->format("Y-m-d"); $myUID = $user_data['u_id']; if(isset($_POST['done'])){ $myPONumber = mysql_escape_string($_POST['myPONumber']); ?> <div class='PRFTableItems' id='mainTableSub'> <div style='width:100%;height:33px;background:white'> <table style='width:120%'> <thead> <th style='width:5%'>REC.#</th> <th style='width:7%'>PO DATE</th> <th style='width:7%'>INV. DATE</th> <th style='width:7%'>INVOICE #</th> <th style='width:7%'>DR NUMBER</th> <th style='width:7%'>PO NUMBER</th> <th style='width:10%'>COMPANY</th> <th style='width:16%'>VENDOR</th> <th style='width:5%'>TERMS</th> <th style='width:8%'>PO AMOUNT</th> <th style='width:8%'>INV. AMOUNT</th> <th style='width:8%'>DUE DATE</th> <th style='width:5%'>OVERDUE</th> </thead> </table> </div> <table style='width:120%'> <?php //######################################PAGINATION####################################################### //######################################PAGINATION####################################################### $totalRows = mysql_result(mysql_query("SELECT COUNT(1) FROM (SELECT * FROM `prf_delivery_receiving_logs` WHERE `inv_status`='Unpaid' GROUP BY `inv_number`) t1 "),0); $noOfRecordPerPage = mysql_result(mysql_query("SELECT `page_count` FROM `asa_versioning_db` WHERE 1"),0); $myPageCount = ceil($totalRows / $noOfRecordPerPage); $offSet = ($myPageCount-1) * $noOfRecordPerPage; echo "<input type='hidden' id='MyPageCount' value='".$myPageCount."'>"; echo "<input type='hidden' id='MyRowCount' value='".$totalRows."'>"; echo "<input type='hidden' id='myOffSet' value='".$offSet."'>"; echo "<input type='hidden' id='recordPerPage' value='".$noOfRecordPerPage."'>"; //####################################################################################################### //####################################################################################################### //SELECT COUNT(id) FROM `prf_purchase_order` WHERE `po_status`= 1 $getItemHdr = mysql_query("SELECT * FROM `prf_delivery_receiving_logs` WHERE `inv_status`='Unpaid' GROUP BY `inv_number` DESC LIMIT $offSet, $noOfRecordPerPage "); while($row=mysql_fetch_array($getItemHdr)){ $myPONumber=$row['po_number']; $myVendorID=$row['vendor_id']; $myINVNo=$row['inv_number']; $totalInvoiceAmount = mysql_result(mysql_query("SELECT SUM(dr_amount) FROM `prf_delivery_receiving_logs` WHERE `inv_number`='$myINVNo'"),0); $totalPOAmount = mysql_result(mysql_query("SELECT SUM(invoice_amount) FROM `prf_request_detl` WHERE `po_code`='$myPONumber' AND `deleted`=0"),0); $vendorName = mysql_result(mysql_query("SELECT `sup_name` FROM `prf_suppliers` WHERE `id`='$myVendorID'"),0); $getCompID = mysql_result(mysql_query("SELECT `comp_id` FROM `prf_purchase_order` WHERE `po_number`='$myPONumber'"),0); $poDate = mysql_result(mysql_query("SELECT `date_forwarded_to_vendor` FROM `prf_purchase_order` WHERE `po_number`='$myPONumber'"),0); $terms = mysql_result(mysql_query("SELECT `terms` FROM `prf_purchase_order` WHERE `po_number`='$myPONumber'"),0); $reqCompName = mysql_result(mysql_query("SELECT `comp_code` FROM vts_company WHERE comp_id='$getCompID'"),0); $date=date_create("".$row['date_delivered'].""); date_add($date,date_interval_create_from_date_string("".$terms." days")); $dueDate = date_format($date,"Y-m-d"); $date1=date_create("".$prfDate.""); $date2=date_create("".$dueDate.""); $diff=date_diff($date1,$date2); $overDue = $diff->format("%R%a days"); if($overDue < 10){$txtColor='red';}else{$txtColor='black';} ?><tr onDblClick="javasctipt:showPOActionaForm();" onclick="javasctipt:getInfo(this);" id='LoadUserApprovedCanvassItem' ><?php echo "<td style='width:5%;font-family:Yu Gothic Light;color:$txtColor;font-size:13px'>".$row['id']."</td>"; echo "<td style='width:7%;font-family:Yu Gothic Light;color:$txtColor;font-size:13px'>".$poDate."</td>"; echo "<td style='width:7%;font-family:Yu Gothic Light;color:$txtColor;font-size:13px'>".$row['date_delivered']."</td>"; echo "<td style='width:7%;font-family:Yu Gothic Light;color:$txtColor;font-size:13px'>".$row['inv_number']."</td>"; echo "<td style='width:7%;font-family:Yu Gothic Light;color:$txtColor;font-size:13px'>".$row['dr_number']."</td>"; echo "<td style='width:7%;font-family:Yu Gothic Light;color:$txtColor;font-size:13px'>".$row['po_number']."</td>"; echo "<td style='width:10%;font-family:Yu Gothic Light;color:$txtColor;font-size:13px'>".$reqCompName."</td>"; echo "<td style='width:16%;font-family:Yu Gothic Light;color:$txtColor;font-size:13px'>".$vendorName."</td>"; echo "<td style='width:5%;text-align:center;font-family:Yu Gothic Light;color:$txtColor;font-size:13px'>".$terms."</td>"; echo "<td style='width:8%;text-align:right;font-family:Yu Gothic Light;color:$txtColor;font-size:13px'>"; echo number_format($totalPOAmount,2,'.',','); echo"</td>"; echo "<td style='width:8%;text-align:right;font-family:Yu Gothic Light;color:$txtColor;font-size:13px'>"; echo number_format($totalInvoiceAmount,2,'.',','); echo"</td>"; echo "<td style='width:8%;text-align:center;font-family:Yu Gothic Light;color:$txtColor;font-size:13px'>"; echo $dueDate; echo"</td>"; echo "<td style='width:5%;font-family:Yu Gothic Light;color:$txtColor;font-size:13px'>"; echo $overDue; echo"</td>"; echo "</tr>"; } ?> </table> <?php }?>
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings