File manager - Edit - /home/autoph/public_html/connect/home/PRF_SendReplyMessage.php
Back
<?php include 'core/init.php'; //$connect_error = 'Sorry, we\'re experiencing connection problem. Please try again later... Thank you!'; //mysql_connect('localhost','root','aee1024') or die ($connect_error); //mysql_select_db('db_vts') or die($connect_error); //error_reporting(1); 193 * 1067 * 215 $prfDate = date_create() ->format("Y-m-d"); $prfTime = date('H:i:s'); $myDate = date_create() ->format("Y-m-d"); $uniqueRefID=$user_data['u_id']; $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); if(isset($_POST['done'])){ $messageID = mysql_escape_string($_POST['messageID']); $ReplyMmessage = mysql_escape_string($_POST['ReplyMmessage']); $refCode = mysql_result(mysql_query("SELECT `ref_code` FROM `prf_ff_message` WHERE `id`='$messageID'"),0); $notifyThisPerson = mysql_result(mysql_query("SELECT `sender_id` FROM `prf_ff_message` WHERE `id`='$messageID'"),0); $empUFnamey = mysql_result(mysql_query("SELECT u_fname FROM vts_users WHERE u_id='$notifyThisPerson'"),0); $empUFname = mysql_result(mysql_query("SELECT u_fname FROM vts_users WHERE u_id='$notifyThisPerson'"),0); $deptHeadEmail= mysql_result(mysql_query("SELECT email FROM vts_users WHERE u_id='$notifyThisPerson'"),0); mysql_query("INSERT INTO prf_ff_message(ref_code,sender_id,message,send_to,sms,email,date,time) VALUES('{$refCode}','{$uniqueRefID}','{$ReplyMmessage}','{$notifyThisPerson}','sms','email','{$prfDate}','{$prfTime}')"); //######################################################################################################################### //######################################################################################################################### $SMSMessage = "Hi ". $empUFname. "! ". " You have unread message regarding pending purchase request. Please login you Autohub Connect to access this message."; $result = itexmo($notifyThisPerson, $SMSMessage,$MyAPIcode,$MyPasswd); if ($result == ""){ //echo '<script>alert("Transaction complete but SMS notification failed.")</script>'; }else if ($result == 0){ //echo "SMS Sent!"; } else{ //echo "Error Num ". $result . " was encountered!"; } //######################################################################################################################### //######################################################################################################################### if($sendEmail ==='email'){ $from = "support@autohubgroup.com"; $to = $deptHeadEmail; $subject = "NEW PURCHASE REQUEST"; $msgBox = "Hi ".$empUFname."! You have unread message regarding pending purchase request. Please login you Autohub Connect to access this message. Autohub Support"; //######################################################################################################################### //######################################################################################################################### } } ?> <table> <?php //######################################PAGINATION####################################################### //######################################PAGINATION####################################################### $totalRows = mysql_result(mysql_query("SELECT COUNT(id) FROM `prf_ff_message` WHERE `deleted`=0 AND `send_to`='$uniqueRefID' || `deleted`=0 AND `sender_id`='$uniqueRefID' "),0); $noOfRecordPerPage = mysql_result(mysql_query("SELECT `page_count` FROM `asa_versioning_db` WHERE 1"),0); $myPageCount = ceil($totalRows / $noOfRecordPerPage); $offSet = 0;//($myPageCount-1) * $noOfRecordPerPage; echo "<input type='hidden' id='MyPageCount' value='".$myPageCount."'>"; echo "<input type='hidden' id='MyRowCount' value='".$totalRows."'>"; echo "<input type='hidden' id='myOffSet' value='".$offSet."'>"; echo "<input type='hidden' id='recordPerPage' value='".$noOfRecordPerPage."'>"; //####################################################################################################### //####################################################################################################### $getItemHdr = mysql_query("SELECT * FROM `prf_ff_message` WHERE `deleted`=0 AND `send_to`='$uniqueRefID' || `deleted`=0 AND `sender_id`='$uniqueRefID' ORDER BY id DESC"); while($row=mysql_fetch_array($getItemHdr)){ $senderID = $row['sender_id']; $sendFName=mysql_result(mysql_query("SELECT u_fname from vts_users WHERE u_id= $senderID"),0); $sendLName=mysql_result(mysql_query("SELECT u_lname from vts_users WHERE u_id= $senderID"),0); $prfStatus = $row['read']; if($prfStatus == 1){ $isRead ='Read'; $fontColor='gray'; }else{ $isRead ='Unread'; $fontColor='red'; } $count = $count + 1; ?><tr onclick="javascript:getReadMessageID(this);" onDblclick="javascript:showReadBox(this);" ><?php $prfStatus = mysql_result(mysql_query("SELECT `current_status` FROM `prf_request_hdr` WHERE `reference_code`='".$row['ref_code']."'"),0); if($prfStatus < 8 ){ echo "<td style='width:5%;font-family:Yu Gothic;color:$fontColor'>".$row['id']."</td>"; echo "<td style='width:10%;font-family:Yu Gothic;color:$fontColor'>".strtoupper($row['ref_code'])."</td>"; echo "<td style='width:7%;font-family:Yu Gothic;color:$fontColor'>".strtoupper($row['date'])."</td>"; echo "<td style='width:7%;font-family:Yu Gothic;color:$fontColor'>".strtoupper($row['time'])."</td>"; echo "<td style='width:15%;font-family:Yu Gothic;color:$fontColor'>".strtoupper($sendLName).", ".strtoupper($sendFName)."</td>"; echo "<td style='width:36%;font-family:Yu Gothic;color:$fontColor'>".strtoupper($row['message'])."</td>"; echo "<td style='width:10%;;font-family:Yu Gothic;color:$fontColor'>"; echo $isRead; echo"</td>"; echo "<td style='width:10%;;font-family:Yu Gothic;color:$fontColor'>"; if($row['sender_id']==$uniqueRefID){ echo "Sent"; }else{ echo "Received"; } 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='text' id='messageID' style='background:white;border:0px;font-family:Yu Gothic;font-size:14px;color: #f97d43 ;font-weight:normal'> </td> </tr> </table>
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings