-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhome.php
305 lines (287 loc) · 16.8 KB
/
home.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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
session_start();
if (!isset($_SESSION["user"])) {
header("location:index.php");
}
include('db.php')
?>
<!DOCTYPE html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Floa Residence</title>
<!-- Bootstrap Styles-->
<link href="assets/css/bootstrap.css" rel="stylesheet" />
<!-- FontAwesome Styles-->
<link href="assets/css/font-awesome.css" rel="stylesheet" />
<!-- Custom Styles-->
<link href="assets/css/custom-styles.css" rel="stylesheet" />
<!-- Google Fonts-->
<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css' />
</head>
<body>
<div id="wrapper">
<nav class="navbar navbar-default top-navbar" role="navigation">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".sidebar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="home.php">
<?php echo $_SESSION["user"]; ?>
</a>
</div>
<ul class="nav navbar-top-links navbar-right">
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#" aria-expanded="false">
<i class="fa fa-user fa-fw"></i> <i class="fa fa-caret-down"></i>
</a>
<ul class="dropdown-menu dropdown-user">
<li><a href="usersetting.php"><i class="fa fa-user fa-fw"></i> User Profile</a>
</li>
<li><a href="settings.php"><i class="fa fa-gear fa-fw"></i> Settings</a>
</li>
<li class="divider"></li>
<li><a href="logout.php"><i class="fa fa-sign-out fa-fw"></i> Logout</a>
</li>
</ul>
<!-- /.dropdown-user -->
</li>
<!-- /.dropdown -->
</ul>
</nav>
<!-- /. NAV TOP -->
<nav class="navbar-default navbar-side" role="navigation">
<div class="sidebar-collapse">
<ul class="nav" id="main-menu">
<li>
<a class="active-menu" href="home.php"><i class="fa fa-dashboard"></i>Dashboard</a>
</li>
<li>
<a href="reservation.php"><i class="fa fa-qrcode"></i>Add Booking</a>
</li>
<li>
<a href="payment.php"><i class="fa fa-qrcode"></i>Add Payment</a>
</li>
<li>
<a href="expenditure.php"><i class="fa fa-qrcode"></i>Add Expense</a>
</li>
<li>
<a href="update.php"><i class="fa fa-qrcode"></i>Update Room Status</a>
</li>
<li>
<a href="checkout.php"><i class="fa fa-qrcode"></i>Check Out</a>
</li>
<li>
<a href="finances.php"><i class="fa fa-qrcode"></i>Financial Information</a>
</li>
<li>
<a href="logout.php"><i class="fa fa-sign-out fa-fw"></i> Logout</a>
</li>
</ul>
</div>
</nav>
<!-- /. NAV SIDE -->
<div id="page-wrapper">
<div id="page-inner">
<div class="row">
<div class="col-md-12">
<h1 class="page-header">
Floa Residence Management System
</h1>
</div>
</div>
<!-- /. ROW -->
<?php
include('db.php');
$sql = "select * from bookings";
$re = mysqli_query($con, $sql);
?>
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading">
</div>
<div class="panel-body">
<div class="panel-group" id="accordion">
<div class="panel panel-primary">
<div class="panel-heading">
<div class="d-grid gap-2 d-md-flex justify-content-md-end">
<a href="reservation.php">
<button class="btn btn-success" type="button">Add Booking</button>
</a>
</div>
</div>
<div style="height: auto;">
<div class="panel-body">
<div class="panel panel-default">
<div class="panel-body">
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<th>BookingID</th>
<th>Name</th>
<th>Phone Number</th>
<th>Room Type</th>
<th>Check In</th>
<th>Check Out</th>
<th>Number of Days</th>
<th>Payment Status</th>
<th>Booked By</th>
</tr>
</thead>
<tbody>
<?php
$tsql = "SELECT * FROM bookings";
$tre = mysqli_query($con, $tsql);
while ($trow = mysqli_fetch_array($tre)) {
echo "<tr>
<th>" . $trow['ID'] . "</th>
<th>" . $trow['firstName'] . " " . $trow['lastName'] . "</th>
<th>" . $trow['phone'] . "</th>
<th>" . $trow['roomType'] . "</th>
<th>" . $trow['checkIn'] . "</th>
<th>" . $trow['checkOut'] . "</th>
<th>" . $trow['noOfDays'] . "</th>
<th>" . $trow['paymentStatus'] . "</th>
<th>" . $trow['bookedBy'] . "</th>
</tr>";
}
?>
</tbody>
</table>
</div>
</div>
</div>
<!-- End Basic Table -->
</div>
</div>
<div class="panel panel-info">
<div class="panel-heading">
<div class="d-grid gap-2 d-md-flex justify-content-md-end">
<h4 class="panel-heading">Booked Rooms</h4>
</div>
</div>
<div id="collapseOne" class="" style="height: 0px;">
<div class="panel-body">
<?php
$msql = "SELECT * FROM `room` ";
$booking = "SELECT * FROM `bookings`";
$mre = mysqli_query($con, $msql);
$tre = mysqli_query($con, $booking);
$hasBookings = false;
while ($mrow = mysqli_fetch_array($mre)) {
$br = $mrow['Status'];
if ($br == "booked") {
$hasBookings = true;
echo "<div class='col-md-3 col-sm-12 col-xs-12'>
<div class='panel panel-primary text-center no-boder bg-color-blue'>
<div class='panel-body'>
<i class='fa fa-users fa-5x'></i>
<h3>" . $mrow['Description'] . "</h3>
</div>
<div class='panel-footer back-footer-blue'>
<a href='checkout.php' >
<button class='btn btn-danger'>Check Out</button>
</a>
</div>
</div>
</div>";
}
}
// Display "No Bookings" message if no bookings are found
if (!$hasBookings) {
echo "<h3>No Bookings Available</h3>";
}
?>
</div>
</div>
</div>
<div class="panel panel-danger">
<div class="panel-heading">
<div class="d-grid gap-2 d-md-flex justify-content-md-end">
<h4 class="panel-heading">Available Rooms</h4>
</div>
</div>
<div id="collapseThree" class="">
<div class="panel-body">
<?php
$msql = "SELECT * FROM `room`";
$mre = mysqli_query($con, $msql);
while ($mrow = mysqli_fetch_array($mre)) {
$br = $mrow['Status'];
if ($br == "available") {
echo "<div class='col-md-3 col-sm-12 col-xs-12'>
<div class='panel panel-primary text-center no-boder bg-color-blue'>
<div class='panel-body'>
<i class='fa fa-users fa-5x'></i>
<h3>" . $mrow['Description'] . "</h3>
</div>
</div>
</div>";
}
}
?>
</div>
</div>
</div>
<div class="panel panel-primary">
<div class="panel-heading">
<div class="d-grid gap-2 d-md-flex justify-content-md-end">
<h4 class="panel-heading">Reserved Rooms</h4>
</div>
</div>
<div id="collapseThree" class="">
<div class="panel-body">
<?php
$msql = "SELECT * FROM `room`";
$mre = mysqli_query($con, $msql);
while ($mrow = mysqli_fetch_array($mre)) {
$br = $mrow['Status'];
if ($br == "reserved") {
echo "<div class='col-md-3 col-sm-12 col-xs-12'>
<div class='panel panel-primary text-center no-boder bg-color-blue'>
<div class='panel-body'>
<i class='fa fa-users fa-5x'></i>
<h3>" . $mrow['Description'] . "</h3>
</div>
</div>
</div>";
}
}
?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- /. ROW -->
</div>
<!-- /. PAGE INNER -->
</div>
<!-- /. PAGE WRAPPER -->
</div>
<!-- /. WRAPPER -->
<!-- JS Scripts-->
<!-- jQuery Js -->
<script src="assets/js/jquery-1.10.2.js"></script>
<!-- Bootstrap Js -->
<script src="assets/js/bootstrap.min.js"></script>
<!-- Metis Menu Js -->
<script src="assets/js/jquery.metisMenu.js"></script>
<!-- Morris Chart Js -->
<script src="assets/js/morris/raphael-2.1.0.min.js"></script>
<script src="assets/js/morris/morris.js"></script>
<!-- Custom Js -->
<script src="assets/js/custom-scripts.js"></script>
</body>
</html>