-
Notifications
You must be signed in to change notification settings - Fork 7
/
outbox.php
74 lines (66 loc) · 2.02 KB
/
outbox.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?php
include 'frontend/menu.php';
include_once 'config/config.php';?>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<?php
menu();
if(isset($_SESSION["uname"])){
$sql = "SELECT * FROM messages WHERE from_user = '".$_SESSION["uname"]."' and del_out='0'";
$result = mysqli_query($conn,$sql)or die(mysqli_error($conn));?>
<center>
<div id="pm">
<h3>
<?php
$error='';
echo $_SESSION["uname"].'\'s outbox';
?></h3>
<script>
$(document).ready(function() {
$('#inbox').DataTable({
"order": [[ 3, "desc" ]],
"language": {
"emptyTable": "No messages in outbox",
"lengthMenu": "Show _MENU_ messages",
"info": "Showing _START_ to _END_ of _TOTAL_ messages",
"zeroRecords": "No messages sent",
"infoEmpty": "Showing 0 to 0 of 0 messages"
}
});
} );
</script>
<table id="inbox" class="table table-bordered" style="background-color: rgba(255, 255, 255, 0.4);">
<thead>
<tr>
<th>To</th>
<th>Subject</th>
<th>Date</th>
</tr>
</thead>
<tbody>
<?php while($row = mysqli_fetch_array($result)) {
$id = $row['id'];
$subject = $row['subject'];
$to = $row['to_user'];
$unread = $row['unread'];
$message = $row['message'];
$date = $row['date'];
echo "
<tr>
<td><a href=\"sent.php?id=$id\">".$to."</a></td>
<td><a href=\"sent.php?id=$id\">".$subject."</a></td>
<td><a href=\"sent.php?id=$id\">".$date."</a></td>
</tr>
";
}?>
</tbody>
</table>
</div>
</center>
<?php } else {
echo "<div style='margin-top:10px;'>";
echo "Login to read your messages";
?><br /><br /><a href="./login/login.php">Login Here</a><?php
echo "</div>";}?>