File manager - Edit - /home/autoph/public_html/connect/home/PRF_FORPAYMENT.php
Back
<?php include 'core/init.php'; protected_page(); $uniqueRefID = $user_data['u_id']; //echo $uniqueRefID; $prfDate = date_create() ->format("Y-m-d"); $prtTime =Explode(":", date('H:i:s')); $txDate = explode("-",$prfDate); $refYear = $txDate[0]; $refMonth = $txDate[1]; $refMinute = $prtTime[1]; $refSecond = $prtTime[2]; //$NewRefCode = $refYear.''.$refMonth.''.$refMinute.''.$refSecond.''.$uniqueRefID; $POPAY = $user_data['POPAY']; //PO Creation if($POPAY==0){ ?> <script type="text/javascript"> Swal.fire('Access Denied. You are not allowed to access this page.') exit; </script> <?php exit; } ?> <!DOCTYPE html> <html lang="en"> <head> <link rel="stylesheet" type="text/css" href="css/bootstrap.css"/> <link rel="stylesheet" type="text/css" href="css/jquery-ui.css"/> <meta charset="UTF-8" name="viewport" content="width=device-width, initial-scale=1"/> </head> <style> .aprbutton{ float:right; width:100%; border-radius:5px; font-family:Yu Gothic Light; font-size:14px; color: #ffffff; font-weight:normal; margin:3px; cursor:pointer; background:#ef4901; padding:5px; border:2px solid white; margin-bottom:5px; } .aprbutton:hover{ float:right; width:100%; border-radius:5px; font-family:Yu Gothic Light; font-size:14px; color:#ffffff; font-weight:bold; margin:3px; margin-bottom:5px; cursor:pointer; background:#ef2901; padding:5px; border:2px solid white; } .popup { position: fixed; top: 50%; left: 50%; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%); height:200px; padding:10px; border-radius:10px; width:350px; background:#fff; border:1px solid red; display:none; } .buttonOTP{ padding:10px; border-radius:5px;border:1px solid #f11806;background:#f0670e;color:white;width:80%;margin-left:30px;margin-right:30px;font-size:14px } .buttonOTP:hover{ padding:10px; border-radius:5px;border:1px solid #f11806;background:#f11806;color:white;font-weight:bold;width:80%;margin-left:30px;margin-right:30px;font-size:14px; } .buttonOTPX{ float:left;padding:5px;border-radius:5px;border:1px solid #f11806;background:#fff;color:white;margin-top:6px } .buttonOTPX:hover{ float:left;padding:5px;border-radius:5px;border:1px solid #f11806;background:#fff;color:white;font-weight:bold } </style> <body> <div id='topMessage' style='border-radius:5px;z-index:9999999999999;position:absolute; top:10px;left:10px;width:400px;height:60px;background:yellow;border:solid 2px #efdd01 ;display:none;padding:15px;font-family:Yu Gothic Light;font-size:1vw;color:black'> Record has been saved. </div> <div class='NewPRFHeader'> <p class='PRFBodyTitle'>📝 LIST OF ACTIVE PURCHASE ORDER (Waiting for Supplier's Updates)</p> </div> <!--########################## MAIN TABLE WINDOW ############################################--> <!--########################################################################################################--> <div class='NewPRFBody' > <div class='NewPRFBodyMenu'> <div class='searchDIVA'> <!--<b class='BodyTopMenu' id='LoadNewPRFForm' onclick='showActionSlipForm()'>➕ New Purchase </b> <b class='BodyTopMenu' onclick="javascript:showPOForm();">📑 Create New PO </b> <b class='BodyTopMenu'>📠 Print </b> <b class='BodyTopMenu' onclick="javascript:getInfoCode(this);">⬇ Export</b> --> </div> <div class='searchDIVB'> <input type='hidden' id='userActiveID' value='<?php echo $uniqueRefID;?>'> <input type='text' id='searchPONumber' placeholder='Search Record.' class='textSearch' style='width:70%;margin:0px;border:1px solid lightgray;'> <button id='searchRecord' class='searchButton' style='width:25%'> 🔍 Search</button> </div> </div> <div id='mainTable' class='PRFTableBody'> <div class='PRFTableItems' id='mainTableSub'> <div style='width:100%;height:33px;background:white'> <table style='width:127%'> <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> <th style='width:7%'>...</th> </thead> </table> </div> <table id='LoadUserApprovedCanvassItem' style='width:127%' class='conData'> </table> <p style='padding:5px;font-family:Tahoma;font-size:14px;color:black'> Viewing <b id='currentCount'></b> out of <b id='recordCount'></b> total records</p> <center> <p style='padding:20px; ;font-size:18px;color:blue;cursor:pointer' id='viewMore'> <br> <img src='images/arrow_down.png'></img> </p> </center> </div> </div> </div> <!--###################################################################################################################################--> <!--######################################## PAGINATION ############################################--> <script src="http://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script> <script type="text/javascript"> var start = 0; var limit = 40; var infCanvass = ''; var reachedMax = false; $(window).scroll(function () { if ($(window).scrollTop() == $(document).height() - $(window).height()) getData(); }); $("#viewMore").click(function(){ //alert('Click'); getData(); }); $("#searchRecord").click(function(){ infCanvass = $("#searchPONumber").val(); //alert(infCanvass); getData(); }); $(document).ready(function () { countRow(); getData(); }); function getData() { infCanvass = $("#searchPONumber").val(); //alert(infCanvass); var recordCount = $("#recordCount").html(); //alert(recordCount); //alert(start); if(start >= recordCount){ $("#currentCount").html(recordCount); return false; } ShowUploadBar(); if (reachedMax) return; $.ajax({ url: 'forPaymentPOList.php', method: 'POST', dataType: 'text', data: { getData: 1, infCanvass: infCanvass, start: start, limit: limit }, success: function(response) { if (response == "reachedMax") reachedMax = true; else { if(infCanvass!=''){ $(".conData").html(response); start = 0; limit = 40; }else{ start += limit; $(".conData").append(response); $("#currentCount").html(start); if(start >= recordCount){ $("#currentCount").html(recordCount); $("#viewMore").fadeOut(100); } } $("#searchPONumber").val(''); } ShowUploadBar(); } }); } function countRow(){ $.ajax({ url: "forPaymentClick.php", type: "POST", async: false, data: { "trans":2 }, success: function(d){ $("#recordCount").html(d); } }) } </script> <!--######################################## PAGINATION ############################################ <!--###################################################################################################################################--> <div id="POActionaForm" class="purchaseOrderForm" style='background:white;position:fixed'> <div class='PopUpWindowTitle'> 🪧 ACTIVE INVOICE - (UNPAID) <div class='PopUpWindowClose'> <b onclick="javascript:hidePOActionaForm(this);" style='font-weight:bold'> ✕ </b> </div> </div> <div style='float:left;width:99%;height:60px;background:lightgray;padding:0px;margin:5px'> <div style='background:transparent;float:left;width:100%;margin:1px;text-align:center;padding:2px;border:0px solid gray;border-radius:10px'> <div style='float:left;width:20%;padding:0px;margin:0px;padding-right:10px'> <b style='float:left;color:black;padding-top:1px'>PO NUMBER</b><br> <input type='text' id='myPONumber' disabled style='width:100%;margin-left:0px;'> </div> <div style='float:left;width:20%;padding:0px;margin:0px;padding-right:10px'> <b style='float:left;color:black;padding-top:1px'>DATE POSTED:</b><br> <input type='text' id='myPOPosted' disabled style='width:100%;margin-left:0px;'> </div> <div style='float:left;width:15%;padding:0px;margin:0px;padding-right:10px'> <b style='float:left;color:black;padding-top:1px'>TERMS:</b><br> <input type='text' id='myPOTerms' disabled style='width:100%;margin-left:0px;'> </div> <div style='float:left;width:20%;padding:0px;margin:0px;padding-right:10px'> <b style='float:left;color:black;padding-top:1px'>DUE DATE:</b><br> <input type='text' id='myDueDate' disabled style='width:100%;margin-left:0px;'> </div> <div style='float:right;width:20%;padding:0px;margin:0px;padding-right:5px'> <p id='countDays' disabled style='width:100%;margin:0px;font-family:Yu Gothic Light;font-weight:bold;font-size:30px;color:yellow;background:black;padding:1px;border:1px solid gray'>test</p> </div> </div> </div> <input type='hidden' id='SeletedPRFItemID' class='TableBottomLabel' style='border:0px;text-align:left' disabled> <!--###################################################################################################################################--> <div id='poInformationX' style='padding:2px;width:100%;height:90px;background:w;float:left'> <div style='background:WHITE;float:left;width:100%;padding:5px;padding-top:0px;font-family:Yu Gothic Light;color:gray;font-size:14px;color:blue' id='userItemDesc'> <div id='poInformation' style='padding:0px;width:100%;height:110px;background:white'> <div style='border:0px solid lightgray;float:left;width:17%;padding:2px'> <b style='padding:1px;font-family:Yu Gothic Light;font-size:1vw'>Company Code:</b> <input type='text' disabled id='poByCompany' style='margin-bottom:5px;margin-top:0px'> <label for="notifyReq" style="font-family:Yu Gothic Light;font-size:11px;font-weight:normal;padding-top:10px"> <input type="checkbox" disabled checked id="notifyReq" name="notifyReq" value="Yes" style='font-size:10px'> Notify the requesting party </label> </div> <div style='border:0px solid lightgray;float:left;width:30%;padding:2px'> <b style='padding:3px;font-family:Yu Gothic Light;font-size:1vw'>Supplier / Vendor:</b> <input type='text' disabled id='poToVendor' style='margin-bottom:5px;margin-top:0px;'> <label for="notifyVendor" style="font-family:Yu Gothic Light;font-size:11px;font-weight:normal;padding-top:10px"> <input type="checkbox" disabled checked id="notifyVendor" name="notifyVendor" value="No" style='font-family:Yu Gothic Light;font-size:11px'> If PO is approve, notify the vendor </label> </div> <div style='border:1px solid gray;float:right;width:50%;padding:5px;height:80px;background:#e3e5de'> <div style='padding:5px;float:left;width:30%;height:95%;border:0px solid red;color:black'>Check Number:<br> <input type='text' id='checkNumber' style='text-align:center;width:100%;padding:5px;margin-top:0px;'> </div> <div style='padding:5px;float:left;width:35%;height:95%;border:0px solid red;color:black'>Status:<br> <select id='collectionStatus' style='text-align:center;background:white;width:100%;padding:5px;margin-top:0px;'> <option value='Unpaid'>Unpaid</option> <!--<option value='8'>Check Available</option> --> <option value='Paid'>Paid</option> </select> </div> <div style='padding:10px;float:right;width:30%;height:100%;border:0px solid red;color:black;background:transparent;padding-top:20px'> <button id='updatePaymentStatus' style='text-align:center;width:100%;padding:5px;margin-top:0px;height:100%;width:100%'>📠 Update</button> </div> </div> </div> </div> </div> <!--###################################################################################################################################--> <div id='activeItemListX' style='padding:2px;width:100%;height:190px;background:white;'> <div style='background:lightgray;float:left;width:100%;padding:3px;font-family:Yu Gothic Light;color:blue;font-size:14px;color:blue;border:1px solid gray' id='userItemDesc'> <b style='font-family:Yu Gothic Light;font-size:1vw;font-weight:normal;color: #2d2d2c ;padding:1px;'> 📖 Ordered Items:</b> <div style='background:white;padding:2px;width:100%;height:30px;margin-bottom:0px'> <table> <thead> <th style='width:5%;padding:3px'>REC.#</th> <th style='width:8%;padding:3px'>PRF #</th> <th style='width:35%;padding:3px'>ITEM DESCRIPTION</th> <th style='width:5%;padding:3px'>UOM</th> <th style='width:9%;padding:3px'>UNIT COST</th> <th style='width:9%;padding:3px'>P.O QTY</th> <th style='width:9%;padding:3px'>P.O AMOUNT</th> <th style='width:11%;padding:3px;background:#e5f573;border:1px solid gray'>INV. QTY</th> <th style='width:9%;padding:3px;background:#e5f573;border:1px solid gray'>INV. AMNT</th> </thead> </table> </div> <div id='activeItemList' style='background: #ffffff ;padding:1px;width:100%;height:360px;margin-top:0px;overflow:auto'> </div> </div> </div> <input type='hidden' id='invoiceNumber'> <input type='hidden' id='drNumber'> </div> <!--###################################################################################################################################--> <!--###################################################################################################################################--> </body> </html> <!--- LOCALIZED COPY OF JAVASCRIPT --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script> <script type="text/javascript"> $(document).ready(function(){ <!--###################################################################################################################################--> <!--######################################################################PRF_POST_PO.php#############################################################--> $("#LoadUserApprovedCanvassItem").click(function(){ var myPONumber = $("#myPONumber").val(); //alert(myPONumber); //exit; if(myPONumber==''){ alert('ERROR: PO Number is missing.'); exit; } ShowUploadBar(); $.ajax({ url: "PRF_LoadPOItemsForReceiving.php", type: "POST", async: false, data: { "myPONumber": myPONumber, "done": 1 }, success: function(d){ $("#activeItemList").html(d); ShowUploadBar(); } }) }); //============================================================================================================================= //============================================================================================================================= $("#confirmDelivery").click(function(){ var unitPrice = $("#unitPrice").val(); var receivedQTY = $("#receivedQTY").val(); var itemID = $("#itemID").val(); var itemRefCode = $("#itemRefCode").val(); var myPONumber = $("#myPONumber").val(); var invoiceNo = $("#invoiceNo").val(); var drNo = $("#drNo").val(); if(drNo==''){ alert('ERROR: Please type the DR number to continute'); exit; } if(invoiceNo==''){ alert('ERROR: Please type the INVOICE number to continute'); exit; } if(unitPrice==''){ alert('ERROR: Invoice amount is missing.'); exit; } if(receivedQTY==''){ alert('ERROR: Invalid received quantity.'); exit; } if(itemID==''){ alert('ERROR: Item ID is missing.'); exit; } if(itemRefCode==''){ alert('ERROR: Reference Code is missing.'); } ShowUploadBar(); $.ajax({ url: "prf_update_stock_reciving_per_item.php", type: "POST", async: false, data: { "itemID": itemID, "unitPrice": unitPrice, "receivedQTY": receivedQTY, "myPONumber": myPONumber, "itemRefCode": itemRefCode, "invoiceNo": invoiceNo, "drNo": drNo, "done": 1 }, success: function(d){ ShowUploadBar(); hideConfirmationBox(); showtopMessage(); $("#activeItemList").html(d); updateSupplierPOCount(); updateForPaymentCount(); } }) }); //============================================================================================================================= //============================================================================================================================= $("#searchRecordXXXX").click(function(){ var searchPONumber = $("#searchPONumber").val(); if(searchPONumber==''){ alert('ERROR: Invalid Entry'); exit; } ShowUploadBar(); $.ajax({ url: "PRF_SearchInvoiceNumber.php", type: "POST", async: false, data: { "searchPONumber": searchPONumber, "done": 1 }, success: function(d){ hidePOActionaForm(); ShowUploadBar(); updateForPaymentCount(); $("#mainTableSub").html(d); } }) }); //============================================================================================================================= //============================================================================================================================= $("#updatePaymentStatus").click(function(){ var collectionStatus = $("#collectionStatus").val(); var checkNumber = $("#checkNumber").val(); var invoiceNumber = $("#invoiceNumber").val(); var drNumber = $("#drNumber").val(); var myPONumber = $("#myPONumber").val(); //alert(myPONumber); //exit; if(checkNumber==''){ alert('ERROR: Please input check number to continue.'); exit; } if(confirm("CONFIRM PAYMENT: \n\nAre you sure you want to tag this record as PAID? \n\n Press 'OK' button to proceed...")){ ShowUploadBar(); $.ajax({ url: "PRF_UpdateForPaymentList.php", type: "POST", async: false, data: { "collectionStatus": collectionStatus, "checkNumber": checkNumber, "invoiceNumber": invoiceNumber, "drNumber": drNumber, "myPONumber": myPONumber, "done": 1 }, success: function(d){ hidePOActionaForm(); ShowUploadBar(); updateForPaymentCount(); $("#mainTableSub").html(d); } }) } }); //============================================================================================================================= //============================================================================================================================= }); </script> <!--- LOCALIZED COPY OF JAVASCRIPT --> <script type="text/javascript"> //============================================================================================================================= //============================================================================================================================= function showActiveVendors(){ var poByCompany = $("#poByCompany").val(); //alert(poByCompany); //exit; ShowUploadBar(); $.ajax({ url: "PRF_LoadActiveVendorslBasedOnSelectedCompany.php", type: "POST", async: false, data: { "poByCompany": poByCompany, "done": 1 }, success: function(d){ $("#poToVendor").html(d); ShowUploadBar(); } }) } //============================================================================================================================= //==================================.php=========================================================================================== function reloadItemForPO(){ ShowUploadBar(); $.ajax({ url: "PRF_ReLoadForPOItems.php", type: "POST", async: false, data: { "done": 1 }, success: function(d){ $("#mainTableSub").html(d); ShowUploadBar(); } }) } //============================================================================================================================= //==================================.php=========================================================================================== function showActiveProposal(){ var poByCompany = $("#poByCompany").val(); var loadActiveProposal = $("#poToVendor").val(); //alert(loadActiveProposal); //exit; ShowUploadBar(); $.ajax({ url: "PRF_LoadProposalBasedOnSelectedCompany.php", type: "POST", async: false, data: { "poByCompany": poByCompany, "loadActiveProposal": loadActiveProposal, "done": 1 }, success: function(d){ $("#activeItemList").html(d); showPOedItemPerSelectedVendorAndCompany(); ShowUploadBar(); reloadItemForPO(); } }) } //============================================================================================================================= //============================================================================================================================= function showPOedItemPerSelectedVendorAndCompany(){ var poByCompany = $("#poByCompany").val(); var poToVendorID = $("#poToVendor").val(); var myPONumber = $("#myPONumber").val(); //alert(poCode); //exit; ShowUploadBar(); $.ajax({ url: "PRF_LoadPOedItemByVendor.php", type: "POST", async: false, data: { "poByCompany": poByCompany, "myPONumber": myPONumber, "poToVendorID": poToVendorID, "done": 1 }, success: function(d){ $("#SelectedItemList").html(d); ShowUploadBar(); } }) } function hideConfirmationBox(){ $("#confirmStockReceiving").fadeOut(200); } function showConfirmationBox(){ $("#confirmStockReceiving").fadeIn(200); } function hidetopMessage(){ $("#topMessage").fadeOut(20800); } function showtopMessage(){ $("#topMessage").fadeIn(100); hidetopMessage(); } function hidePOConfirmForm(){ $("#showPOPostingConfirmationForm").fadeOut(500); } function showPOConfirmForm(){ $("#showPOPostingConfirmationForm").fadeIn(500); } function hidePOActionaForm(){ $("#POActionaForm").fadeOut(500); } function showPOActionaForm(){ $("#POActionaForm").fadeIn(500); } function hidePOForm(){ $("#showGenCanvassForm").fadeOut(500); document.getElementById("poByCompany").disabled = false; document.getElementById("poToVendor").disabled = false; document.getElementById("myInstructions").disabled = false; document.getElementById("myInstructions").value = ''; document.getElementById("myPONumber").value = ''; document.getElementById("disabled").disabled = false; hideActionForm(); }; function showPOForm(){ document.getElementById("poByCompany").disabled = false; document.getElementById("poToVendor").disabled = false; document.getElementById("myInstructions").disabled = false; document.getElementById("myInstructions").value = ''; document.getElementById("poByCompany").value = ''; document.getElementById("poToVendor").value = ''; document.getElementById("myInstructions").value = ''; //document.getElementById("myPONumber").value = ''; $("#showGenCanvassForm").fadeIn(500); } function getInfo(row) { var x=row.cells; document.getElementById("myPONumber").value = x[5].innerHTML; document.getElementById("myPOPosted").value = x[1].innerHTML; document.getElementById("poByCompany").value = x[6].innerHTML; document.getElementById("poToVendor").value = x[7].innerHTML; document.getElementById("myPOTerms").value = x[8].innerHTML + " Days"; document.getElementById("myDueDate").value = x[11].innerHTML; document.getElementById("countDays").innerHTML = x[12].innerHTML; document.getElementById("invoiceNumber").value = x[3].innerHTML; document.getElementById("drNumber").value= x[4].innerHTML; showPOActionaForm(); } function getInformationData(row) { var x=row.cells; document.getElementById("itemRefCode").value = x[1].innerHTML; document.getElementById("itemID").value = x[0].innerHTML; document.getElementById("itemDesc").innerHTML = x[2].innerHTML; document.getElementById("orderedQTY").value = x[5].innerHTML; document.getElementById("receivedQTY").value = x[5].innerHTML; //document.getElementById("unitPrice").value = x[6].innerHTML; } //=================================================================================receivedQTY orderedQTY supplierName itemDesc //================================================================================= $("#pageCountViewNext").click(function(){ var MyPageCount = $("#MyPageCount").val(); var MyRowCount = $("#MyRowCount").val(); var myOffSet = $("#myOffSet").val(); var CurrentpageCount = $("#pageCount").val(); var recordPerPage = $("#recordPerPage").val(); //alert(CurrentpageCount); //exit; ShowUploadBar(); $.ajax({ url: "PRF_LoadPOForPayment.php", type: "POST", async: false, data: { "MyPageCount": MyPageCount, "myOffSet": myOffSet, "MyRowCount": MyRowCount, "CurrentpageCount": CurrentpageCount, "recordPerPage": recordPerPage, "done": 1 }, success: function(d){ ShowUploadBar(); $("#mainTableSub").html(d); } }) }); //================================================================================= //================================================================================= $("#pageCountViewBack").click(function(){ var MyPageCount = $("#MyPageCount").val(); var MyRowCount = $("#MyRowCount").val(); var myOffSet = $("#myOffSet").val(); var CurrentpageCount = $("#pageCount").val(); var recordPerPage = $("#recordPerPage").val(); //alert(CurrentpageCount); //exit; ShowUploadBar(); $.ajax({ url: "PRF_LoadPOForPayment.php", type: "POST", async: false, data: { "MyPageCount": MyPageCount, "myOffSet": myOffSet, "MyRowCount": MyRowCount, "CurrentpageCount": CurrentpageCount, "recordPerPage": recordPerPage, "done": 1 }, success: function(d){ ShowUploadBar(); $("#mainTableSub").html(d); } }) //================================================================================= //================================================================================= }); //====================================================================================================== function updateSupplierPOCount(){ $.ajax({ url: "PRF_UpdateSupplierPOCount.php", type: "POST", async: false, data: { "trans":2 }, success: function(d){ $("#POSupplierCount").html(d); } }) } //====================================================================================================== function updateForPaymentCount(){ $.ajax({ url: "PRF_updateForPaymentCount.php", type: "POST", async: false, data: { "trans":2 }, success: function(d){ $("#POForPayment").html(d); } }) } </script>
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings