File manager - Edit - /home/autoph/public_html/connect/home/PRF_SearchResults.php
Back
<?php include 'core/init.php'; protected_page(); $UTIL = $user_data['UTIL']; $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; $radioValue = mysql_escape_string($_POST['radioValue']); $searchString = mysql_escape_string($_POST['searchString']); $recNo = mysql_result(mysql_query("SELECT `id` FROM `prf_request_hdr` WHERE `reference_code`='$searchString'"),0); $prfNumber = mysql_result(mysql_query("SELECT `reference_code` FROM `prf_request_hdr` WHERE `reference_code`='$searchString'"),0); $recCompID = mysql_result(mysql_query("SELECT `comp_id` FROM `prf_request_hdr` WHERE `reference_code`='$searchString'"),0); $recCompName = mysql_result(mysql_query("SELECT `comp_name` FROM `vts_company` WHERE `comp_id`='$recCompID'"),0); $recDealID = mysql_result(mysql_query("SELECT `deal_id` FROM `prf_request_hdr` WHERE `reference_code`='$searchString'"),0); $recDealName = mysql_result(mysql_query("SELECT `deal_name` FROM `vts_dealerships` WHERE `deal_id`='$recDealID'"),0); $recuserID = mysql_result(mysql_query("SELECT `request_by` FROM `prf_request_hdr` WHERE `reference_code`='$searchString'"),0); $recUserFName = mysql_result(mysql_query("SELECT `u_fname` FROM `vts_users` WHERE `u_id`='$recuserID'"),0); $recUserLName = mysql_result(mysql_query("SELECT `u_lname` FROM `vts_users` WHERE `u_id`='$recuserID'"),0); $recPurpose = mysql_result(mysql_query("SELECT `purpose_of_request` FROM `prf_request_hdr` WHERE `reference_code`='$searchString'"),0); $recDatePosted = mysql_result(mysql_query("SELECT `date_created` FROM `prf_request_hdr` WHERE `reference_code`='$searchString'"),0); $recDateNeeded = mysql_result(mysql_query("SELECT `date_needed` FROM `prf_request_hdr` WHERE `reference_code`='$searchString'"),0); $headApprovalID = mysql_result(mysql_query("SELECT `dept_head_id` FROM `prf_request_hdr` WHERE `reference_code`='$searchString'"),0); $headFName = mysql_result(mysql_query("SELECT `u_fname` FROM `vts_users` WHERE `u_id`='$headApprovalID'"),0); $headLName = mysql_result(mysql_query("SELECT `u_lname` FROM `vts_users` WHERE `u_id`='$headApprovalID'"),0); $gmID = mysql_result(mysql_query("SELECT `approving_GM_id` FROM `prf_request_hdr` WHERE `reference_code`='$searchString'"),0); $gmFName = mysql_result(mysql_query("SELECT `u_fname` FROM `vts_users` WHERE `u_id`='$gmID'"),0); $gmLName = mysql_result(mysql_query("SELECT `u_lname` FROM `vts_users` WHERE `u_id`='$gmID'"),0); $aghAdminID = mysql_result(mysql_query("SELECT `ahg_admin_id` FROM `prf_request_hdr` WHERE `reference_code`='$searchString'"),0); $aghAdminFName = mysql_result(mysql_query("SELECT `u_fname` FROM `vts_users` WHERE `u_id`='$aghAdminID'"),0); $aghAdminLName = mysql_result(mysql_query("SELECT `u_lname` FROM `vts_users` WHERE `u_id`='$aghAdminID'"),0); $validatorID =mysql_result(mysql_query("SELECT `approving_admin_id` FROM `prf_request_hdr` WHERE `reference_code`='$searchString'"),0); $validatorFName = mysql_result(mysql_query("SELECT `u_fname` FROM `vts_users` WHERE `u_id`='$validatorID'"),0); $validatorLName = mysql_result(mysql_query("SELECT `u_lname` FROM `vts_users` WHERE `u_id`='$validatorID'"),0); $deptApproval = mysql_result(mysql_query("SELECT `dept_approval_date` FROM `prf_request_hdr` WHERE `reference_code`='$searchString'"),0); if($deptApproval==""){ $HeadResendLink ="True"; $deptApproval ="<b style='font-family:Calibri;color:red;font-weight:normal'>Pending Approval</b>"; }else{ $HeadResendLink ="False"; $deptApproval = "<b style='font-family:Calibri;color:blue;font-weight:normal'>Signed: ".$deptApproval."</b>"; } $gmApproval = mysql_result(mysql_query("SELECT `gm_approval_date` FROM `prf_request_hdr` WHERE `reference_code`='$searchString'"),0); if($gmApproval==""){ $gmResendLink ="True"; $gmApproval ="<b style='font-family:Calibri;color:red;font-weight:normal'>Pending Approval</b>"; }else{ $gmResendLink ="False"; $gmApproval = "<b style='font-family:Calibri;color:blue;font-weight:normal'>Signed: ".$gmApproval."</b>"; } $assetApproval = mysql_result(mysql_query("SELECT `admin_approval_date` FROM `prf_request_hdr` WHERE `reference_code`='$searchString'"),0); if($assetApproval==""){ $validtorResendLink ="True"; $assetApproval ="<b style='font-family:Calibri;color:red;font-weight:normal'>Pending Approval</b>"; }else{ $validtorResendLink ="False"; $assetApproval = "<b style='font-family:Calibri;color:blue;font-weight:normal'>Signed: ".$assetApproval."</b>"; } $assetAdminApproval = mysql_result(mysql_query("SELECT `ahg_admin_date` FROM `prf_request_hdr` WHERE `reference_code`='$searchString'"),0); if($assetAdminApproval==""){ $assetAdminApproval ="<b style='font-family:Calibri;color:red;font-weight:normal'>Pending Approval</b>"; }else{ $assetAdminApproval = "<b style='font-family:Calibri;color:blue;font-weight:normal'>Signed: ".$assetAdminApproval."</b>"; } $poNumberChecker = mysql_result(mysql_query("SELECT COUNT(1) FROM `prf_purchase_order` WHERE `po_number`='$searchString'"),0); if($poNumberChecker > 0){ $poNumber = $searchString; }else{ $poNumber = ""; } //$poNumber = mysql_result(mysql_query("SELECT `sup_PO_number` FROM `prf_request_hdr` WHERE `reference_code`='$searchString'"),0); $prfstat = mysql_result(mysql_query("SELECT `current_status` FROM `prf_request_hdr` WHERE `reference_code`='$searchString'"),0); $prfStatus = mysql_result(mysql_query("SELECT `status_name` FROM `prf_status` WHERE `sequence`='$prfstat'"),0); ?> <!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 id="POActionaForm" class="purchaseOrderForm" style='position:fixed;background:white;width:50%;height:450px'> <div class='PopUpWindowTitle'> 🪧 EXECOM SIGNATORIES <div class='PopUpWindowClose'> <b onclick="javascript:hideExecomApproval(this);" style='font-weight:bold'> ✕ </b> </div> </div> <div id='showItemDesc' style='float:left;width:98%;margin:1%;margin-bottom:2px;height:80px;background:yellow;padding:5px;font-family:Calibri;font-size:16px;color:black;border:1px solid gray;'> </div> <div id='showExecomApprovalData' style='float:left;width:98%;margin:1%;height:300px;overflow:auto;background:white;padding:5px;margin-top:2px;font-family:Calibri;font-size:16px;color:black;border:1px solid gray'> </div> <input type='hidden' id='itemID'> </div> <!--###################################################################################################################################--> <!--###################################################################################################################################--> <div class='NewPRFHeader'> <p class='PRFBodyTitle'>📑 SEARCH RESULT <?php echo "for ". $radioValue." #: ( ". $searchString;?> )</p> <input type='text' disabled class='PRFBodyTitle' value='<?php echo $radioValue;?>' style='text-align:right;font-size:12px;text-decoration:underl;float:right;background:black;width:50%;border:0px;color:white;padding:10px;'> </div> <!--########################## MAIN TABLE WINDOW ############################################--> <!--########################################################################################################--> <div class='NewPRFBody'> <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'> <?php if(isset($_POST['done'])){ $radioValue = mysql_real_escape_string($_POST['radioValue']); $searchString = mysql_real_escape_string($_POST['searchString']); switch($radioValue){ // case 'PRFNumber': echo "<div style='padding:10px;width:100%;height:150px;border:0px solid lightgray;'>"; echo "<table>"; echo "<thead>"; echo "<th style='width:5%'>Rec. No</th>"; echo "<th style='width:10%'>PRF Number</th>"; echo "<th style='width:15%'>Company</th>"; echo "<th style='width:15%'>Dealer</th>"; echo "<th style='width:15%'>Requested By</th>"; echo "<th style='width:22%'>Purpose of Request</th>"; echo "<th style='width:10%'>Request Date</th>"; echo "<th style='width:8%'>Date Needed</th>"; echo "</thead>"; if($prfNumber ==""){ echo "<td colspan='8' style='height:100px;padding:10px;text-align:center'>-- NO RECORD FOUND --</td>"; }else{ echo "<tr>"; echo "<td>".$recNo."</td>"; echo "<td>".$prfNumber."</td>"; echo "<td>".strtoupper($recCompName)."</td>"; echo "<td>".strtoupper($recDealName)."</td>"; echo "<td>".strtoupper($recUserFName)." ".strtoupper($recUserLName)."</td>"; echo "<td>".strtoupper($recPurpose)."</td>"; echo "<td>".$recDatePosted."</td>"; echo "<td>".$recDateNeeded."</td>"; echo "</tr>"; echo "<tr>"; echo "<td colspan='2' style='background:white;padding:10px;height:70px'><b>Head APPROVAL:</b><br>".$headFName ." ".$headLName."<br>"; if($HeadResendLink=="True"){ if($UTIL == 1){ echo "<input type='hidden' id='txtHeadID' value='".$gmID."'>"; echo "<input type='hidden' id='headPRFNumber' value='".$searchString."'>"; echo "<p id='resendHeadLink' class='searchResendLink'>📩 ".$deptApproval."</p>"; }else{ echo $deptApproval; } }else{ echo $deptApproval; } echo"</td>"; echo "<td colspan='1' style='background:white;padding:10px;height:70px'>"; //<b>GM APPROVAL:</b><br>".$gmFName ." ".$gmLName."<br>"; /* if($gmResendLink=="True"){ if($UTIL == 1){ echo "<input type='hidden' id='txtGMID' value='".$gmID."'>"; echo "<input type='hidden' id='SearchPRFNumber' value='".$searchString."'>"; echo "<p id='resendGMLink' class='searchResendLink'>📩 ".$gmApproval."</p>"; }else{ echo $gmApproval; } }else{ echo $gmApproval; } */ echo"</td>"; echo "<td colspan='1' style='background:white;padding:10px;height:70px'><b>ASSET VALIDATOR:</b><br>".$validatorFName ." ".$validatorLName."<br>"; if($validtorResendLink=="True"){ if($UTIL == 1){ echo "<input type='hidden' id='txtValidatorID' value='".$validatorID."'>"; echo "<input type='hidden' id='validatePRFNumber' value='".$searchString."'>"; echo "<p id='resendValidatorLink' class='searchResendLink'>📩 ".$assetApproval."</p>"; }else{ echo $assetApproval; } }else{ echo $assetApproval; } echo"</td>"; echo "<td colspan='1' style='background:white;padding:10px;height:70px'><b>AHG ADMIN APPROVAL:</b><br>".$aghAdminFName ." ".$aghAdminLName."<br>".$assetAdminApproval."</td>"; //echo "<td colspan='1' style='background:white;padding:10px;height:70px'><b>PO NUMBER:</b><br><br>".$poNumber."<br></td>"; //echo "<td colspan='2' style='background:white;padding:10px;height:70px'><b>RF STATUS:</b><br><br>".$prfStatus."<br></td>"; echo "</tr>"; } echo "</table>"; echo "</div>"; $getItemDetl = mysql_query("SELECT * FROM `prf_request_detl` WHERE `header_ref_code` ='$searchString'"); echo "<div style='margin-top:10px;padding:10px;width:100%;height:150px;border:0px solid lightgray;'>"; echo "<table id='showExecomItemApproval'>"; echo "<thead>"; echo "<th style='width:5%'>Rec. No</th>"; echo "<th style='width:10%'>PO NUMBER</th>"; echo "<th style='width:50%'>ITEM DESCRIPTION</th>"; echo "<th style='width:10%'>UOM</th>"; echo "<th style='width:10'>QUANTITY</th>"; echo "<th style='width:15%;'>ITEM STATUS</th>"; echo "</thead>"; while($row=mysql_fetch_array($getItemDetl)){ ?><tr onclick="javascript:getInfo(this);" ><?php $itmStat = $row['item_status']; $ahgAHGAdminID = $row['ahg_admin_id']; $ahgAHGAdminDate = $row['ahg_admin_date']; $itemStatus = mysql_result(mysql_query("SELECT `status_name` FROM `prf_status` WHERE `sequence`='$itmStat'"),0); /* if($itmStat == 4){ if($ahgAHGAdminID == 0 && $ahgAHGAdminDate ==''){ $itemStatus ='AHG Admin Approval'; }else{ $itemStatus = mysql_result(mysql_query("SELECT `status_name` FROM `prf_status` WHERE `sequence`='$itmStat'"),0); } }else{ $itemStatus = mysql_result(mysql_query("SELECT `status_name` FROM `prf_status` WHERE `sequence`='$itmStat'"),0); } */ echo "<td style='border:1px solid white'>".$row['id']."</td>"; echo "<td style='border:1px solid white'>".strtoupper($row['po_code'])."</td>"; echo "<td style='border:1px solid white'>".strtoupper($row['item_description'])."</td>"; echo "<td style='border:1px solid white'>".strtoupper($row['uom'])."</td>"; echo "<td style='border:1px solid white'>".strtoupper($row['quantity'])."</td>"; echo "<td style='border:1px solid white'>".strtoupper($itemStatus)."</td>"; echo "</tr>"; } echo "<tr>"; echo "<td colspan='2' style='background:white;padding:10px;height:70px;border:1px solid white'></td>"; echo "</tr>"; echo "<tr>"; echo "<td colspan='2' style='background:white;padding:10px;height:70px;border:1px solid white'></td>"; echo "<td colspan='1' style='background:white;padding:10px;height:70px;vertical-align:top;border:1px solid white'>INVOICE NUMBER:<br>"; $getAllInvoice = mysql_query("SELECT * FROM `prf_delivery_receiving_logs` WHERE `po_number`='$poNumber'"); while($inv=mysql_fetch_array($getAllInvoice)){ echo $inv['inv_number']."<br>"; } echo"</td>"; echo "<td colspan='1' style='background:white;padding:10px;height:70px;vertical-align:top;border:1px solid white'>DR NUMBER:<br>"; $getAllDR = mysql_query("SELECT * FROM `prf_delivery_receiving_logs` WHERE `po_number`='$poNumber'"); while($dr=mysql_fetch_array($getAllDR)){ echo $dr['dr_number']."<br>"; } echo"</td>"; echo "<td colspan='1' style='background:white;padding:10px;height:70px;vertical-align:top;border:1px solid white'>AMOUNT:<br>"; $getAllAmount = mysql_query("SELECT * FROM `prf_delivery_receiving_logs` WHERE `po_number`='$poNumber'"); while($inv=mysql_fetch_array($getAllAmount)){ echo "Php. ". $inv['dr_amount']."<br>"; } echo"</td>"; echo "</tr>"; echo "<tr>"; echo "<td colspan='5' style='background:white;padding:10px;height:70px;border:1px solid white;text-align:right;padding:20px'><a href='prfview.php?prf=".$prfNumber."' target='_Blank'>View PRF Form</a></td>"; echo "</tr>"; echo "</table>"; $prfStatus = mysql_result(mysql_query("SELECT `current_status` FROM `prf_request_hdr` WHERE `reference_code`='$searchString'"),0); switch($prfStatus){ // // case '0': // $status ='Unposted'; // break; // case '1': // $status ='Head Approval'; // break; // case '2': // $status ='GM Approval'; // break; // case '3': // $status ='Checking Available Assets'; // break; // case '4': // $status ='For Canvass'; // break; // case '5': // $status ='User Approval'; // break; // case '6': // $status ='CANVASS Approval'; // break; // case '7': // $status ='PO Creation'; // break; // case '8': // $status ='For PO Approval'; // break; // case '9': // $status ='Waiting for Delivery'; // break; // case '10': // $status ='Delivered'; // break; // case '11': // $status ='Ready for Pickup'; // break; // case '12': // $status ='Received by User'; // break; case '91': $status ='Disapprove by Head'; break; case '92': $status ='Disapprove by GM'; break; case '93': $status ='Cancelled PRF'; break; case '94': $status ='No Supplier Available'; break; case '95': $status ='Disapproved by EXECOM'; break; case '100': $status ='Returned with Revision'; break; } echo "<p style='font-family:Tamoma;font-size:40px;color:red;padding:5px;margin:0px;opacity:9;text-shadow:1px 1px black'>".$status."</p>"; echo "</div>"; break; case 'PONumber': echo "<div style='float:left;padding:10px;width:100%;height:auto;border:0px solid lightgray;'>"; echo "<table>"; echo "<thead>"; echo "<th style='width:5%'>Rec. No</th>"; echo "<th style='width:10%'>P.O Date</th>"; echo "<th style='width:10%'>PO Number</th>"; echo "<th style='width:21%'>Company</th>"; echo "<th style='width:21%'>Dealer</th>"; echo "<th style='width:23%'>Vendory</th>"; echo "<th style='width:10%'>Amount</th>"; echo "</thead>"; if($poNumberChecker == 0){ echo "<td colspan='8' style='height:100px;padding:10px;text-align:center'>-- NO RECORD FOUND --</td>"; }else{ $srecNo=mysql_result(mysql_query("SELECT `id` FROM `prf_purchase_order` WHERE `po_number`='$searchString'"),0); $poID = mysql_result(mysql_query("SELECT `id` FROM `prf_purchase_order` WHERE `po_number`='$searchString'"),0); $spoDate = mysql_result(mysql_query("SELECT `date_posted` FROM `prf_purchase_order` WHERE `po_number`='$searchString'"),0); $spoDateCreated = mysql_result(mysql_query("SELECT `date_created` FROM `prf_purchase_order` WHERE `po_number`='$searchString'"),0); $spoDateChecked = mysql_result(mysql_query("SELECT `date_checked` FROM `prf_purchase_order` WHERE `po_number`='$searchString'"),0); $spoDateApproved = mysql_result(mysql_query("SELECT `date_approved` FROM `prf_purchase_order` WHERE `po_number`='$searchString'"),0); $spoVendorForwarded = mysql_result(mysql_query("SELECT `date_forwarded_to_vendor` FROM `prf_purchase_order` WHERE `po_number`='$searchString'"),0); $spoVendorReceived = mysql_result(mysql_query("SELECT `date_forwarded_to_vendor` FROM `prf_purchase_order` WHERE `po_number`='$searchString'"),0); $spoNumber = mysql_result(mysql_query("SELECT `po_number` FROM `prf_purchase_order` WHERE `po_number`='$searchString'"),0); $recsCompID = mysql_result(mysql_query("SELECT `comp_id` FROM `prf_purchase_order` WHERE `po_number`='$searchString'"),0); $recsCompName = mysql_result(mysql_query("SELECT `comp_name` FROM `vts_company` WHERE `comp_id`='$recsCompID'"),0); $recsDealID = mysql_result(mysql_query("SELECT `dealer_id` FROM `prf_purchase_order` WHERE `po_number`='$searchString'"),0); $recsDealName = mysql_result(mysql_query("SELECT `deal_name` FROM `vts_dealerships` WHERE `deal_id`='$recsDealID'"),0); $sVendorID = mysql_result(mysql_query("SELECT `vendor_id` FROM `prf_purchase_order` WHERE `po_number`='$searchString'"),0); $sVendorName = mysql_result(mysql_query("SELECT `sup_name` FROM `prf_suppliers` WHERE `id`='$sVendorID'"),0); $sumPoAmount = mysql_result(mysql_query("SELECT SUM(approved_amount) FROM `prf_request_detl` WHERE `po_code`='$searchString'"),0); echo "<tr>"; echo "<td>".$srecNo."</td>"; echo "<td>".$spoDate."</td>"; echo "<td>".$spoNumber."</td>"; echo "<td>".strtoupper($recsCompName)."</td>"; echo "<td>".strtoupper($recsDealName)."</td>"; echo "<td>".strtoupper($sVendorName)."</td>"; echo "<td>".strtoupper($sumPoAmount)."</td>"; echo "</tr>"; echo "</table>"; echo "<table>"; echo "<tr>"; echo "<td colspan='1' style='width:10%;background:white;padding:10px;height:70px'>PO DATE:<br>".$spoDate."</td>"; echo "<td colspan='1' style='width:10%;background:white;padding:10px;height:70px'>DATE CREATED:<br>".$spoDateCreated."</td>"; echo "<td colspan='1' style='width:10%;background:white;padding:10px;height:70px'>DATE CHECKED:<br>".$spoDateChecked."</td>"; echo "<td colspan='1' style='width:10%;background:white;padding:10px;height:70px'>DATE APPROVED:<br>".$spoDateApproved."</td>"; echo "<td colspan='1' style='width:10%;background:white;padding:10px;height:70px'>SENT TO VENDOR:<br>".$spoVendorForwarded."</td>"; echo "<td colspan='1' style='width:10%;background:white;padding:10px;height:70px'>DATE RECEIVED:<br>".$spoVendorReceived; echo "</td>"; echo "</tr>"; echo "<table>"; echo "<tr>"; echo "<td colspan='1' style='width:10%;background:white;padding:10px;height:170px'>"; echo "<b style='font-size:12px;color:blue'>PRF NUMBER:<br></b>"; $getAllPRFInPO = mysql_query("SELECT * FROM `prf_request_detl` WHERE `po_code`='$spoNumber' GROUP BY `header_ref_code`"); while($row = mysql_fetch_array($getAllPRFInPO)){ echo $row['header_ref_code']. "<br>"; } echo "</td>"; echo "</tr>"; echo "</table>"; $poStatus = mysql_result(mysql_query("SELECT `po_status` FROM `prf_purchase_order` WHERE `po_number`='$spoNumber'"),0); if($poStatus == 9){ $status ='CANCELLED PO'; //echo "<div style='display:block;position:fixed;top:50px;left:400px;width:100%;height:35%;border:0px solid //red;background:transparent;-webkit-transform: rotate(-30deg); -moz-transform: rotate(-30deg);z-index:999'> // <p style='font-family:Tamoma;font-size:50px;color:red;padding:5px;margin:0px;opacity:9;text-shadow:1px 1px black'>Cancelled P.O</p> //</div>"; echo "<script>alert('THIS PO HAS BEEN CANCELLED');</script>"; }else{ $status ='ACTIVE PO'; } echo "<p style='font-family:Tamoma;font-size:40px;color:red;padding:5px;margin:0px;opacity:9;text-shadow:1px 1px black'>".$status."</p>"; } echo "</table>"; echo "</div>"; if($PONumber != ""){ $getItemDetl = mysql_query("SELECT * FROM `prf_request_detl` WHERE `po_code` ='$spoNumber'"); echo "<div style='float:left;margin-top:10px;padding:10px;width:100%;height:150px;border:0px solid lightgray;'>"; echo "<table>"; echo "<thead>"; echo "<th style='width:5%'>Rec. No</th>"; echo "<th style='width:60%'>ITEM STATUS</th>"; echo "<th style='width:10%'>UOM</th>"; echo "<th style='width:10'>QUANTITY</th>"; echo "<th style='width:15%'>ITEM STATUS</th>"; echo "</thead>"; while($row=mysql_fetch_array($getItemDetl)){ echo "<tr>"; $itmStat = $row['item_status']; $itemStatus = mysql_result(mysql_query("SELECT `status_name` FROM `prf_status` WHERE `sequence`='$itmStat'"),0); echo "<td>".$row['id']."</td>"; echo "<td>".strtoupper($row['item_description'])."</td>"; echo "<td>".strtoupper($row['uom'])."</td>"; echo "<td>".strtoupper($row['quantity'])."</td>"; echo "<td>".strtoupper($itemStatus)."</td>"; echo "</tr>"; } echo "<tr>"; echo "<td colspan='2' style='background:white;padding:10px;height:70px'></td>"; echo "</tr>"; echo "<tr>"; echo "<td colspan='2' style='background:white;padding:10px;height:70px'></td>"; echo "<td colspan='1' style='background:white;padding:10px;height:70px;vertical-align:top'>INVOICE NUMBER:<br>"; $getAllInvoice = mysql_query("SELECT * FROM `prf_delivery_receiving_logs` WHERE `po_number`='$spoNumber'"); while($inv=mysql_fetch_array($getAllInvoice)){ echo $inv['inv_number']."<br>"; } echo"</td>"; echo "<td colspan='1' style='background:white;padding:10px;height:70px;vertical-align:top'>DR NUMBER:<br>"; $getAllDR = mysql_query("SELECT * FROM `prf_delivery_receiving_logs` WHERE `po_number`='$spoNumber'"); while($dr=mysql_fetch_array($getAllDR)){ echo $dr['dr_number']."<br>"; } echo"</td>"; echo "<td colspan='1' style='background:white;padding:10px;height:70px;vertical-align:top'>AMOUNT:<br>"; $getAllAmount = mysql_result(mysql_query("SELECT SUM(`approved_amount`) FROM `prf_request_detl` WHERE `po_code`='$searchString'"),0); echo "0".$getAllAmount; echo"</td>"; echo "</tr>"; echo "</div>"; } break; case 'ItemSearch': echo "<div style='padding:10px;width:100%;height:150px;border:0px solid lightgray;'>"; echo "<table>"; echo "<thead>"; echo "<th style='width:5%'>Rec. No</th>"; echo "<th style='width:10%'>PRF Number</th>"; echo "<th style='width:15%'>Company</th>"; echo "<th style='width:15%'>Dealer</th>"; echo "<th style='width:15%'>Requested By</th>"; echo "<th style='width:22%'>Purpose of Request</th>"; echo "<th style='width:10%'>Request Date</th>"; echo "<th style='width:8%'>Date Needed</th>"; echo "</thead>"; if($prfNumber ==""){ echo "<td colspan='8' style='height:100px;padding:10px;text-align:center'>-- NO RECORD FOUND --</td>"; }else{ echo "<tr>"; echo "<td>".$recNo."</td>"; echo "<td>".$prfNumber."</td>"; echo "<td>".strtoupper($recCompName)."</td>"; echo "<td>".strtoupper($recDealName)."</td>"; echo "<td>".strtoupper($recUserFName)." ".strtoupper($recUserLName)."</td>"; echo "<td>".strtoupper($recPurpose)."</td>"; echo "<td>".$recDatePosted."</td>"; echo "<td>".$recDateNeeded."</td>"; echo "</tr>"; echo "<tr>"; echo "<td colspan='2' style='background:white;padding:10px;height:70px'><b>Head APPROVAL:</b><br>".$headFName ." ".$headLName."<br>"; if($HeadResendLink=="True"){ if($UTIL == 1){ echo "<input type='hidden' id='txtHeadID' value='".$gmID."'>"; echo "<input type='hidden' id='headPRFNumber' value='".$searchString."'>"; echo "<p id='resendHeadLink' class='searchResendLink'>📩 ".$deptApproval."</p>"; }else{ echo $deptApproval; } }else{ echo $deptApproval; } echo"</td>"; echo "<td colspan='1' style='background:white;padding:10px;height:70px'>"; //<b>GM APPROVAL:</b><br>".$gmFName ." ".$gmLName."<br>"; /* if($gmResendLink=="True"){ if($UTIL == 1){ echo "<input type='hidden' id='txtGMID' value='".$gmID."'>"; echo "<input type='hidden' id='SearchPRFNumber' value='".$searchString."'>"; echo "<p id='resendGMLink' class='searchResendLink'>📩 ".$gmApproval."</p>"; }else{ echo $gmApproval; } }else{ echo $gmApproval; } */ echo"</td>"; echo "<td colspan='1' style='background:white;padding:10px;height:70px'><b>ASSET VALIDATOR:</b><br>".$validatorFName ." ".$validatorLName."<br>"; if($validtorResendLink=="True"){ if($UTIL == 1){ echo "<input type='hidden' id='txtValidatorID' value='".$validatorID."'>"; echo "<input type='hidden' id='validatePRFNumber' value='".$searchString."'>"; echo "<p id='resendValidatorLink' class='searchResendLink'>📩 ".$assetApproval."</p>"; }else{ echo $assetApproval; } }else{ echo $assetApproval; } echo"</td>"; echo "<td colspan='1' style='background:white;padding:10px;height:70px'><b>AHG ADMIN APPROVAL:</b><br>".$aghAdminFName ." ".$aghAdminLName."<br>".$assetAdminApproval."</td>"; //echo "<td colspan='1' style='background:white;padding:10px;height:70px'><b>PO NUMBER:</b><br><br>".$poNumber."<br></td>"; //echo "<td colspan='2' style='background:white;padding:10px;height:70px'><b>RF STATUS:</b><br><br>".$prfStatus."<br></td>"; echo "</tr>"; } echo "</table>"; echo "</div>"; $getItemDetl = mysql_query("SELECT * FROM `prf_request_detl` WHERE `item_description` LIKE '%$searchString%' AND `deleted`=0"); echo "<div style='margin-top:10px;padding:10px;width:100%;height:150px;border:0px solid lightgray;'>"; echo "<table id='showExecomItemApproval'>"; echo "<thead>"; echo "<th style='width:5%'>REC. No</th>"; echo "<th style='width:7%'>REQ. DATE</th>"; echo "<th style='width:8%'>PRF NUMBER</th>"; echo "<th style='width:8%'>PO NUMBER</th>"; echo "<th style='width:35%'>ITEM DESCRIPTION</th>"; echo "<th style='width:15%'>REQUESTED BY</th>"; echo "<th style='width:10'>COMPANY</th>"; echo "<th style='width:10%;'>DEALER</th>"; echo "<th style='width:10%;'>STATUS</th>"; echo "</thead>"; while($row=mysql_fetch_array($getItemDetl)){ ?><tr onclick="javascript:getInfox(this);" ><?php $itmStat = $row['item_status']; $ahgAHGAdminID = $row['ahg_admin_id']; $ahgAHGAdminDate = $row['ahg_admin_date']; $itemStatus = mysql_result(mysql_query("SELECT `status_name` FROM `prf_status` WHERE `sequence`='$itmStat'"),0); $refCode = $row['header_ref_code']; $refByID = mysql_result(mysql_query("SELECT `request_by` FROM `prf_request_hdr` WHERE `reference_code`='$refCode'"),0); $requestBy = $requestByFName = mysql_result(mysql_query("SELECT `u_fname` FROM `vts_users` WHERE `u_id`='$refByID'"),0); $requestByLName = mysql_result(mysql_query("SELECT `u_lname` FROM `vts_users` WHERE `u_id`='$refByID'"),0); $compNameD = mysql_result(mysql_query("SELECT `comp_code` FROM `vts_company` WHERE `comp_id`='".$row['comp_id']."'"),0); $dealNameD = mysql_result(mysql_query("SELECT `deal_code` FROM `vts_dealerships` WHERE `comp_id`='".$row['dealer_id']."'"),0); echo "<td style='border:1px solid white'>".$row['id']."</td>"; echo "<td style='border:1px solid white'>".strtoupper($row['date_created'])."</td>"; echo "<td style='border:1px solid white'>".strtoupper($row['header_ref_code'])."</td>"; echo "<td style='border:1px solid white'>".strtoupper($row['po_code'])."</td>"; echo "<td style='border:1px solid white'>".strtoupper($row['item_description'])."</td>"; echo "<td style='border:1px solid white'>".strtoupper($requestByLName).", ".strtoupper($requestByFName)."</td>"; echo "<td style='border:1px solid white'>".strtoupper($compNameD)."</td>"; echo "<td style='border:1px solid white'>".strtoupper($dealNameD)."</td>"; echo "<td style='border:1px solid white'>".strtoupper($itemStatus)."</td>"; echo "</tr>"; } echo "<tr>"; echo "<td colspan='2' style='background:white;padding:10px;height:70px;border:1px solid white'></td>"; echo "</tr>"; echo "<tr>"; echo "<td colspan='2' style='background:white;padding:10px;height:70px;border:1px solid white'></td>"; echo "<td colspan='1' style='background:white;padding:10px;height:70px;vertical-align:top;border:1px solid white'>INVOICE NUMBER:<br>"; $getAllInvoice = mysql_query("SELECT * FROM `prf_delivery_receiving_logs` WHERE `po_number`='$poNumber'"); while($inv=mysql_fetch_array($getAllInvoice)){ echo $inv['inv_number']."<br>"; } echo"</td>"; echo "<td colspan='1' style='background:white;padding:10px;height:70px;vertical-align:top;border:1px solid white'>DR NUMBER:<br>"; $getAllDR = mysql_query("SELECT * FROM `prf_delivery_receiving_logs` WHERE `po_number`='$poNumber'"); while($dr=mysql_fetch_array($getAllDR)){ echo $dr['dr_number']."<br>"; } echo"</td>"; echo "<td colspan='1' style='background:white;padding:10px;height:70px;vertical-align:top;border:1px solid white'>AMOUNT:<br>"; $getAllAmount = mysql_query("SELECT * FROM `prf_delivery_receiving_logs` WHERE `po_number`='$poNumber'"); while($inv=mysql_fetch_array($getAllAmount)){ echo "Php. ". $inv['dr_amount']."<br>"; } echo"</td>"; echo "</tr>"; echo "<tr>"; echo "<td colspan='5' style='background:white;padding:10px;height:70px;border:1px solid white;text-align:right;padding:20px'><a href='prfview.php?prf=".$prfNumber."' target='_Blank'>View PRF Form</a></td>"; echo "</tr>"; echo "</table>"; $prfStatus = mysql_result(mysql_query("SELECT `current_status` FROM `prf_request_hdr` WHERE `reference_code`='$searchString'"),0); switch($prfStatus){ // // case '0': // $status ='Unposted'; // break; // case '1': // $status ='Head Approval'; // break; // case '2': // $status ='GM Approval'; // break; // case '3': // $status ='Checking Available Assets'; // break; // case '4': // $status ='For Canvass'; // break; // case '5': // $status ='User Approval'; // break; // case '6': // $status ='CANVASS Approval'; // break; // case '7': // $status ='PO Creation'; // break; // case '8': // $status ='For PO Approval'; // break; // case '9': // $status ='Waiting for Delivery'; // break; // case '10': // $status ='Delivered'; // break; // case '11': // $status ='Ready for Pickup'; // break; // case '12': // $status ='Received by User'; // break; case '91': $status ='Disapprove by Head'; break; case '92': $status ='Disapprove by GM'; break; case '93': $status ='Cancelled PRF'; break; case '94': $status ='No Supplier Available'; break; case '95': $status ='Disapproved by EXECOM'; break; case '100': $status ='Returned with Revision'; break; } echo "<p style='font-family:Tamoma;font-size:40px;color:red;padding:5px;margin:0px;opacity:9;text-shadow:1px 1px black'>".$status."</p>"; echo "</div>"; break; case 'INVNumber': break; } } ?> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script> <script type="text/javascript" src="https://code.jquery.com/jquery-3.6.0.js"></script> <script type="text/javascript"> $(document).ready(function(){ //====================================================================================================== $("#showExecomItemApproval").click(function(){ // var itemID = $("#itemID").val(); ShowUploadBar(); $.ajax({ url: "prf_showExecomItemApproval.php", type: "POST", async: false, data: { "itemID": itemID, "done": 1 }, success: function(d){ ShowUploadBar(); $("#showExecomApprovalData").html(d); } }) }); //====================================================================================================== $("#resendHeadLink").click(function(){ // var txtHeadID = $("#txtHeadID").val(); var headPRFNumber = $("#headPRFNumber").val(); //alert(txtGMID); //return false; if(confirm("CONFIRM ACTION: \n\n Please confirm to re-send SMS link to approving officer.")){ //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_resendHeadLink.php", type: "POST", async: false, data: { "txtHeadID": txtHeadID, "headPRFNumber": headPRFNumber, "done": 1 }, success: function(d){ ShowUploadBar(); $("#resendGMLink").html(d); } }) } }); //============ ========================================================================================== $("#resendGMLink").click(function(){ //headPRFNumber resendHeadLink txtHeadID var txtGMID = $("#txtGMID").val(); var SearchPRFNumber = $("#SearchPRFNumber").val(); //alert(txtGMID); //return false; if(confirm("CONFIRM ACTION: \n\n Please confirm to re-send SMS link to approving officer.")){ //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_resendGMLink.php", type: "POST", async: false, data: { "txtGMID": txtGMID, "SearchPRFNumber": SearchPRFNumber, "done": 1 }, success: function(d){ ShowUploadBar(); $("#resendGMLink").html(d); } }) } }); //============================================== $("#resendValidatorLink").click(function(){ // var txtValidatorID = $("#txtValidatorID").val(); var validatePRFNumber = $("#validatePRFNumber").val(); //alert(txtValidatorID); ///return false; if(confirm("CONFIRM ACTION: \n\n Please confirm to re-send SMS link to approving officer.")){ //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_resentAssetValidatorLink.php", type: "POST", async: false, data: { "txtValidatorID": txtValidatorID, "validatePRFNumber": validatePRFNumber, "done": 1 }, success: function(d){ ShowUploadBar(); $("#resendGMLink").html(d); } }) } }); }); </script> <!--- LOCALIZED COPY OF JAVASCRIPT --> <script type="text/javascript"> function hideActionSlipForm(){ $("#PRFCreateNewRequest").fadeOut(500); }; function showActionSlipForm(){ $("#PRFCreateNewRequest").fadeIn(500); }; function getInfo(row) { var x=row.cells; document.getElementById("itemID").value = x[0].innerHTML; document.getElementById("showItemDesc").innerHTML = x[2].innerHTML; showExecomApproval(); } function hideExecomApproval(){ $("#POActionaForm").fadeOut(500); } function showExecomApproval(){ $("#POActionaForm").fadeIn(500); } </script> <!-- resendGMLink txtGMID SearchPRFNumber -->
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings