File manager - Edit - /home/autoph/public_html/connect/home/PRF_procIncomingInfo.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 = $refMonth.''.$refMinute.''.$refSecond; ?> <!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> <body> <div class='NewPRFHeader'> <p class='PRFBodyTitle'>📝 Incoming Request (New PRF)</p> </div> <!--########################## MAIN TABLE WINDOW ############################################--> <!--########################################################################################################--> <div class='NewPRFBody'> <!--<div class='NewPRFBodyMenu'> <div class='searchDIVA'> <b class='BodyTopMenu' disabled>📠 Print </b> <b class='BodyTopMenu'>💾 Export</b> </div> <div class='searchDIVB'> <input type='text' id='searchText' placeholder='Search Record.' class='textSearch' style='width:70%;margin:0px;border:1px solid lightgray;'> <button id='searchNewPRF' class='searchButton' style='width:25%'> 🔍 Search</button> </div> </div>--> <div id='mainTable' class='PRFTableBody'> <div style='width:100%;height:33px;background:white'> <table> <thead> <th style='width:5%'>NO</th> <th style='width:10%'>REF. CODE</th> <th style='width:10%'>DATE</th> <th style='width:20%'>COMPANY</th> <th style='width:15%'>DEALER</th> <th style='width:15%'>REQ. CATEGOY</th> <th colspan='2' style='width:25%'>REQ. TYPE</th> </thead> </table> </div> <div class='PRFTableItems'> <table> <?php $getItemHdr = mysql_query("SELECT * FROM `prf_request_hdr` WHERE `deleted`=0 AND `current_status` < 4 ORDER BY id DESC"); while($row=mysql_fetch_array($getItemHdr)){ $count = $count + 1; $prfCompID = $row['comp_id']; $prfCompName = mysql_result(mysql_query("SELECT comp_name from vts_company WHERE comp_id = $prfCompID"),0); $prfDealID = $row['deal_id']; $prfDealName = mysql_result(mysql_query("SELECT deal_name from vts_dealerships WHERE deal_id = $prfDealID"),0); $prfCatID = $row['category_id']; $prfCatName = mysql_result(mysql_query("SELECT description from prf_expensecategory WHERE id= $prfCatID"),0); $prfSubCatID = $row['sub_category_id']; $prfSubCatName = mysql_result(mysql_query("SELECT description from prf_expenseitems WHERE id= $prfSubCatID"),0); $prfDeptApproverID = $row['dept_head_id']; $prfDeptApproverFName=mysql_result(mysql_query("SELECT u_fname from vts_users WHERE u_id= $prfDeptApproverID"),0); $prfDeptApproverLName=mysql_result(mysql_query("SELECT u_lname from vts_users WHERE u_id= $prfDeptApproverID"),0); $prfStatus = $row['current_status']; ?> <!--<tr onclick="javascript:showPRFheaderForDeletion(this);" onDblclick="javascript:showActionViewDelete(this);" >--> <tr> <?php echo "<td style='width:5%'>".$count."</td>"; echo "<td style='width:10%'>".strtoupper($row['reference_code'])."</td>"; echo "<td style='width:10%'>".strtoupper($row['date_created'])."</td>"; echo "<td style='width:20%'>".strtoupper($prfCompName)."</td>"; echo "<td style='width:15%'>".strtoupper($prfDealName)."</td>"; echo "<td style='width:15%'>".strtoupper($prfCatName)."</td>"; echo "<td style='width:15%'>".strtoupper($prfSubCatName)."</td>"; echo "<td style='width:10%;font-family:Yu Gothic;font-weight:normal;color:blue;font-size:12px'>"; $status = $row['current_status']; $statusName =mysql_result(mysql_query("SELECT status_name FROM prf_status WHERE sequence = $status"),0); echo $statusName; echo"</td>"; echo "</tr>"; } ?> <tr><td colspan='9' ><hr style='padding:0px;background:transparent;border:0px;border-bottom:1px solid gray'></td> <tr> <td colspan='3' style='background:white;font-family:Yu Gothic; font-size:13px;color: #f97d43 ;height:20px;font-weight:normal'>Selected Record:</td> <td colspan='6' style='background:white;'> <input type='hidden' id='selectedPRFHeaderID' class='TableBottomLabel'> <input disabled type='text' id='selectedPRFHeaderIDLabel' style='background:white;border:0px;font-family:Yu Gothic;font-size:14px;color: #f97d43 ;font-weight:normal'> </td> </tr> </table> </div> </div> </div> <!--########################## POPUP ACTION WINDOW FOR DELETE AND VIEW DETAILS ############################################--> <!--########################################################################################################--> <div id="showActionViewDelete" class="PopUpActionWindow"> <div class='PopUpWindowTitle'> 🪧 Confirm Action <div class='PopUpWindowClose'> <b onclick="javascript:hideActionViewDelete(this);" style='font-weight:bold'> ✕ </b> </div> </div> <table> <tr> <td style='padding:10px;padding-left:20px;width:100%;background:white;font-family:Yu Gothic; font-size:16px;color:red ;height:10px;font-weight:normal;text-align:left'>Selected Record:<br> <input disabled type='hidden' id='ActionReferenceID' style='text-align:center;margin-top:10px;background:yellow;border:0px;font-family:Yu Gothic;font-size:18px;color: red ;font-weight:bold;margin-bottom:3px;padding-bottom:2px'> <input disabled type='text' id='ActionReferenceIDDesc' style='text-align:center;margin-top:10px;background:yellow;border:0px;font-family:Yu Gothic;font-size:18px;color: red ;font-weight:bold;margin-bottom:3px;padding-bottom:2px'> <br><br> </td> </tr> <tr> <td colspan='1' style='padding:10px;width:250px;background:white;border-top:1px solid gray;text-align:center;padding-top:5px'> <div style='width:100%;float:right;height:50px;padding:10px;background:white'> <button onclick="javascript:showUpdatePRFForm(this);" id='LoadUnpostedPRF' class='PopUpLowerButtonR'>📑 View Details</button> <button id='deletePRFHeader' class='PopUpLowerButtonL'> ❌ Delete</button> </div> </td> </tr> </table> </div> <!--########################## ADD NEW PURCHASE REQEUST ############################################--> <!--########################################################################################################--> <div id="PRFCreateNewRequest" class="PopUpWindowPRF"> <div class='PopUpWindowTitle'> 🗒 New Purchase Request <div class='PopUpWindowClose'> <b id='XCloseButton' style='font-weight:bold'> ✕ </b> </div> </div> <!--BODY--> <div class='PopUpWindowBodyContainer'> <input type='hidden' id='PRFReferenceNumber'> <label class='PRFRefID' id='uReferenceID'>:</label> <label class='PRFRefID'>Reference Number.</label> <div id="PRFNewContentInfo" class="PopUpWindowBody"> <div class='PRFdropItemSelectionContainer'> <div class='PRFdropItemSelection'> <p class='buttonTitle'>Select Company:</p> <select id='prfCompanySelected' class='DropDownButton' onchange="showDealership(this.value)"> <option value='0'>-- Select Company --</option> <?php $getCompanyAccess = mysql_query(" SELECT brand_access.user_id, brand_access.comp_id,brand_access.dealer_id,vts_company.comp_id,vts_company.comp_code,vts_company.comp_name FROM brand_access JOIN vts_company ON brand_access.comp_id = vts_company.comp_id WHERE brand_access.user_id=$uniqueRefID GROUP BY brand_access.comp_id ORDER BY vts_company.comp_name ASC "); while($row=mysql_fetch_array($getCompanyAccess)){ echo "<option value='".$row['comp_id']."'>".strToupper($row['comp_name'])."</option>"; } ?> </select> </div> <div class='PRFdropItemSelection'> <p class='buttonTitle'>Select Dealer:</p> <select id='myDealerList' class='DropDownButton' > </select> </div> <div class='PRFdropItemSelection'> <p class='buttonTitle'>Select Expense Category:</p> <select id='prfCategorySelected' class='DropDownButton' onchange="showCategoryItems(this.value)"> <option value='0'>-- Select Category --</option> <?php $getCompanyAccess = mysql_query("SELECT * FROM `prf_expensecategory` WHERE `status` = 1 ORDER BY description ASC "); while($row=mysql_fetch_array($getCompanyAccess)){ echo "<option value='".$row['id']."'>".strToupper($row['description'])."</option>"; } ?> </select> </div> <div class='PRFdropItemSelection'> <p class='buttonTitle'>Expense Type:</p> <select id='CategorySubItem' class='DropDownButton' > </select> </div> </div> <div class='PRFdropItemSelectionContainer'> <div class='PRFdropItemSelection' style='width:50%;background:transparent;padding-bottom:0px;padding-top:0px'> <p class='buttonTitle' style='margin-top:0px;padding-top:0px'>Purpose of Request:</p> <input type='text' id='PurposeOfReqeust' class='DropDownButton' style='margin:0px;'> </div> <div class='PRFdropItemSelection' style='width:25%;background:transparent;padding-bottom:0px;padding-top:0px'> <p class='buttonTitle' style='margin-top:0px;padding-top:0px'>Date Needed:</p> <input type='date' id='DateNeeded' > </div> <div class='PRFdropItemSelection' style='width:25%;background:transparent;padding-bottom:0px;padding-top:0px'> <p class='buttonTitle' style='margin-top:0px;padding-top:0px'>Approving Head:</p> <select id='prfApprovingHead' class='DropDownButton' style='margin:0px;' > <option value='0'>-- Select Category --</option> <?php $getCompanyAccess = mysql_query("SELECT vts_users.u_id,vts_users.u_fname,vts_users.u_lname,cl_approving_officers.cl_emp_id_a FROM cl_approving_officers JOIN vts_users ON cl_approving_officers.cl_emp_id_a = vts_users.u_id WHERE cl_approving_officers.cl_status=1 GROUP by cl_approving_officers.cl_emp_id_a "); while($row=mysql_fetch_array($getCompanyAccess)){ echo "<option value='".$row['u_id']."'>".strToupper($row['u_lname']).", ".strToupper($row['u_fname'])."</option>"; } ?> </select> </div> </div> <div class='PRFAddNewItem'> <div class='PRFdropItemSelection' style='width:50%;background:transparent;padding-bottom:0px;padding-top:0px'> <p class='buttonTitle' style='margin-top:0px;padding-top:0px'>Item Description:</p> <input type='text' id='txtAddItemDesc' class='DropDownButton' style='margin:0px;'> </div> <div class='PRFdropItemSelection' style='width:15%;background:transparent;padding-bottom:0px;padding-top:0px'> <p class='buttonTitle' style='margin-top:0px;padding-top:0px'>Quantity:</p> <input type='number' value='1' id='txtAddItemQty' min="1" class='DropDownButton' style='margin:0px;'> </div> <div class='PRFdropItemSelection' style='width:15%;background:transparent;padding-bottom:0px;padding-top:0px'> <p class='buttonTitle' style='margin-top:0px;padding-top:0px'>UoM:</p> <select id='UnitOfMeasure' class='DropDownButton' style='margin:0px;' > <option value='0'>-- Select --</option> <?php $getCompanyAccess = mysql_query("SELECT * FROM PRF_UoM WHERE status =1 ORDER BY Description ASC "); while($row=mysql_fetch_array($getCompanyAccess)){ echo "<option value='".$row['description']."'>".strToupper($row['description'])."</option>"; } ?> </select> </div> <div class='PRFdropItemSelection' style='width:20%;background:transparent;padding-bottom:0px;padding-top:0px'> <p class='buttonTitle' style='margin-top:0px;padding-top:0px'></p> <button id='btnAddNewItem' class='InsertButton'>➕ Add Item</button> </div> </div> <div class='PRFNewTableBody' id='PRFItemBody'> </div> <div class='PRFLowerActionButtonDiv'> <button id='btnPostNewPRF' class='SavePostCloseButton'>📪 Post Order</button> <button id='btnCloseButton' class='SavePostCloseButton'>✖ Close</button> </div> </div> </div> </div> <!--########################## END OF ADD NEW PURCHASE REQEUST ############################################--> <!--########################## EDIT/UPDATE PURCHASE REQUEST ###############################################--> <div id="PRFUPDATENewRequest" class="PopUpWindowPRF"> <div class='PopUpWindowTitle'> 🗒 Update Purchase Request Form <div class='PopUpWindowClose'> <b onclick="javascript:hideUpdatePRFForm(this);" style='font-weight:bold'> ✕ </b> </div> </div> <!--BODY--> <div class='PopUpWindowBodyContainer'> <input type='hidden' id='UpdatePRFReferenceNumber'> <label class='PRFRefID' id='UpdateuReferenceID'>:</label> <label class='PRFRefID'>Reference Number.</label> <div id="UpdatePRFNewContentInfo" class="PopUpWindowBody"> </div> </div> </div> <!--########################## END OF EDIT/UPDATING PURCHASE REQEUST ############################################--> </body> </html> <!--- LOCALIZED COPY OF JAVASCRIPT --> <script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script> <script type="text/javascript"> $(document).ready(function(){ //====================================================================================================== $("#deletePRFHeader").click(function(){ var selectedPRFHeaderID = $("#selectedPRFHeaderID").val(); //alert(selectedPRFHeaderID); //exit; if(confirm("CONFIRM DELETE ACTION: \n\nAre you sure you want to DELETE this record? \n\n Press 'OK' button to proceed...")){ ShowUploadBar(); $.ajax({ url: "PRF_DeletePRF_Header.php", type: "POST", async: false, data: { "selectedPRFHeaderID": selectedPRFHeaderID, "done": 1 }, success: function(d){ ShowUploadBar(); updateCREATENEWPRF(); $("#mainTable").html(d); hideActionViewDelete(); //$('#searchText').val(''); 015334295-1005 } }) } }); //====================================================================================================== $("#LoadNewPRFForm").click(function(){ var uReferenceID = <?php echo $NewRefCode;?> +""+ Math.floor(Math.random() * 888) + <?php echo $uniqueRefID;?>; document.getElementById("PRFReferenceNumber").value= uReferenceID;//<?php echo $NewRefCode;?> +""+ Math.floor(Math.random() * 888) + <?php echo $uniqueRefID;?>; document.getElementById("uReferenceID").innerHTML= uReferenceID; document.getElementById("prfCompanySelected").disabled = false; document.getElementById("myDealerList").disabled = false; document.getElementById("prfCategorySelected").disabled = false; document.getElementById("CategorySubItem").disabled = false; document.getElementById("PurposeOfReqeust").disabled = false; document.getElementById("DateNeeded").disabled = false; document.getElementById("prfApprovingHead").disabled = false; ShowUploadBar(); $.ajax({ url: "PRF_NewResfresh.php", type: "POST", async: false, data: { }, success: function(d){ ShowUploadBar(); updateCREATENEWPRF(); $("#PRFItemBody").html(d); //invHideAssignMsg(); //$('#searchText').val(''); } }) }); //====================================================================================================== $("#XCloseButton").click(function(){ document.getElementById("btnAddNewItem").disabled = false; document.getElementById("btnAddNewItem").style.backgroundColor = ""; document.getElementById("btnAddNewItem").style.color = ""; $("#PRFCreateNewRequest").fadeOut(500); ShowUploadBar(); $.ajax({ url: "PRF_NewResfresh.php", type: "POST", async: false, data: { }, success: function(d){ ShowUploadBar(); updateCREATENEWPRF(); $("#PRFItemBody").html(d); //invHideAssignMsg(); refreshMainTable(); } }) }); //====================================================================================================== $("#btnPostNewPRF").click(function(){ var UpdateReferenceHeaderCode = $("#PRFReferenceNumber").val(); //=alert(UpdateReferenceHeaderCode); //exit; ShowUploadBar(); $.ajax({ url: "PRF_PostNewPRF_FromNew.php", type: "POST", async: false, data: { "UpdateReferenceHeaderCode": UpdateReferenceHeaderCode, "done": 1 }, success: function(d){ updateCREATENEWPRF(); $("#mainTable").html(d); ShowUploadBar(); refreshMainTable(); $("#PRFCreateNewRequest").fadeOut(500); } }) }); //====================================================================================================== $("#btnCloseButton").click(function(){ document.getElementById("btnAddNewItem").disabled = false; document.getElementById("btnAddNewItem").style.backgroundColor = ""; document.getElementById("btnAddNewItem").style.color = ""; $("#PRFCreateNewRequest").fadeOut(500); ShowUploadBar(); $.ajax({ url: "PRF_NewResfresh.php", type: "POST", async: false, data: { }, success: function(d){ $("#PRFItemBody").html(d); updateCREATENEWPRF(); refreshMainTable(); ShowUploadBar(); } }) }); //====================================================================================================== $("#LoadUnpostedPRF").click(function(){ var UpdatePRFReferenceNumber = $("#UpdatePRFReferenceNumber").val(); ShowUploadBar(); //alert(prfCompanySelected); $.ajax({ url: "PRF_UpdateUnpostedPRF.php", type: "POST", async: false, data: { "UpdatePRFReferenceNumber": UpdatePRFReferenceNumber, "done": 1 }, success: function(d){ ShowUploadBar(); updateCREATENEWPRF(); $("#UpdatePRFNewContentInfo").html(d); //invHideAssignMsg(); //$('#searchText').val(''); } }) }); //====================================================================================================== $("#btnAddNewItem").click(function(){ var prfCompanySelected = $("#prfCompanySelected").val(); var myDealerList = $("#myDealerList").val(); var prfCategorySelected = $("#prfCategorySelected").val(); var CategorySubItem = $("#CategorySubItem").val(); var PurposeOfReqeust = $("#PurposeOfReqeust").val(); var DateNeeded = $("#DateNeeded").val(); var prfApprovingHead = $("#prfApprovingHead").val(); var txtAddItemDesc = $("#txtAddItemDesc").val(); var txtAddItemQty = $("#txtAddItemQty").val(); var UnitOfMeasure = $("#UnitOfMeasure").val(); var uReferenceID = $("#PRFReferenceNumber").val(); if(prfCompanySelected ==0){ alert("Please select company."); exit; } if(myDealerList ==0){ alert("Please select dealer."); exit; } if(prfCategorySelected ==0){ alert("Please select purchase category."); exit; } if(CategorySubItem ==0){ alert("Please select purchase subcategory."); exit; } if(PurposeOfReqeust ==""){ alert("Please indicate the purpose of your request."); exit; } if(DateNeeded ==""){ alert("Please indicate date needed"); exit; } if(prfApprovingHead ==0){ alert("Please select approving head"); exit; } if(txtAddItemDesc ==""){ alert("Please type something in the item description"); exit; } if(UnitOfMeasure ==""){ alert("Please select unit of measure"); exit; } document.getElementById("prfCompanySelected").disabled = true; document.getElementById("myDealerList").disabled = true; document.getElementById("prfCategorySelected").disabled = true; document.getElementById("CategorySubItem").disabled = true; document.getElementById("PurposeOfReqeust").disabled = true; document.getElementById("DateNeeded").disabled = true; document.getElementById("prfApprovingHead").disabled = true; //document.getElementById("btnAddNewItem").style.backgroundColor = "gray"; //document.getElementById("btnAddNewItem").style.color = "lightgray"; ShowUploadBar(); $.ajax({ url: "PRF_AddNewPRFItemsAndHeaders.php", type: "POST", async: false, data: { "uReferenceID": uReferenceID, "prfCompanySelected": prfCompanySelected, "myDealerList": myDealerList, "prfCategorySelected": prfCategorySelected, "CategorySubItem": CategorySubItem, "PurposeOfReqeust": PurposeOfReqeust, "DateNeeded": DateNeeded, "txtAddItemDesc": txtAddItemDesc, "prfApprovingHead": prfApprovingHead, "txtAddItemQty": txtAddItemQty, "UnitOfMeasure": UnitOfMeasure, "done": 1 }, success: function(d){ ShowUploadBar(); $("#PRFItemBody").html(d); //invHideAssignMsg(); //$('#searchText').val(''); } }) }); //====================================================================================================== function updateCREATENEWPRF(){ $.ajax({ url: "PRF_Update_CREATE_NEW_PRF.php", type: "POST", async: false, data: { "trans":1 }, success: function(d){ updatePostedPRF(); $("#unPostedPRFRequestCount").html(d); } }) } //====================================================================================================== function updatePostedPRF(){ $.ajax({ url: "PRF_Update_POSTEDPRF.php", type: "POST", async: false, data: { "trans":2 }, success: function(d){ $("#PostedPRFRequestCount").html(d); } }) } //====================================================================================================== function updateApprovalPRF(){ $.ajax({ url: "PRF_procIncomingInfo.php", type: "POST", async: false, data: { "trans":2 }, success: function(d){ $("#forMyApprovalCount").html(d); } }) } //====================================================================================================== function refreshMainTable(){ $.ajax({ url: "PRF_MainTableHeaderDisplay.php", type: "POST", async: false, data: { }, success: function(d){ //invShowAssignMsg(); $("#mainTable").html(d); //invHideAssignMsg(); //$('#searchText').val(''); } }) } }); </script> <!--- LOCALIZED COPY OF JAVASCRIPT --> <script type="text/javascript"> function hideActionSlipForm(){ $("#PRFCreateNewRequest").fadeOut(500); }; function showActionSlipForm(){ $("#PRFCreateNewRequest").fadeIn(500); }; function hideActionViewDelete(){ $("#showActionViewDelete").fadeOut(500); }; function showActionViewDelete(){ $("#showActionViewDelete").fadeIn(500); }; function hideUpdatePRFForm(){ $("#PRFUPDATENewRequest").fadeOut(500); }; function showUpdatePRFForm(){ $("#PRFUPDATENewRequest").fadeIn(500); $("#showActionViewDelete").fadeOut(500); }; function showPRFheaderForDeletion(row) { var x=row.cells; document.getElementById("selectedPRFHeaderID").value = x[1].innerHTML; document.getElementById("selectedPRFHeaderIDLabel").value = x[1].innerHTML; document.getElementById("ActionReferenceID").value = x[1].innerHTML; document.getElementById("ActionReferenceIDDesc").value = "Ref.#: " + x[1].innerHTML; document.getElementById("UpdateuReferenceID").innerHTML = x[1].innerHTML; document.getElementById("UpdatePRFReferenceNumber").value = x[1].innerHTML; } //LOAD DEALER BASED ON SELECTED COMPANY function showDealership(str) { //alert(str); if (str == "") { document.getElementById("myDealerList").innerHTML = ""; return; } else { if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else { // code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { document.getElementById("myDealerList").innerHTML = xmlhttp.responseText; } } xmlhttp.open("GET","PRF_LOAD_DealerBySelectedCompany.php?q="+str,true); xmlhttp.send(); } } //LOAD DEALER BASED ON SELECTED COMPANY function showCategoryItems(str) { //alert(str); if (str == "") { document.getElementById("CategorySubItem").innerHTML = ""; return; } else { if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else { // code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { document.getElementById("CategorySubItem").innerHTML = xmlhttp.responseText; } } xmlhttp.open("GET","PRF_LOAD_ExpenseCategoryItems.php?q="+str,true); xmlhttp.send(); } } </script>
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings