File manager - Edit - /home/autoph/public_html/connect/home/prf_SendPOToVendor.php
Back
<?php include_once 'core/init.php'; $prfDate = date_create() ->format("Y-m-d"); $signedTime =date('H:i:s'); $dateSent = $prfDate . " " .$signedTime; $myUID = $user_data['u_id']; if(isset($_POST['done'])){ //$itemRefCode = mysql_escape_string($_POST['itemRefCode']); $myPONumberA = mysql_escape_string($_POST['myPONumber']); $myPONumber = trim(str_replace(' ', '', $myPONumberA)); $MyAPIcode = mysql_result(mysql_query("SELECT `SMSAPICode` FROM `asa_versioning_db` WHERE `type`='Live'"),0); $MyPasswd = mysql_result(mysql_query("SELECT `SMSAPIPass` FROM `asa_versioning_db` WHERE `type`='Live'"),0); $myTokenKey = $myPONumber ."-".$myPONumber; $myToken = mysql_result(mysql_query("SELECT `token` FROM `prf_purchase_order` WHERE `po_number`=$myPONumber"),0); $randomCode = rand(1001,9999999)."".$myUID; $vendorID = mysql_result(mysql_query("SELECT `vendor_id` FROM `prf_purchase_order` WHERE `po_number`='$myPONumber'"),0); $vendorEmail = mysql_result(mysql_query("SELECT `contact_person_email` FROM `prf_suppliers` WHERE `id`='$vendorID'"),0); $vendorMobile = mysql_result(mysql_query("SELECT `contact_person_mobile` FROM `prf_suppliers` WHERE `id`='$vendorID'"),0); $vendorContactName = mysql_result(mysql_query("SELECT `contact_person` FROM `prf_suppliers` WHERE `id`='$vendorID'"),0); $valLink ="prfvendorview.php?vid=".$vendorID."&pid=".$myPONumber."&key=".$randomCode."&token=".$myToken; mysql_query("UPDATE `prf_request_detl` SET `item_status`='9' WHERE `po_code`=$myPONumber"); mysql_query("UPDATE `prf_purchase_order` SET `date_forwarded_to_vendor`='$dateSent',`po_status`='4' WHERE `po_number`=$myPONumber"); $SMSMessage = "New Purchase Order has been awarded to you. please click the link below and type the (".$randomCode.") OTP code to access the PO https://autohub.ph/ven.php?c=".$randomCode; $myPostLink = "https://autohub.ph/ven.php?c=".$randomCode; //####################################################################### //####################################################################### //mysql_query("INSERT INTO prf_validate_links(code,link,po_code,uid) //VALUES('{$randomCode}','{$valLink}','{$myPONumber}','{$vendorID}')"); mysql_query("INSERT INTO prf_validate_links(code,link,po_code,uid,sms_link) VALUES('{$randomCode}','{$valLink}','{$myPONumber}','{$vendorID}','{$myPostLink}')"); //####################################################################### //####################################################################### //############################################################################################# //############################################################################################# $from = "support@autohub.ph"; $to = $vendorEmail; $subject = "PO AWARDED"; $msgBox = "Hi ".$vendorContactName."! New P.O Has been awarded to you by Autohub Group. Download the PO by clicking the link below https://autohub.ph/ven.php?c=".$randomCode; $headers = "From:" . $from; mail($to,$subject,$msgBox, $headers); //############################################################################################# //$SMSMessage = "Purchase Order has been routed to you for your Approval //https://www.autohub.ph/connect/home/prfpoapproval.php?uid=".$exID."&id=".$myPONumber."&token=".$tokenKey; //$result = itexmo($empMobile, $SMSMessage,$MyAPIcode,$MyPasswd); $result = itexmoAA($vendorMobile, $msgBox,$MyAPIcode,$MyPasswd); if ($result == ""){ //echo '<script>alert("No response from SMS server. SMS failed to send")</script>'; }else if ($result == 0){ //echo "SMS Sent!"; } else{ //echo "Error Num ". $result . " was encountered!"; } //############################################################################################# //echo "PO has been routed to supplier. You will be notified once the supplier read and download the Purchase Order using the link provided via e-mail and SMS."; echo '<script>alert("PO has been routed to supplier. You will be notified once the supplier read and download the Purchase Order using the link provided via e-mail and SMS.")</script>'; ?> <div style='width:100%;height:33px;background:white'> <table> <thead> <th style='width:5%'>REC.#</th> <th style='width:10%'>PO NUMBER</th> <th style='width:8%'>DATE POSTED</th> <th style='width:10%'>COMPANY</th> <th style='width:10%'>DEALER</th> <th style='width:22%'>VENDOR</th> <th style='width:5%'>TERMS</th> <th style='width:10%'>STATUS</th> <th style='width:15%'>REMARKS</th> <th style='width:5%'>...</th> </thead> </table> </div> <div class='PRFTableItems' id='mainTableSub'> <table> <?php $getItemHdr = mysql_query("SELECT * FROM `prf_purchase_order` WHERE `po_status`= 3 ORDER BY `id` DESC"); while($row=mysql_fetch_array($getItemHdr)){ $vendorID = $row['vendor_id']; $vendorName = mysql_result(mysql_query("SELECT `sup_name` FROM `prf_suppliers` WHERE `id`='$vendorID'"),0); $reqCompID=$row['comp_id']; $reqDealID=$row['dealer_id']; $reqCompName = mysql_result(mysql_query("SELECT `comp_code` FROM vts_company WHERE comp_id='$reqCompID'"),0); $reqDealName = mysql_result(mysql_query("SELECT `deal_code` FROM vts_dealerships WHERE deal_id='$reqDealID'"),0); $myTokenID = $row['token']; ?><tr onclick="javasctipt:getInfo(this);" id='LoadUserApprovedCanvassItem' ><?php echo "<td style='width:5%'>".$row['id']."</td>"; echo "<td style='width:10%'>".$row['po_number']."</td>"; echo "<td style='width:8%'>".$row['date_posted']."</td>"; echo "<td style='width:10%'>".$reqCompName."</td>"; echo "<td style='width:10%'>".$reqDealName."</td>"; echo "<td style='width:22%'>".$vendorName."</td>"; echo "<td style='width:5%'>".$row['terms']." Days</td>"; echo "<td style='width:10%'>"; $poStat = mysql_result(mysql_query("SELECT `po_status` FROM `prf_po_status` WHERE `po_code`='".$row['po_status']."'"),0); echo $poStat; echo"</td>"; echo "<td style='width:15%'>".$row['remarks']."</td>"; echo "<td style='width:5%;background:transaparent;text-align:center;'> <a href='poapr.php?id=".$row['po_number']."&uid=".$uniqueRefID."&token=".$myTokenID."' target='_Blank' styl='font-family:Yu Gothic Light;font-size:14px;font-weight:normal;color:red;'>📑</a></td>"; echo "</tr>"; } ?> </table> </div> <?php } ?>
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings