File manager - Edit - /home/autoph/public_html/connect/home/PRF_UnreadMessages.php
Back
<?php include 'core/init.php'; protected_page(); $uniqueRefID = $user_data['u_id']; //echo $uniqueRefID; $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; ?> <!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> <input type='hidden' id='selMessageID'> <div class='NewPRFHeader'> <p class='PRFBodyTitle'>📝 NEW MESSAGE</p> </div> <!--########################## MAIN TABLE WINDOW ############################################--> <!--########################################################################################################--> <div class='NewPRFBody'> <!--<div class='NewPRFBodyMenu'> <div class='searchDIVA'> <b class='BodyTopMenu' id='LoadNewPRFForm' onclick='showActionSlipForm()'>➕ New Purchase </b> <b class='BodyTopMenu'>📠 Print </b> <b class='BodyTopMenu'>💾 Export</b> </div> <div class='searchDIVB'> <input type='text' id='searchText' placeholder='Search Record.' class='textSearch' style='width:70%;margin:0px;border:1px solid lightgray;'> <button id='searchNewPRF' class='searchButton' style='width:25%'> 🔍 Search</button> </div> </div>--> <div id='messageMaintTable' class='PRFTableBody'> <div style='width:100%;height:33px;background:white'> <table> <thead> <th style='width:5%'>NO</th> <th style='width:10%'>REF. CODE</th> <th style='width:7%'>DATE</th> <th style='width:7%'>TIME</th> <th style='width:15%'>SENDER</th> <th style='width:36%'>MESSAGE</th> <th style='width:10%'>STATUS</th> <th style='width:10%'>ACTION</th> </thead> </table> </div> <div class='PRFTableItems' id='msgTable'> <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"); $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);" ><?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> </div> <!--######################################## PAGINATION ############################################--> <!--######################################## PAGINATION ############################################ <div style='margin-top:20px;background:white;width:100%;padding:0px;float:left;height:70px;padding:30px'> <center> <button onclick="javascript:pageLess();" id='pageCountViewBack' class='paginationBack'>◀ Back</button> <input type='text' disabled id='pageCountView' value ="Page 1 of <?php echo $myPageCount;?>" class='paginationBox' style='width:200px;margin-left:0px'> <input type='hidden' id='pageCount' value='1' class='paginationBox'> <button onclick="javascript:pageAdd();" id='pageCountViewNext' class='paginationNext'>Next ▶ </button> </center> </div> --> </div> <!--######################################## PAGINATION ############################################--> <!--######################################## PAGINATION ############################################--> </div> </div> <!--########################## POPUP ACTION WINDOW FOR DELETE AND VIEW DETAILS ############################################--> <!--########################################################################################################--> <div id="MyShowReadBox" class="PopUpWindowMessage"> <div class='PopUpWindowTitle'> 🪧 Read Message <div class='PopUpWindowClose'> <b onclick="javascript:hideReadBox(this);" style='font-weight:bold'> ✕ </b> </div> </div> <table> <tr> <td style='padding:20px;padding-left:20px;width:100%;background:white;font-family:Yu Gothic; font-size:16px;color:gray ;height:10px;font-weight:normal;text-align:left'>Message Received:<br> <div id='messageReceived' style='width:100%;padding:10px;font-family:Yu Gothic;font-size:14px;color:gray;border:1px solid gray;height:120px;background:#ebece3;overflow:auto'></div> <div id='timeSend' style='float:right;width:20%;border:0px solid gray;padding:5px;font-family:Yu Gothic;color:gray'></div> <div id='dateSend' style='float:right;width:20%;border:0px solid gray;padding:5px;font-family:Yu Gothic;color:gray'></div> </td> </tr> <tr> <td colspan='1' style='padding:20px;padding-left:20px;width:100%;background:white;font-family:Yu Gothic; font-size:16px;color:blue ;height:10px;font-weight:normal;text-align:left'> Reply Message:<br> <textarea id='ReplyMmessage' style='background:#f1f4a3;width:100%;padding:10px;font-family:Yu Gothic;font-size:14px;color:black;border:1px solid gray;height:110px;'></textarea> <div style='width:80%;float:right;height:50px;padding:10px;background:white'> <button onclick="javascript:showUpdatePRFForm(this);" id='SendReplyMessage' class='PopUpLowerButtonR'>📑 Send Message</button> </div> </td> </tr> </table> </div> <!--########################## END OF ADD NEW PURCHASE REQEUST ############################################--> <!--########################## END OF EDIT/UPDATING PURCHASE REQEUST ############################################--> </body> </html> <!--- LOCALIZED COPY OF JAVASCRIPT --> <script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script> <script type="text/javascript"> $(document).ready(function(){ //====================================================================================================== $("#SendReplyMessage").click(function(){ var messageID = $("#selMessageID").val(); var ReplyMmessage = $("#ReplyMmessage").val(); //alert(messageID); //exit; //if(confirm("CONFIRM ACTION: \n\nAre you sure you want to send this Message? \n\n Press 'OK' button to proceed...")){ ShowUploadBar(); $.ajax({ url: "PRF_SendReplyMessage.php", type: "POST", async: false, data: { "messageID": messageID, "ReplyMmessage": ReplyMmessage, "done": 1 }, success: function(d){ ShowUploadBar(); $("#msgTable").html(d); $("#ReplyMmessage").val(''); hideReadBox(); } }) //} }); //================================================================================= //================================================================================= $("#pageCountViewNext").click(function(){ var MyPageCount = $("#MyPageCount").val(); var MyRowCount = $("#MyRowCount").val(); var myOffSet = $("#myOffSet").val(); var CurrentpageCount = $("#pageCount").val(); var recordPerPage = $("#recordPerPage").val(); //alert(CurrentpageCount); //exit; ShowUploadBar(); $.ajax({ url: "prf_LoadNextMessage.php", type: "POST", async: false, data: { "MyPageCount": MyPageCount, "myOffSet": myOffSet, "MyRowCount": MyRowCount, "CurrentpageCount": CurrentpageCount, "recordPerPage": recordPerPage, "done": 1 }, success: function(d){ ShowUploadBar(); $("#msgTable").html(d); } }) }); //================================================================================= //================================================================================= $("#pageCountViewBack").click(function(){ var MyPageCount = $("#MyPageCount").val(); var MyRowCount = $("#MyRowCount").val(); var myOffSet = $("#myOffSet").val(); var CurrentpageCount = $("#pageCount").val(); var recordPerPage = $("#recordPerPage").val(); //alert(CurrentpageCount); //exit; ShowUploadBar(); $.ajax({ url: "prf_LoadNextMessage.php", type: "POST", async: false, data: { "MyPageCount": MyPageCount, "myOffSet": myOffSet, "MyRowCount": MyRowCount, "CurrentpageCount": CurrentpageCount, "recordPerPage": recordPerPage, "done": 1 }, success: function(d){ ShowUploadBar(); $("#msgTable").html(d); } }) //================================================================================= //================================================================================= }); }); </script> <!--- LOCALIZED COPY OF JAVASCRIPT --> <script type="text/javascript"> function hideReadBox(){ $("#MyShowReadBox").fadeOut(500); }; function showReadBox(){ $("#MyShowReadBox").fadeIn(500); updateReadMessage(); }; function getReadMessageID(row) { var x=row.cells; showReadBox(); document.getElementById("messageID").value = x[0].innerHTML; document.getElementById("selMessageID").value = x[0].innerHTML; document.getElementById("messageReceived").innerHTML = x[5].innerHTML; document.getElementById("dateSend").innerHTML = "Date: " + x[2].innerHTML; document.getElementById("timeSend").innerHTML = "Time: " + x[3].innerHTML; document.getElementById("ActionReferenceIDDesc").value = "Ref.#: " + x[1].innerHTML; } //====================================================================================================== function updateReadMessage(){ var messageID = $("#messageID").val(); //alert(messageID); //exit; ShowUploadBar(); $.ajax({ url: "PRF_tagMessageAsRead.php", type: "POST", async: false, data: { "messageID": messageID, "done": 1 }, success: function(d){ ShowUploadBar(); $("#ReplyMmessage").val(''); $("#messageMaintTable").html(d); updateUnreadMessageView(); } }) } //====================================================================================================== function updateUnreadMessageView(){ $.ajax({ url: "PRF_UnreadMessageCount.php", type: "POST", async: false, data: { "trans":2 }, success: function(d){ $("#myOpenMessage").html(d); } }) } //LOAD DEALER BASED ON SELECTED COMPANY function showDealership(str) { //alert(str); if (str == "") { document.getElementById("myDealerList").innerHTML = ""; return; } else { if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else { // code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { document.getElementById("myDealerList").innerHTML = xmlhttp.responseText; } } xmlhttp.open("GET","PRF_LOAD_DealerBySelectedCompany.php?q="+str,true); xmlhttp.send(); } } //LOAD DEALER BASED ON SELECTED COMPANY function showCategoryItems(str) { //alert(str); if (str == "") { document.getElementById("CategorySubItem").innerHTML = ""; return; } else { if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else { // code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { document.getElementById("CategorySubItem").innerHTML = xmlhttp.responseText; } } xmlhttp.open("GET","PRF_LOAD_ExpenseCategoryItems.php?q="+str,true); xmlhttp.send(); } } </script>
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings