File manager - Edit - /home/autoph/public_html/pms_v1/pages/pmsInbox.php
Back
<?php session_start(); include ("../functions/users.php"); if(isset($_SESSION['userID'])) { // echo "Session ID is '" . $_SESSION['userID']; // echo "<br>PMS Name id " . $_SESSION['userID']; $uID = $_SESSION['userID']; //============================================================================================================== //VALIDATE ACCESS ============================================================================================== //============================================================================================================== $roleID = userProfileID($userID); $roleID = userProfileID($uID); $moduleID = 7; $msgReply =checkViewAccessM1024($roleID, $moduleID)[1]; if(checkViewAccessM1024($roleID, $moduleID)[0] == 0){ echo " <center><img src='./images/locked_out_icon.png' width='100' style='margin-top:100px'><img></center> "; echo "<h4 class='text-center text-danger align-middle pt-5'> Access Denied </h4>"; echo "<p class='display-5 text-center text-danger'> Sorry, you are not authorized to access this page. <br>Please contact your system support for assistance. <br><br>Thank you! <br><br> </p>"; exit(); } //============================================================================================================== //VALIDATE ACCESS ============================================================================================== //============================================================================================================== } include_once("../../../cfg/conn.php"); //error_reporting(0); if(isset($_POST['done'])){ ?> <div class="shadow-sm mb-3 pageHeaderContainer content-justify-right pt-2 pb-2" style="padding:0px;" > <div class="pageSearchHeader bg-white p-1 pt-1" > <h4 class="ml-3 mt-1"><i class="fa fa-envelope-o" style='font-size:20px;color:#0471AC'> My Inbox </i></h4> </div> <div class="pageSearchHeader bg-white p-1 pt-1 "> <input class="form-control border p-3" type="search" placeholder="search" id="searchText" style="margin:0px;min-width:250px;width:75%;float:left"> <button type="button" class="btn btn-info" id="goSearchRecord" style="float:rigth;width:20%;margin-left:3px">Search</button> </div> </div> <input type='hidden' id='messageID'> <!--AREA NAME ID --> <input type='hidden' id='userID' value="<?php echo $uID;?>" > <!--ACTIVE USER ID --> <input type='hidden' id='unreadView'> <!--AREA NAME ID --> <input type='hidden' id='msgReply' value="<?php echo $msgReply;?>" > <!--ACTIVE USER ID --> <div class="wrapper mt-3 p-1 shadow-sm float:left bg-white h-auto"> <div class="row fluid m-0 w-100 bg-white"> <div class="col bg-white float:right m-1 text-right col-sm-12 col-sx-12 pt-3"> <button class="btn btn-info pageUpperRightMenu ml-2"><span class="btn-label"><i class="fa fa-question"></i></button> <div class="dropdown pageUpperRightMenu float-right"> <button type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown"> <i class="fa fa-filter" style='margin-right:20px'> Filter Message </i> </button> <div class="dropdown-menu"> <a class="dropdown-item" style='padding:10px;margin:5px;width:100px;color:#002244;cursor:pointer;display:block'><i class="fa fa-calendar-check-o"> By Date </i></a> <a class="dropdown-item" style='padding:10px;margin:5px;width:100px;color:#002244;cursor:pointer;display:block'> <i class="fa fa-file-text-o" id="unreaadMSG" > Unread Messages </i></a> </div> </div> </div> </div> <div class="row fluid m-0 w-100 p-3 bg-white h-auto pageBodyMenu"> <div class="col bg-white float:right m-1 text-right col-sm-12 col-sx-12 p-2 border h-100"> <div id="pmsPageContainer" style="border:0px solid lightgray;width:100%"> <table style="width:100%;border-collapse:collapse"> <thead> <th style="width:5%;padding-left:2px">NO</thd> <th style="width:10%;padding-left:2px">DATE</th> <th style="width:20%;padding-left:2px">SUBJECT</th> <th style="width:44%;padding-left:2px">MESSAGE</th> <th style="width:17%;padding-left:2px">SENDER</th> <th style="width:3%;padding-left:2px"></th> </thead> <?php echo "<table id='pmsPageTable' data-toggle='modal' data-target='#viewMessage' style='width:100%;border-collapse:collapse'>"; echo "</table>"; ?> </table> </div> </div> </div><center> <p style='margin:20px;padding:15px;font-family:Tahoma;font-size:14px;color:black;font-weight:normal;margin-bottom:5px '> Viewing <b id='currentCount'></b> out of <b id='recordCount'></b> total records</p> <p style='padding:20px; ;font-size:18px;color:blue;cursor:pointer;margin-top:0px' id='viewMore'> <br> <img src='images/animatedArrowDown.gif' width="80px" height="50px"></img> </p> </center> </div> <!--MODAL VIEWING OF MESSAGE--> <!-- The Modal --> <div class="modal fade " id="viewMessage"> <div class="modal-dialog modal-xl"> <div class="modal-content"> <!-- Modal Header --> <div class="modal-header"> <h4 id='msgTitle' class="modal-title"></h4> <button type="button" class="close" data-dismiss="modal">×</button> </div> <!-- Modal body --> <div class="modal-body p-0"> <div class="w-50 p-2 m-0 float-left col-sm-12" style="background-color:white;overflow:auto;height:650px"> <h6 class='title p-2 btn-info w-100 text-start'>MESSAGE HISTORY</h6> <div id="msgThread" class='content bg-white p-1'> </div> </div> <div class="w-50 p-2 m-0 float-left" style="background-color: #eee;"> <h6 class='title p-2 btn-warning w-100 text-start'>REPLY BOX</h6> <div class="form-group p-2"> <div class="form-group"> <div class='col'> <label for="messageSender">Sender's Name:</label> <h6 class="form-control" id="messageSender" name="messageSender"></h6> </div> <div class='col'> <label for="messageDate">Date Received:</label> <h6 class="form-control" id="messageDate" name="messageDate"></h6> </div> <div class='col'> <label>Subject:</label> <input type="text" disabled class="form-control" id="messageSubject" name="messageSubject"> </div> <div class='col'><br> <label for="messageReply">Send Reply Message:</label> <textarea class="form-control h-50" rows=8 id="messageReply" name="messageReply" style="height:50px"></textarea> </div> </div> </div> </div> </div> <!-- Modal footer data-dismiss="modal" --> <div class="modal-footer"> <button type="button" class="btn btn-info pl-5 pr-5" id="sendReply" style="float:rigth;margin-left:3px"><i class="fa fa-send"> SEND</i></button> <button type="button" class="btn btn-danger pl-5 pr-5" data-dismiss="modal" style="float:rigth;margin-left:3px"><i class="fa fa-close"> CLOSE</i></button> </div> </div> </div> </div> <!--########################## ############################################--> <!-- <script src="http://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script> --> <script type="text/javascript"> var start = 0; var limit = 50; var infCanvass = ''; var reachedMax = false; /* $(window).scroll(function () { if ($(window).scrollTop() == $(document).height() - $(window).height()) getData(); }); */ $("#viewMore").click(function(){ //alert('Click'); getData(); }); $("#unreaadMSG").click(function(){ $("#unreadView").val("1"); start=0; $limit = 50; getData(); }); $("#sendReply").click(function(){ var messageReply = $("#messageReply").val(); var messageID = $("#messageID").val(); var messageSubject = $("#messageSubject").val(); var userID = $("#userID").val(); if(messageReply === ""){ Swal.fire('Invalid input.', '','error'); return false; } ShowUploadBar(); $.ajax({ url: "./notify/sendReply.php", type: "POST", async: false, data: { "userID":userID, "messageReply":messageReply, "messageID":messageID, "messageSubject":messageSubject, "vMsg":2 }, success: function(d){ $("#msgThread").html(d); $("#messageReply").val(""); ShowUploadBar(); //Swal.fire('Message bas been sent', '', 'success'); } }) }); $("#goSearchRecord").click(function(){ infCanvass = $("#searchText").val(); if(infCanvass === ""){ Swal.fire('Invalid search string', '', 'error'); return false; }else{ start=0; $limit = 50; getData(); } }); $(document).ready(function () { countRow(); getData(); }); function getData() { var recordCount = $("#recordCount").html(); var userID = $("#userID").val(); var unreadView = $("#unreadView").val(); //alert(unreadView); //alert(limit); //return false; if(start >= recordCount){ $("#currentCount").html(recordCount); return false; } ShowUploadBar(); if (reachedMax) return; $.ajax({ url: "./notify/loadInboxData.php", method: 'POST', dataType: 'text', async:true, data: { inb: 1, unreadView:unreadView, infCanvass: infCanvass, userID:userID, start: start, limit: limit }, success: function(response) { if (response == "reachedMax") reachedMax = true; else { if(infCanvass!='' || unreadView==1){ $("#pmsPageTable").html(response); start = 0; limit = 50; $("#unreadView").val(''); }else{ start += limit; $("#pmsPageTable").append(response); $("#currentCount").html(start); if(start >= recordCount){ $("#currentCount").html(recordCount); $("#viewMore").fadeOut(100); $("#unreadView").val(''); } } //$("#searchText").val(''); } ShowUploadBar(); } }); } function countRow(){ var userID= $("#userID").val(); $.ajax({ url: "./notify/inboxCountRow.php", type: "POST", async: false, data: { "userID":userID, "inbRow":2 }, success: function(d){ $("#recordCount").html(d); } }) } //SEARCH ENTER KEY PRESS LISTENER // Get the input field var input = document.getElementById("searchText"); // Execute a function when the user presses a key on the keyboard input.addEventListener("keypress", function(event) { // If the user presses the "Enter" key on the keyboard if (event.key === "Enter") { // Cancel the default action, if needed event.preventDefault(); // Trigger the button element with a click document.getElementById("goSearchRecord").click(); } }); </script> <script> function getMsgThread(){ var messageID = $("#messageID").val(); var userID = $("#userID").val(); //alert(messageID); ShowUploadBar(); $.ajax({ url: "./notify/viewMsgThread.php", method: 'POST', dataType: 'text', async:true, data: { "vMsg": 1, "userID":userID, "messageID": messageID }, success: function(d){ ShowUploadBar(); $("#msgThread").html(d); } }); } function getInfo(row) { var x=row.cells; document.getElementById("messageID").value = x[0].innerHTML; document.getElementById("messageSubject").value = x[2].innerHTML; //document.getElementById("messageContent").value = x[3].innerHTML; document.getElementById("messageDate").innerHTML = x[1].innerHTML; document.getElementById("messageSender").innerHTML = x[4].innerHTML; document.getElementById("msgTitle").innerHTML = "Message from: " + x[4].innerHTML; } $('#pmsPageTable').on("click","tr td",function(){ //var header = $('#pmsPageTable th').eq($(this).index()).text(); //to get clicked column's header // var trackid = $(this).siblings('td:nth-child(6)').text(); //get column at column 36 var data = $(this).text(); //get clicked column value var dCell = $(this).index(); //get clicked column value var msgReply = $("#msgReply").val(); if(msgReply==0){ Swal.fire({ icon: 'Error', title: 'Access Denied', text: 'You are not authorized to access this page. Please contact your System Administrator for assistance. ' }) return false; } if(dCell > 0){ var messageID = $("#messageID").val(); var userID = $("#userID").val(); //alert(messageID); ShowUploadBar(); $.ajax({ url: "./notify/tagAsReadMessage.php", method: 'POST', dataType: 'text', async:true, data: { vMsg: 1, userID:userID, messageID: messageID }, success: function(d){ ShowUploadBar(); getMsgThread(); } }); } }); </script> <!--########################################################################################################--> <?php } ?>
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0.25 |
proxy
|
phpinfo
|
Settings