-
Notifications
You must be signed in to change notification settings - Fork 0
/
inbox.php
executable file
·78 lines (71 loc) · 1.81 KB
/
inbox.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
75
76
77
78
<?php
session_start();
include('includes/header.php');
include('includes/navbar.php');
?>
<div class="container-fluid">
<!-- DataTables Example -->
<div class="card shadow mb-4">
<div class="card-header py-3">
<a href="inbox.php" class="inline-block btn btn-sm btn-warning shadow-sm lead text-dark"> Customers Messages. <i
class="fa fa-envelope text-dark"></i></a>
<a href="techmessages.php" class="inline-block btn btn-sm btn-warning shadow-sm ml-2 lead text-dark"> Technician Messages. <i
class="fa fa-envelope text-dark"></i></a>
</div>
<div class="card-body">
<div class="table-responsive">
<!--Retrieving data to the table from the database.-->
<?php
$conn = mysqli_connect("localhost", "root", "", "admin");
$query = "SELECT * FROM adminmessages";
$query_run = mysqli_query($conn, $query);
?>
<table class="table table-bordered" id="dataTable" width="100%" cellspacing="0">
<thead>
<tr>
<th> Message Id </th>
<th> Username </th>
<th>Message</th>
<th>Time Stamp</th>
<th>REPLY </th>
</tr>
</thead>
<tbody>
<!--Table from which values will be retrieved to a text box in register_edit.php-->
<?php
if(mysqli_num_rows($query_run) > 0)
{
while($row = mysqli_fetch_assoc($query_run))
{
?>
<tr>
<td><?php echo $row['msg_id']; ?></td>
<td><?php echo $row['username']; ?></td>
<td><?php echo $row['message']; ?></td>
<td><?php echo $row['date']; ?></td>
<td>
<form action="replymessages.php" method="POST">
<input type="hidden" name="edit_id" value="<?php echo $row['id']; ?>">
<button type="submit" name="edit_btn" class="btn btn-success"> REPLY </button>
</form>
</td>
</tr>
<?php
}
}
else
{
echo "No record was found";
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- /.container-fluid -->
<?php
include('includes/scripts.php');
include('includes/footer.php');
?>