File manager - Edit - /home/autoph/public_html/connect/PRF_OpenPurchaseRequest.php
Back
<?php include 'core/init.php'; protected_page(); $uniqueRefID = $user_data['u_id']; $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'>📑 MY ACTIVE PRF</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'>📠 Print </b> <b class='BodyTopMenu'>💾 Export</b> </div> <div class='searchDIVB'> <input type='text' id='searchText' placeholder='SEARCH PRF' class='textSearch' style='width:70%;margin:0px;border:1px solid lightgray;'> <button id='searchNewPRF' class='searchButton' style='width:25%'> 🔍 Search</button> </div> </div>--> <input type='hidden' id="selectedHDRID"> <!-- USE TO CAPTURE WHAT TYPE OF APPROVAL TO BE PROCESSED. DEPT. HEAD, GM, ASSET--> <input type='hidden' id="approvalCode"> <!-- USE TO CAPTURE WHAT TYPE OF APPROVAL TO BE PROCESSED. DEPT. HEAD, GM, ASSET--> <input type='hidden' id="DisApprovalCode"> <!-- USE TO CAPTURE WHAT TYPE OF APPROVAL TO BE PROCESSED. DEPT. HEAD, GM, ASSET--> <div id='mainTable' class='PRFTableBody'> <div style='width:100%;height:33px;background:white'> <table> <thead> <th style='width:3%;font-family:Calibri;font-size:12px'>NO</th> <th style='width:10%;font-family:Calibri;font-size:12px'>REF. CODE</th> <th style='width:7%;font-family:Calibri;font-size:12px'>DATE</th> <th style='width:18%;font-family:Calibri;font-size:12px'>COMPANY</th> <th style='width:15%;font-family:Calibri;font-size:12px'>DEALER</th> <th style='width:14%;font-family:Calibri;font-size:12px'>REQ. CATEGOY</th> <th style='width:15%;font-family:Calibri;font-size:12px'>REQ. TYPE</th> <th style='width:13%;font-family:Calibri;font-size:12px'>PRF STATUS</th> <th style='width:5%;font-family:Calibri;font-size:12px'></th> </thead> </table> </div> <div class='PRFTableItems'> <table> <?php //$getItemHdr = mysql_query("SELECT * FROM `prf_request_hdr` WHERE `deleted`=0 AND `request_by`='$uniqueRefID' AND `current_status` = 1 ORDER BY id DESC"); $getItemHdrDeptHead = mysql_query("SELECT * FROM `prf_request_hdr` WHERE `request_by` ='$uniqueRefID' AND `current_status` > 0 AND `current_status` < 90 AND `deleted` = 0"); while($row=mysql_fetch_array($getItemHdrDeptHead)){ $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:showPRFUpdateOpenPRF(this);" ><?php echo "<td style='width:3%'>".$count."</td>"; echo "<td style='width:10%'>".strtoupper($row['reference_code'])."</td>"; echo "<td style='width:7%'>".strtoupper($row['date_created'])."</td>"; echo "<td style='width:18%'>".strtoupper($prfCompName)."</td>"; echo "<td style='width:15%'>".strtoupper($prfDealName)."</td>"; echo "<td style='width:14%'>".strtoupper($prfCatName)."</td>"; echo "<td style='width:15%'>".strtoupper($prfSubCatName)."</td>"; echo "<td style='width:13%;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 "<td style='width:5%;text-align:center;font-size:14px;padding:3px'>"; $chkAttachment = mysql_result(mysql_query("SELECT COUNT(1) FROM `prf_attachment` WHERE `prf_number` = '".$row['reference_code']."'"),0); $withMail ='📝'; $attFilename = mysql_result(mysql_query("SELECT `document_name` FROM `prf_attachment` WHERE `prf_number` = '".$row['reference_code']."'"),0); $noMail = '-'; if($chkAttachment > 0){ echo "<a href='FILES/prfdoc/".$attFilename."' target='_Blank'><abbr title='View Attached document'>📑</abbr></a>"; }else{ echo $noMail; } 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> <!--########################## EDIT/UPDATE PURCHASE REQUEST ###############################################--> <div id="PRFPOSTEDOpenNewRequest" class="PopUpWindowPRF"> <div class='PopUpWindowTitle'> 🗒 Posted Purchase Request Form <div class='PopUpWindowClose'> <b onclick="javascript:hideOpenItems(this);" style='font-weight:bold'> ✕ </b> </div> </div> <!--BODY--> <div class='PopUpWindowBodyContainer'> <label class='PRFRefID' id='PosteduReferenceID'></label> <label class='PRFRefID'>Reference Number.</label> <div id="PostedPRFNewContentInfo" class="PopUpWindowBody"> </div> <div class='PRFLowerActionButtonDiv'> <div style='width:40%;float:right;height:50px;padding:10px;background:white'> <button id='UnPostPRF' class='PopUpLowerButtonR' >📪 CANCEL PRF</button> <button disabled class='PopUpLowerButtonR' style='background:gray;color:lightgray'>✖ POST PRF</button> <!--PRF_PostedForDeptHeadApproval.php --> </div> </div> </div> </div> <!--########################## END OF EDIT/UPDATING PURCHASE REQEUST ############################################--> <!--########################## END OF EDIT/UPDATING PURCHASE REQEUST ############################################--> <!--########################## END OF EDIT/UPDATING PURCHASE REQEUST ############################################--> <div id="PRFTimeLine" class="PopUpActionWindow"> <div class='PopUpWindowTitle'> 🪧 Confirm Action <div class='PopUpWindowClose'> <b onclick="javascript:hideFollowUpOpen(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'> Active / Selected Record:<br> <input disabled type='hidden' id='ActionReferenceIDa' style='text-align:center;margin-top:10px;background:white;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='ActionReferenceIDDesca' 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;text-align:center;padding-top:5px'> <div style='width:100%;float:right;height:50px;padding:10px;background:white'> <button onclick="javascript:showOpenItems(this);" id='LoadPOSTEDPRFOpenPRF' class='PopUpLowerButtonR'>📑 View Details</button> <!--<button onclick="javascript:showFollowUpWindow(this);" class='PopUpLowerButtonR'> 📬 Follow up</button> --> </div> </td> </tr> </table> </div> <!--########################## FOLLOW UP WINDOW 257 263 264 ############################################--> <div id="myFollowUpWindow" class="PopUpSendMessageWindow"> <div class='PopUpWindowTitle'> 🪧 Confirm Action <!--DELETE ITEMS INSIDE POPUP--> <div class='PopUpWindowClose'> <b onclick="javascript:hideFollowUpWindow(this);" style='font-weight:bold'> ✕ </b> </div> </div> <table> <tr> <td style='padding:20px;width:100%;background:white;font-family:Yu Gothic; font-size:16px;color:gray ;height:10px;font-weight:normal;text-align:left'> <div style='float:right;width:50%;border:0px solid gray;'> <p id='ffReferenceID' style='float:right;padding:2px;margin:1px;font-family:Yu Gothic;font-size:18px;color:red;position:relative;padding-bottom:0px;text-align:right'></p></div> <div style='float:right;width:50%;border:0px solid gray;'> <p style='float:left;padding:2px;margin:1px;font-family:Yu Gothic;font-size:18px;color:gray;position:relative;padding-bottom:0px;text-alignment:left'>Request Update: </p></div> <textarea id='myFollowUpNotes' style='width:100%;' rows='6' placeholder='Type message here...'></textarea> <div style='float:left;width:80%;border:0px solid gray;padding:5px;'> <label for="sendEmail" style="float:left;width:30%;font-family:Arial;font-size:80%;font-weight:normal;"> <input type="checkbox" checked id="sendEmail" name="sendEmail" value="email"> E-mail </label> <label for="sendSMS" style="float:left;width:30%;font-family:Arial;font-size:80%;font-weight:normal;"> <input type="checkbox" checked id="sendSMS" name="sendSMS" value="sms"> SMS </label> </div> </td> </tr> <tr> <td colspan='1' style='padding:0x;width:250px;background:white;text-align:center;padding-top:5px'> <div style='width:70%;float:right;height:50px;padding:10px;background:white;padding-top:0px'> <button onclick="javascript:hideFollowUpWindow(this);" class='PopUpLowerButtonR'>📑 Close</button> <button id='SendFollowUpMessage' class='PopUpLowerButtonR'> 📬 Send Mesasge</button> <div> </td> </tr> </table> </div> <!--########################## END OF FOLLOW UP WINDOW ############################################--> <!--########################## END OF FOLLOW UP WINDOW ############################################--> <!--########################## ACTION WINDOW ############################################--> <!--########################## ACTION WINDOW ############################################--> <!--########################## END OF EDIT/UPDATING PURCHASE REQEUST id='LoadPOSTEDPRFOpenPRF' ############################################--> <!--########################## END OF EDIT/UPDATING PURCHASE REQEUST ############################################--> </body> </html> <script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script> <script type="text/javascript"> $(document).ready(function(){ //====================================================================================================== $("#searchNewPRF").click(function(){ var searchText = $("#searchText").val(); ShowUploadBar(); //alert(ActionReferenceID); //exit(); if(searchText==''){ alert('Invalid Input. Please check your entry and try again.'); exit(); } $.ajax({ url: "PRF_SearchActiveRequest.php", type: "POST", async: false, data: { "searchText": searchText, "done": 1 }, success: function(d){ ShowUploadBar(); $("#mainTable").html(d); $('#searchText').val(''); } }) }); //====================================================================================================== //====================================================================================================== $("#LoadPOSTEDPRFOpenPRF").click(function(){ var ActionReferenceIDa = $("#ActionReferenceIDa").val(); ShowUploadBar(); //alert(ActionReferenceID); //exit(); $.ajax({ url: "PRF_PostedUnpostedPRF.php", type: "POST", async: false, data: { "ActionReferenceIDa": ActionReferenceIDa, "done": 1 }, success: function(d){ ShowUploadBar(); $("#PostedPRFNewContentInfo").html(d); hideFollowUpOpen(); //$('#searchText').val(''); } }) }); //====================================================================================================== //====================================================================================================== $("#SendFollowUpMessage").click(function(){ //var sendSMS = $("#sendSMS").val(); var sendSMS =$("input[name='sendSMS']:checked").val(); //var sendEmail = $("#sendEmail").val(); var sendEmail =$("input[name='sendEmail']:checked").val(); var ActionReferenceIDa = $("#ActionReferenceIDa").val(); var myFollowUpNotes = $("#myFollowUpNotes").val(); //alert(sendSMS); if(myFollowUpNotes==''){ alert("Message box is empty"); exit; } if(ActionReferenceIDa==''){ alert("Error: No record is selected"); exit; } //exit; //ShowUploadBar(); //if(confirm("CONFIRM UNPOST ACTION: \n\nAre you sure you want to UNPOST this record? \n\n Press 'OK' button to proceed...")){ ShowUploadBar(); $.ajax({ url: "PRF_SendFFMessage.php", type: "POST", async: false, data: { "sendSMS": sendSMS, "sendEmail": sendEmail, "ActionReferenceIDa": ActionReferenceIDa, "myFollowUpNotes": myFollowUpNotes, "done": 1 }, success: function(d){ updateCREATENEWPRF(); $("#mainTable").html(d); ShowUploadBar(); alert("Message has been sent."); hideFollowUpWindow(); } }) //} }); //====================================================================================================== //====================================================================================================== $("#UnPostPRF").click(function(){ var selectedHDRID = $("#selectedHDRID").val(); //alert(selectedHDRID); //exit; if(confirm("CONFIRM UNPOST ACTION: \n\nAre you sure you want to UNPOST this record? \n\n Press 'OK' button to proceed...")){ ShowUploadBar(); $.ajax({ url: "PRF_UnPostNewPRF.php", type: "POST", async: false, data: { "selectedHDRID": selectedHDRID, "done": 1 }, success: function(d){ updateCREATENEWPRF(); $("#mainTable").html(d); ShowUploadBar(); hideOpenItems(); } }) } }); //====================================================================================================== $("#PRFProcessDisApproval").click(function(){ var UpdateReferenceHeaderCode = $("#UpdateReferenceHeaderCode").val(); var DisApprovalCode = $("#DisApprovalCode").val(); //alert(DisApprovalCode); //exit; ShowUploadBar(); $.ajax({ url: "PRF_PostNewDISAPPROVED.php", type: "POST", async: false, data: { "UpdateReferenceHeaderCode": UpdateReferenceHeaderCode, "DisApprovalCode": DisApprovalCode, "done": 1 }, success: function(d){ hidePRFDisApprovedCOnfirmation(); hidePostedPRFForm(); $("#mainTable").html(d); ShowUploadBar(); } }) }); }); </script> <!--- LOCALIZED COPY OF JAVASCRIPT --> <!--##################################################################################################################--> <!--- LOCALIZED COPY OF JAVASCRIPT --> <script type="text/javascript"> function hideFollowUpWindow(){ $("#myFollowUpWindow").fadeOut(300); }; function showFollowUpWindow(){ $("#myFollowUpWindow").fadeIn(300); hideFollowUpOpen(); }; function hideFollowUpOpen(){ $("#PRFTimeLine").fadeOut(500); }; function showFollowUpOpen(){ $("#PRFTimeLine").fadeIn(500); }; function hideOpenItems(){ $("#PRFPOSTEDOpenNewRequest").fadeOut(500); }; function showOpenItems(){ $("#PRFPOSTEDOpenNewRequest").fadeIn(500); hideFollowUp(); }; function showPRFUpdateOpenPRF(row) { var x=row.cells; //document.getElementById("ActionReferenceID").value = x[1].innerHTML; //document.getElementById("ActionReferenceIDDesc").value = "Ref.#: " + x[1].innerHTML; document.getElementById("ActionReferenceIDa").value = x[1].innerHTML; document.getElementById("ActionReferenceIDDesca").value = "Ref.#: " + x[1].innerHTML; document.getElementById("PosteduReferenceID").innerHTML = x[1].innerHTML; document.getElementById("selectedHDRID").value = x[1].innerHTML; document.getElementById("myFollowUpNotes").value=''; document.getElementById("ffReferenceID").innerHTML = "Ref#: " +x[1].innerHTML; showFollowUpOpen(); } //====================================================================================================== 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); } }) } //====================================================================================================== //====================================================================================================== </script>
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings