-
Notifications
You must be signed in to change notification settings - Fork 0
/
messages.php
executable file
·150 lines (131 loc) · 3.78 KB
/
messages.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
<?php
session_start();
error_reporting(E_ERROR);
require 'dbconfig.php';
if (empty($_SESSION['username'])){
header('location:customerlogin.php');
}
?>
<!DOCTYPE html>
<html lang="en">
<link rel="stylesheet" href="css/bootstrap.min.css" />
<!-- sweet alert -->
<link rel="stylesheet" href="css/sweetalert.css">
<script src="js/sweetalert.js"></script>
<script src="js/jquery.js"></script>
<!-- FontAwesome -->
<link rel="stylesheet" href="css/all.min.css" />
<link rel="stylesheet" href="css/fontawesome.min.css" />
<!--Animate Css-->
<link rel="stylesheet" href="css/animate.min.css" />
<!-- Css -->
<link rel="stylesheet" href="css/messages.css" />
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Inbox</title>
</head>
<body>
<main>
<section>
<header id="heady">
<nav class="navbar navbar-expand-md navbar-light bg-transparent mb-4">
<a id="logo" href="customerDashBoard.php" class="navbar-brand"
><img src="img/logo.png" alt="" ALIGN="CENTER"
/></a>
<button
type="button"
class="navbar-toggler"
data-toggle="collapse"
data-target="#navbarCollapse"
>
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarCollapse">
<div class="navbar-nav">
<li class="nav-item active">
<a class="nav-link active" id="hmu" href="customerDashBoard.php">DashBoard</a>
</li>
<li class="nav-item">
<a class="nav-link " id="hmu" href="bookingHistory.php">Booking History</a>
</li>
<li class="nav-item">
<a class="nav-link " id="hmu" href="pendingPayments.php">Payments</a>
</li>
<li class="nav-item">
<a class="nav-link " id="hmu" href="customerEdit.php" class="">Edit Profile.</a>
</li>
</div>
<a href="customerlogout.php" class="btn bttn btn-outline-danger ml-auto">Sign Out </a>
</div>
</nav>
</header>
<h1 class="title"><i class="fa fa-inbox"></i> Inbox.</h1>
</section>
<section id="gaid">
<div class="container">
<hr/>
<div class="table-responsive">
<?php
$conn = mysqli_connect("localhost", "root", "", "admin");
$query ="SELECT * FROM custmessages AS c INNER JOIN accounts AS a ON c.client = a.username WHERE a.username='".$_SESSION['username']."' ORDER BY c.msg_id DESC ";
$query_run = mysqli_query($conn, $query);
?>
<table class="table table-bordered" id="dataTable" width="100%" cellspacing="0">
<thead>
<tr>
<th>Message Id</th>
<th> Sender </th>
<th>Reply</th>
<th>Date Replied.</th>
</tr>
</thead>
<tbody>
<?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 'Admin' ?></td>
<td><?php echo $row['message']; ?></td>
<td><?php echo $row['date']; ?></td>
</tr>
<?php
}
}
else
{
echo "No record was found";
}
?>
</tbody>
</table>
</div>
<div id="simplemodal" class = "modal" >
<div class="modal-content bg-dark">
<span class="closeBtn">×</span>
<form id="contactForm" action="replymessagescust.php" method="POST" class="form-group">
<label for="">Username</label>
<input type="text" name = "username" class = "form-control" placeholder="username" value="<?php echo htmlspecialchars($_SESSION["username"]); ?>">
<br>
<label for="">Message</label>
<textarea name="message" cols="30" class = "form-control" placeholder="Your Message Here..."></textarea>
<br>
<input type="submit" class="btn btn-outline-info text-light" value="Send Message.">
<input type="reset" class="btn btn-outline-secondary ml-3" value="Reset">
</form>
</div>
</div>
</div>
</section>
</main>
<script src="js/messages.js"></script>
<script src="js/jquery.js"></script>
<script src="js/sweetalert.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>