File manager - Edit - /home/autoph/public_html/connect/home/PRF_AhgAdminViewContentOnly.php
Back
<?php include 'core/init.php'; $activeID=$user_data['u_id']; 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 ='$getdeptHeadID'"),0); $getGMLName = mysql_result(mysql_query("SELECT u_lname FROM vts_users WHERE u_id ='$getdeptHeadID'"),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:360px;'> <?php $getItemDetl = mysql_query("SELECT * FROM prf_request_detl WHERE header_ref_code='$UpdatePRFReferenceNumber' AND `deleted` = 0"); echo "<table>"; echo "<thead>"; echo "<th style='width:100px'>Rec.#</th>"; echo "<th style='width:155px'>REF. #</th>"; echo "<th style='width:320px'>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)){ $count = $count + 1; $itemStatusChk=$row['ahg_admin_id']; if($itemStatusChk !=0){ $itemStatus='Ok'; }else{ $itemStatus='???'; } ?><tr onclick="javascript:POPUPShowDeleteSubItem(this);"><?php echo "<td>".$row['id']."</td>"; echo "<td>".strtoupper($row['header_ref_code'])."</td>"; echo "<td>".strtoupper($row['item_description'])."</td>"; echo "<td>".strtoupper($row['uom'])."</td>"; echo "<td style='text-align:center'>".strtoupper($row['quantity'])."</td>"; echo "<td style='tet-align:center;padding-left:15px'>"; echo $itemStatus; echo "</td>"; echo "</tr>"; } echo "</table>"; ?> </div> <!--- $##################################################################### --> <!--- $##################################################################### --> <div id="PRFDELETENewRequest" class="PopUpActionWindow" style='height:300px'> <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' disabled 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' disabled 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%'>📑 Cancel</button> <button id='deletePRFDetail' class='PopUpLowerButtonR' style='width:25%'> ❌ Delete</button> <button id='approveItem' class='PopUpLowerButtonR' style='width:25%'> 📝 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[2].innerHTML; document.getElementById("selUOM").value = x[3].innerHTML; document.getElementById("selQuantity").value = x[4].innerHTML; document.getElementById("ActionReferenceIDDescXX").value =x[0].innerHTML; //document.getElementById("UpdateuReferenceID").innerHTML = x[1].innerHTML; //document.getElementById("UpdatePRFReferenceNumber").value = x[1].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 selItemDesc = $("#selItemDesc").val(); var ActionReferenceIDDescXX = $("#ActionReferenceIDDescXX").val(); var UpdatePRFReferenceNumber = $("#UpdatePRFReferenceNumber").val(); if(selItemDesc == ""){ alert("Item description is required."); exit; } ShowUploadBar(); //alert(UpdatePRFReferenceNumber); $.ajax({ url: "PRF_AutohubAdminItemApproval.php", type: "POST", async: false, data: { "selItemDesc": selItemDesc, "UpdatePRFReferenceNumber": UpdatePRFReferenceNumber, "ActionReferenceIDDescXX": ActionReferenceIDDescXX, "done": 1 }, success: function(d){ ShowUploadBar(); $("#UpdatePRFItemBody").html(d); hideDeleteAction(); } }) }); //====================================================================================================== $("#updatePRFDetail").click(function(){ var selItemDesc = $("#selItemDesc").val(); var ActionReferenceIDDescXX = $("#ActionReferenceIDDescXX").val(); var UpdatePRFReferenceNumber = $("#UpdatePRFReferenceNumber").val(); // alert(selItemDesc); // alert(ActionReferenceIDDescXX); // alert(UpdatePRFReferenceNumber); // exit(); if(selItemDesc == ""){ alert("Item description is required."); exit; } ShowUploadBar(); //alert(UpdatePRFReferenceNumber); $.ajax({ url: "prf_UpdateItemDescription.php", type: "POST", async: false, data: { "selItemDesc": selItemDesc, "UpdatePRFReferenceNumber": UpdatePRFReferenceNumber, "ActionReferenceIDDescXX": ActionReferenceIDDescXX, "done": 1 }, success: function(d){ ShowUploadBar(); $("#UpdatePRFItemBody").html(d); hideDeleteAction(); } }) }); //====================================================================================================== $("#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){ updateCREATENEWPRF(); $("#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 updateCREATENEWPRF(){ $.ajax({ url: "PRF_Update_CREATE_NEW_PRF.php", type: "POST", async: false, data: { "trans":1 }, success: function(d){ updatePostedPRF(); $("#unPostedPRFRequestCount").html(d); } }) } //====================================================================================================== function updateApprovalPRFSub(){ $.ajax({ url: "PRF_UpdateApprovalCount.php", type: "POST", async: false, data: { "trans":2 }, success: function(d){ $("#forMyApprovalCount").html(d); } }) } //====================================================================================================== function updatePostedPRF(){ $.ajax({ url: "PRF_Update_POSTEDPRF.php", type: "POST", async: false, data: { "trans":2 }, success: function(d){ $("#PostedPRFRequestCount").html(d); } }) } //====================================================================================================== });
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings