<th>Sender</th> <th>Message</th> <th style="width: 120px">Time</th> </tr> <?php $reciever_id = (int) $_SESSION['id']; $query_fetch = "SELECT U.id, M.message, M.timestamp, U.name FROM messages M INNER JOIN users U ON M.sender_id = U.id WHERE ((M.reciever_id='{$reciever_id}' OR M.reciever_id=0) AND M.sender_id != '{$reciever_id}') AND M.message NOT LIKE 'request%' ORDER BY M.timestamp DESC"; $query_fetch_run = mysqli_query($connection, $query_fetch); $i = 0; while ($query_row = mysqli_fetch_assoc($query_fetch_run)) { echo ' <tr> <td>' . ++$i . '</td> <td>' . $query_row['name'] . ' <small>(' . $query_row['id'] . ')</small></td> <td>' . $query_row['message'] . '</td> <td>' . return_display_time(strtotime($query_row['timestamp'])) . '</td> </tr>'; } ?> </tbody></table> </div> </section> </div> </div> <?php include 'layout/scripts.inc.php'; ?> </body> </html>
</section> </div> <div class="col-lg-3"> <section class="panel"> <header class="panel-heading">bulletin board</header> <div class="panel-body" id="noti-box2" style="overflow: hidden; width: auto; height: 400px;"> <?php $query = "SELECT M.message, M.timestamp, U.name FROM messages M INNER JOIN users U ON M.sender_id = U.id WHERE M.reciever_id = 0 ORDER BY M.timestamp DESC LIMIT 10"; $query_run = mysqli_query($connection, $query); while ($query_row = mysqli_fetch_assoc($query_run)) { echo '<div class="alert alert-warning"> <button data-dismiss="alert" class="close close-sm" type="button"> <i class="fa fa-times"></i> </button> ' . $query_row['message'] . '<br> <strong>' . $query_row['name'] . '</strong> @ <small>' . return_display_time(strtotime($query_row['timestamp'])) . '</small><br> </div>'; } ?> </div> <div class="slimScrollBar" style="width: 5px; position: absolute; top: 0px; opacity: 0.4; display: none; border-radius: 5px; z-index: 99; right: 1px; height: 213.333px; background: rgb(0, 0, 0);"></div> </section> </div> <div class="col-lg-3"> <section class="panel"> <header class="panel-heading"> know more </header> <div class="panel-body" id="noti-box3" style="overflow: hidden; width: auto; height: 400px;"> <?php