File manager - Edit - /home/autoph/public_html/connect/home/PRF_ViewContentOnlyCanvassView.php
Back
<?php include 'core/init.php'; $activeID=$user_data['u_id']; echo "<input type='hidden' id='userID' value='".$activeID."'>"; if(isset($_POST['done'])){ $UpdatePRFReferenceNumber = mysql_escape_string($_POST['UpdatePRFReferenceNumber']); $getCompanyID = mysql_result(mysql_query("SELECT comp_id FROM prf_request_hdr WHERE reference_code='$UpdatePRFReferenceNumber'"),0); $getCompanyName = mysql_result(mysql_query("SELECT comp_name FROM vts_company WHERE comp_id='$getCompanyID'"),0); $getDealerID = mysql_result(mysql_query("SELECT deal_id FROM prf_request_hdr WHERE reference_code='$UpdatePRFReferenceNumber'"),0); $getDealerName = mysql_result(mysql_query("SELECT deal_name FROM vts_dealerships WHERE deal_id='$getDealerID'"),0); $getCategoryID = mysql_result(mysql_query("SELECT category_id FROM prf_request_hdr WHERE reference_code='$UpdatePRFReferenceNumber'"),0); $getCategoryName = mysql_result(mysql_query("SELECT description FROM prf_expensecategory WHERE id='$getCategoryID'"),0); $getSubCatID = mysql_result(mysql_query("SELECT sub_category_id FROM prf_request_hdr WHERE reference_code='$UpdatePRFReferenceNumber'"),0); $getSubCatName = mysql_result(mysql_query("SELECT description FROM prf_expenseitems WHERE id='$getSubCatID'"),0); $getdeptHeadID = mysql_result(mysql_query("SELECT dept_head_id FROM prf_request_hdr WHERE reference_code='$UpdatePRFReferenceNumber'"),0); $getdeptHeadFName = mysql_result(mysql_query("SELECT u_fname FROM vts_users WHERE u_id ='$getdeptHeadID'"),0); $getdeptHeadLName = mysql_result(mysql_query("SELECT u_lname FROM vts_users WHERE u_id ='$getdeptHeadID'"),0); $getReqID = mysql_result(mysql_query("SELECT request_by FROM prf_request_hdr WHERE reference_code='$UpdatePRFReferenceNumber'"),0); $getReqFName = mysql_result(mysql_query("SELECT u_fname FROM vts_users WHERE u_id ='$getReqID'"),0); $getReqLName = mysql_result(mysql_query("SELECT u_lname FROM vts_users WHERE u_id ='$getReqID'"),0); $requestedBy = $getReqLName .", ". $getReqFName; $getGMID = mysql_result(mysql_query("SELECT approving_GM_id FROM prf_request_hdr WHERE reference_code='$UpdatePRFReferenceNumber'"),0); $getGMFName = mysql_result(mysql_query("SELECT u_fname FROM vts_users WHERE u_id ='$getGMID'"),0); $getGMLName = mysql_result(mysql_query("SELECT u_lname FROM vts_users WHERE u_id ='$getGMID'"),0); $requestedByGM =$getGMLName .", ".$getGMFName; $adminApprovalDate = mysql_result(mysql_query("SELECT authorizing_approval_date FROM prf_request_hdr WHERE reference_code='$UpdatePRFReferenceNumber'"),0); $dateNeeded = mysql_result(mysql_query("SELECT date_needed FROM prf_request_hdr WHERE reference_code='$UpdatePRFReferenceNumber'"),0); $purpose = mysql_result(mysql_query("SELECT purpose_of_request FROM prf_request_hdr WHERE reference_code='$UpdatePRFReferenceNumber'"),0); } ?> <input type='hidden' id="UpdateReferenceHeaderCode" value='<?php echo $UpdatePRFReferenceNumber;?>'> <div class='PRFdropItemSelectionContainer'> <div class='PRFdropItemSelection'> <p class='buttonTitle'>Select Company:</p> <select disabled id='UpdateprfCompanySelected' class='DropDownButton' onchange="showDealership(this.value)"> <?php echo "<option value='".$getCompanyID."'>".strToupper($getCompanyName)."</option>"; ?> </select> </div> <div class='PRFdropItemSelection'> <p class='buttonTitle'>Select Dealer:</p> <select disabled id='UpdatemyDealerList' class='DropDownButton' > <?php echo "<option value='".$getDealerID."'>".strToupper($getDealerName)."</option>"; ?> </select> </div> <div class='PRFdropItemSelection'> <p class='buttonTitle'>Select Expense Category:</p> <select disabled id='UpdateprfCategorySelected' class='DropDownButton' onchange="showCategoryItems(this.value)"> <?php echo "<option value='".$getSubCatID."'>".strToupper($getCategoryName)."</option>"; ?> </select> </div> <div class='PRFdropItemSelection'> <p class='buttonTitle'>Expense Type:</p> <select disabled id='UpdateCategorySubItem' class='DropDownButton' > <?php echo "<option value='".$getCategoryID."'>".strToupper($getSubCatName)."</option>"; ?> </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 disabled type='text' id='UpdatePurposeOfReqeust' class='DropDownButton' value='<?php echo $purpose;?>'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:(d/m/Y)</p> <input disabled type='date' id='UpdateDateNeeded' value='<?php echo $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 disabled id='UpdateprfApprovingHead' class='DropDownButton' style='margin:0px;' > <?php echo "<option value='".$getdeptHeadID."'>".strToupper($getdeptHeadLName).", ".strToupper($getdeptHeadFName)."</option>"; ?> </select> </div> </div> <div class='PRFAddNewItem'> <div class='PRFdropItemSelection' style='width:33%;background:transparent;padding-bottom:0px;padding-top:0px'> <p class='buttonTitle' style='margin-top:0px;padding-top:0px'>Requested by:</p> <input type='text' disabled value="<?php echo $requestedBy;?>" class='DropDownButton' style='margin:0px;'> </div> <div class='PRFdropItemSelection' style='width:33%;background:transparent;padding-bottom:0px;padding-top:0px'> <p class='buttonTitle' style='margin-top:0px;padding-top:0px'>Approved by GM:</p> <input type='text' disabled value="<?php echo $requestedByGM;?>" class='DropDownButton' style='margin:0px;'> </div> <div class='PRFdropItemSelection' style='width:33%;background:transparent;padding-bottom:0px;padding-top:0px'> <p class='buttonTitle' style='margin-top:0px;padding-top:0px'>PRF Completion Date::</p> <input type='text' disabled value="<?php echo $adminApprovalDate;?>" class='DropDownButton' style='margin:0px;'> </div> </div> <div class='PRFNewTableBody' id='UpdatePRFItemBody' style='height:260px;overflow:auto;background:white'> <?php $getItemDetl = mysql_query("SELECT * FROM prf_request_detl WHERE header_ref_code='$UpdatePRFReferenceNumber'"); echo "<table>"; echo "<thead>"; echo "<th style='width:50px'>Rec.#</th>"; echo "<th style='width:100px'>REF. #</th>"; echo "<th style='width:100px'>TYPE</th>"; echo "<th style='width:300px'>ITEM DESCRIPTION</th>"; echo "<th style='width:50px'>UoM</th>"; echo "<th style='width:50px'>QUANTITY</th>"; echo "<th style='width:5px'>-</th>"; echo "</thead>"; while($row=mysql_fetch_array($getItemDetl)){ $prfNumber = $row['header_ref_code']; $count = $count + 1; $itemStatusChk=$row['ahg_admin_id']; $isDeleted = $row['deleted']; if($itemStatusChk == 0){ if($isDeleted == 1){ $txtcolor='red'; $itemStatus='❌'; }else{ $txtcolor='black'; $itemStatus='❔'; } }else{ $itemStatus='✅'; $txtcolor='black'; } ?><tr onclick="javascript:POPUPShowDeleteSubItem(this);"><?php echo "<td style='font-family:Calibri;color:$txtcolor'>".$row['id']."</td>"; echo "<td style='font-family:Calibri;color:$txtcolor'>".strtoupper($row['header_ref_code'])."</td>"; echo "<td style='font-family:Calibri;color:$txtcolor'>"; $getClass = mysql_result(mysql_query("SELECT `item_category` FROM `prf_item_category` WHERE `id`='".$row['item_class']."'"),0); echo strtoupper($getClass); echo"</td>"; echo "<td style='font-family:Calibri;color:$txtcolor'>".strtoupper($row['item_description'])."</td>"; echo "<td style='font-family:Calibri;color:$txtcolor'>".strtoupper($row['uom'])."</td>"; echo "<td style='text-align:center;color:$txtcolor'>".strtoupper($row['quantity'])."</td>"; echo "<td style='tet-align:center;padding-left:15px;color:$txtcolor'>"; echo $itemStatus; echo "</td>"; echo "</tr>"; } echo "</table>"; $chkAttachment = mysql_result(mysql_query("SELECT `attachment` FROM `prf_request_hdr` WHERE `reference_code`='$prfNumber'"),0); if($chkAttachment == ""){ echo "<p style='padding:10px;background:white;color:blue;text-align:right'>No attachment</p>"; }else{ echo "<a href='FILES/prfdoc/".$chkAttachment."' target='_Blank' style='padding:10px;background:white;float:right;color:blue'><abbr title='View Attached document'>📑</abbr></a>"; } ?> </div> <!--- $##################################################################### --> <!--- $##################################################################### --> <div id="PRFDELETENewRequest" class="PopUpActionWindow" style='height:297px'> <div class='PopUpWindowTitle'> 🪧 Confirm Action <div class='PopUpWindowClose'> <b onclick="javascript:hideDeleteAction(this);" style='font-weight:bold'> ✕ </b> </div> </div> <table> <tr> <td style='padding:10px;width:100%;background:white;font-family:Yu Gothic; font-size:16px;color:red ;height:10px;font-weight:normal;text-align:left'> <input disabled type='hidden' id='DelActionReferenceID' 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'> <div style='width:100%;font-family:Yu Gothic Light;font-size:12px'>Item Description: <textarea id='selItemDesc' rows='3' style='width:100%;padding:4px'></textarea> </div> <div style='width:40%;float:left;padding:4px;margin-right:15px;float:left;font-family:Yu Gothic Light;font-size:12px'>Ordered Qty: <input type='text' id='selQuantity' style='width:100%;padding:4px;margin:0px;margin-right:0px;float:left;text-align:center'> </div> <div style='width:40%;float:left;padding:4px;margin-right:15px;float:left;font-family:Yu Gothic Light;font-size:12px'>Unit of Measure: <input type='text' id='selUOM' style='width:100%;padding:4px;margin:0px;margin-right:0px;float:left;text-align:center'> </div> <input type='hidden' id='ActionReferenceIDDescXX' 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:0px;padding-bottom:2px'> </td> </tr> <td colspan='2' style='padding:5px;width:250px;background:white;text-align:center'> <hr style='border:1px solid white;border-bottom:1px solid gray;'><br> <button onclick="javascript:hideDeleteAction(this);" class='PopUpLowerButtonR' style='width:25%'>🔙 Close</button> <!--<button id='deletePRFDetail' class='PopUpLowerButtonR' style='width:28%'> ❌ DisApprove</button> <button id='approveItem' class='PopUpLowerButtonR' style='width:22%'> ☑ Approve</button>--> <button id='updatePRFDetail' class='PopUpLowerButtonR' style='width:25%'> 📝 Update</button> </td> </tr> </table> </div> <!--- $##################################################################### --> <!--- $##################################################################### --> <!--- LOCALIZED COPY OF JAVASCRIPT --> <!--- LOCALIZED COPY OF JAVASCRIPT --> <script type="text/javascript"> function hideActionViewDelete(){ $("#showActionViewDelete").fadeOut(500); }; function hideDeleteAction(){ $("#PRFDELETENewRequest").fadeOut(500); }; function showDeleteAction(){ $("#PRFDELETENewRequest").fadeIn(500); }; function POPUPShowDeleteSubItem(row) { showDeleteAction(); var x=row.cells; document.getElementById("DelActionReferenceID").value = x[0].innerHTML; document.getElementById("selItemDesc").value = x[3].innerHTML; document.getElementById("selUOM").value = x[4].innerHTML; document.getElementById("selQuantity").value = x[5].innerHTML; document.getElementById("ActionReferenceIDDescXX").value =x[0].innerHTML; } </script> <script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script> <script type="text/javascript"> $(document).ready(function(){ //====================================================================================================== $("#btnUpdateNewItem").click(function(){ var UpdatePRFReferenceNumber = $("#UpdatePRFReferenceNumber").val(); var UpdateprfCompanySelected = $("#UpdateprfCompanySelected").val(); var UpdatemyDealerList = $("#UpdatemyDealerList").val(); var UpdateprfCategorySelected = $("#UpdateprfCategorySelected").val(); var UpdateCategorySubItem = $("#UpdateCategorySubItem").val(); var UpdatePurposeOfReqeust = $("#UpdatePurposeOfReqeust").val(); var UpdateDateNeeded = $("#UpdateDateNeeded").val(); var UpdateprfApprovingHead = $("#UpdateprfApprovingHead").val(); var UpdatetxtAddItemDesc = $("#UpdatetxtAddItemDesc").val(); var UpdatetxtAddItemQty = $("#UpdatetxtAddItemQty").val(); var UpdateUnitOfMeasure = $("#UpdateUnitOfMeasure").val(); if(UpdatetxtAddItemDesc == ""){ alert("Please type something in the item description"); exit; } if(UpdatetxtAddItemQty == ""){ alert("Please select unit of measure"); exit; } ShowUploadBar(); //alert(UpdatePRFReferenceNumber); $.ajax({ url: "PRF_UPDATEPRFItemsAndHeaders.php", type: "POST", async: false, data: { "UpdatePRFReferenceNumber": UpdatePRFReferenceNumber, "UpdateprfCompanySelected": UpdateprfCompanySelected, "UpdatemyDealerList": UpdatemyDealerList, "UpdateprfCategorySelected": UpdateprfCategorySelected, "UpdateCategorySubItem": UpdateCategorySubItem, "UpdatePurposeOfReqeust": UpdatePurposeOfReqeust, "UpdateDateNeeded": UpdateDateNeeded, "UpdateprfApprovingHead": UpdateprfApprovingHead, "UpdatetxtAddItemDesc": UpdatetxtAddItemDesc, "UpdatetxtAddItemQty": UpdatetxtAddItemQty, "UpdateUnitOfMeasure": UpdateUnitOfMeasure, "done": 1 }, success: function(d){ ShowUploadBar(); //invShowAssignMsg(); $("#UpdatePRFItemBody").html(d); //invHideAssignMsg(); //$('#searchText').val(''); } }) }); //====================================================================================================== $("#approveItem").click(function(){ var DelActionReferenceID = $("#DelActionReferenceID").val(); var selItemDesc = $("#selItemDesc").val(); var ActionReferenceIDDescXX = $("#ActionReferenceIDDescXX").val(); var UpdatePRFReferenceNumber = $("#UpdatePRFReferenceNumber").val(); //arnel var userID = $("#userID").val(); //arnel if(userID == 0 ){ alert('You session has been expired. Please re-login to continue...'); return false; } //alert(UpdatePRFReferenceNumber); //exit; if(selItemDesc == ""){ alert("Item description is required."); return false; } ShowUploadBar(); //alert(UpdatePRFReferenceNumber); $.ajax({ url: "PRF_AutohubAdminItemApproval.php", type: "POST", async: false, data: { "userID": userID, "selItemDesc": selItemDesc, "DelActionReferenceID": DelActionReferenceID, "UpdatePRFReferenceNumber": UpdatePRFReferenceNumber, "ActionReferenceIDDescXX": ActionReferenceIDDescXX, "done": 1 }, success: function(d){ ShowUploadBar(); $("#UpdatePRFItemBody").html(d); hideDeleteAction(); updateAdminApprovalWindow(); updateForCanvassCount(); /* Swal.fire({ position: 'top-start', icon: 'success', title: 'Request has been approved for canvass', showConfirmButton: false, timer: 2000 }) */ } }) }); //====================================================================================================== $("#updatePRFDetail").click(function(){ var selItemDesc = $("#selItemDesc").val(); var ActionReferenceIDDescXX = $("#ActionReferenceIDDescXX").val(); var UpdatePRFReferenceNumber = $("#UpdatePRFReferenceNumber").val(); var selQuantity = $("#selQuantity").val(); var selUOM = $("#selUOM").val(); // alert(selItemDesc); // alert(ActionReferenceIDDescXX); // alert(UpdatePRFReferenceNumber); // exit(); if(selUOM == ""){ alert("ERROR: Invalid Unit of Measure."); return false; } if(selItemDesc == ""){ alert("ERROR: Item description is required."); return false; } if(selQuantity == ""){ alert("ERROR: Invalid input quantity."); return false; } if(selQuantity == 0){ alert("ERROR: Invalid input quantity."); return false; } ShowUploadBar(); //alert(UpdatePRFReferenceNumber); $.ajax({ url: "prf_UpdateItemDescription.php", type: "POST", async: false, data: { "selQuantity": selQuantity, "selUOM": selUOM, "selItemDesc": selItemDesc, "UpdatePRFReferenceNumber": UpdatePRFReferenceNumber, "ActionReferenceIDDescXX": ActionReferenceIDDescXX, "done": 1 }, success: function(d){ ShowUploadBar(); $("#UpdatePRFItemBody").html(d); hideDeleteAction(); Swal.fire({ position: 'top-start', icon: 'success', title: 'Record has been updated', showConfirmButton: false, timer: 2000 }) } }) }); //====================================================================================================== $("#btnPostNewPRFUpdate").click(function(){ var UpdateReferenceHeaderCode = $("#UpdateReferenceHeaderCode").val(); //alert(UpdateReferenceHeaderCode); //exit; ShowUploadBar(); $.ajax({ url: "PRF_PostUnpostedPRF.php", type: "POST", async: false, data: { "UpdateReferenceHeaderCode": UpdateReferenceHeaderCode, "done": 1 }, success: function(d){ $("#mainTable").html(d); hideUpdatePRFForm(); ShowUploadBar(); updateApprovalPRFSub(); } }) }); //====================================================================================================== $("#deletePRFDetail").click(function(){ var DelActionReferenceID = $("#DelActionReferenceID").val(); //alert(DelActionReferenceID); 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_Detail.php", type: "POST", async: false, data: { "DelActionReferenceID": DelActionReferenceID, "done": 1 }, success: function(d){ ShowUploadBar(); //invShowAssignMsg(); $("#UpdatePRFItemBody").html(d); hideDeleteAction(); //$('#searchText').val(''); 015334295-1005 } }) } }); //====================================================================================================== $("#btnCloseButtonUpdate").click(function(){ hideUpdatePRFForm(); hideActionViewDelete(); ShowUploadBar(); $.ajax({ url: "PRF_NewResfresh.php", type: "POST", async: false, data: { }, success: function(d){ ShowUploadBar(); //invShowAssignMsg(); $("#UpdatePRFItemBody").html(d); //invHideAssignMsg(); //$('#searchText').val(''); } }) }); //====================================================================================================== //====================================================================================================== function updateAdminApprovalWindow(){ ShowUploadBar(); $.ajax({ url: "PRF_ahgPRFApproval.php", type: "POST", async: false, data: { }, success: function(d){ ShowUploadBar(); updateAdminApprovalDashboardCount(); $("#cleranceTemplateView").html(d); } }) } //====================================================================================================== function updateAdminApprovalDashboardCount(){ $.ajax({ url: "PRF_UpdateAHGAdminApprovalCount.php", type: "POST", async: false, data: { "trans":2 }, success: function(d){ $("#AHGadminApprovalCount").html(d); updateForCanvassCount(); } }) } //====================================================================================================== function updateApprovalPRFSub(){ $.ajax({ url: "PRF_UpdateApprovalCount.php", type: "POST", async: false, data: { "trans":2 }, success: function(d){ $("#forMyApprovalCount").html(d); } }) } //====================================================================================================== function updateForCanvassCount(){ $.ajax({ url: "PRF_UpdateForCanvassCount.php", type: "POST", async: false, data: { "trans":2 }, success: function(d){ $("#canvassCount").html(d); } }) } //====================================================================================================== });
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings