-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdashboard.php
More file actions
345 lines (265 loc) · 10.8 KB
/
dashboard.php
File metadata and controls
345 lines (265 loc) · 10.8 KB
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
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
<?php
include_once("header.php");
include_once("navigation.php");
include_once("adminsidebar.php");
include_once("connection.php");
date_default_timezone_set('Asia/Manila');
$date = date('Y-m-d', time());
$sql = "SELECT * FROM reservation WHERE STATUS = 'APPROVED'";
$result = mysqli_query($conn,$sql);
$count = 0;
while ($row = mysqli_fetch_array($result)) {
$pDate = strtotime(''.$row["EDATE"].'');
$x = date('Y-m-d',$pDate);
$id = $row["ID"];
if ($date == $x) {
$sql = "UPDATE reservation set STATUS = 'COMPLETED' WHERE ID = '$id'";
mysqli_query($conn,$sql);
$count++;
$e = $row["ENAME"];
}
}
?>
<div id="page-content-wrapper">
<div data-aos="zoom-out-down" data-aos-duration="1500">
<br/>
<div class="row">
<?php
if ($count > 0) {
echo '
<div class="alert alert-success alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
<strong style="margin-left: 20px;">'.$e.'</strong> was updated it\'s status from APPROVED to "COMPLETED".
</div>';
}
?>
<div class="col-md-7 divider">
<div id='calendar'></div><br/>
<div class="row">
<?php
$sql = "SELECT * FROM reservation WHERE STATUS = 'APPROVED' LIMIT 5";
$result = mysqli_query($conn,$sql);
$count = mysqli_affected_rows($conn);
?>
<div class="col-md-12"> <!-- start of table -->
<br/>
<div class="col-md-6">
<h4 class="title"><i class="fa fa-calendar-check-o" aria-hidden="true"></i> Upcoming Events <span class="badge"><?php echo $count; ?></span></h4>
</div>
<div class="col-md-6 titleAlign">
<div class="col-md-12">
<a href="list-of-reservations.php" class="viewList" >View complete list</a>
</div>
</div>
<?php
echo '<table class="table table-striped table-bordered" style="box-shadow: 5px 5px 15px grey">
<tr>
<th>Event Name</th>
<th>Date</th>
<th>Client Name</th>
<th>StartTime</th>
<th>View Details</th>
';
while ($row = mysqli_fetch_array($result)){
echo '<tr>
<td>'.$row["ENAME"].'</td>
<td>'.$row["EDATE"].'</td>
<td>'.$row["CNAME"].'</td>
<td>'.$row["STARTTIME"].'</td>
<td><a class="btn btn-primary btn-sm" href="reservation-event-details.php?id='.$row["ID"].'">View Details</a></td>
</tr>';
}
echo '</table>';
?>
<!-- view details -->
<br/>
</div> <!-- end of table -->
<?php
$sql = "SELECT * FROM reservation WHERE STATUS = 'PENDING' LIMIT 5";
$result = mysqli_query($conn,$sql);
$count = mysqli_affected_rows($conn);
?>
<div class="col-md-12"> <!-- start of table -->
<div class="col-md-6">
<h4 class="title"> <i class="fa fa-calendar-minus-o" aria-hidden="true"></i> Pending reservations <span class="badge"><?php echo $count; ?></span></h4>
</div>
<div class="col-md-6 titleAlign">
<div class="col-md-12">
<a href="list-of-reservations.php" class="viewList" >View complete list</a>
</div>
</div>
<?php
echo '<table class="table table-striped table-bordered" style="box-shadow: 5px 5px 15px grey">
<tr>
<th>Event Name</th>
<th>Date</th>
<th>Client Name</th>
<th>View Details</th>
';
while ($row = mysqli_fetch_array($result)){
echo '<tr>
<td>'.$row["ENAME"].'</td>
<td>'.$row["EDATE"].'</td>
<td>'.$row["CNAME"].'</td>
<td><a class="btn btn-success btn-sm" href="reservation-event-details.php?id='.$row["ID"].'">View Details</a></td>
</tr>';
}
echo '</table>';
?>
<!-- end of view details -->
</div> <!-- end of table -->
</div> <!-- row -->
<?php
$sql = "SELECT * FROM stats";
$result = mysqli_query($conn,$sql);
$row = mysqli_fetch_array($result);
?>
</div> <!-- col-md-7 -->
<div class="col-md-5">
<div class="invoice" style="padding: 10px;"><h3 align="center"><?php echo $time_one = date('l, F d, Y'); ?></h3></div>
<h3 class="title"><i class="fa fa-line-chart" aria-hidden="true"></i> Statistics</h3>
<div data-aos="flip-down" data-aos-duration="1500">
<div class="col-xs-6">
<div style="text-align:center" class="panel panel-primary pan">
<div class="panel-heading">
<h1 class="panel-title"><i class="fa fa-check-square-o" aria-hidden="true"></i> Site Visits</h1>
</div>
<!-- end panel-heading -->
<div class="panel-info">
<h1><?php echo $row["VISITS"]; ?></h1>
</div>
<!-- end panel-body -->
</div>
<!-- end panel-primary -->
</div>
</div>
<?php
$sql = "SELECT * FROM reservation WHERE STATUS = 'COMPLETED' OR STATUS = 'APPROVED' OR STATUS = 'PENDING'";
$result = mysqli_query($conn,$sql);
$count = mysqli_affected_rows($conn);
?>
<div data-aos="flip-down" data-aos-duration="1500">
<div class="col-xs-6">
<div style="text-align:center" class="panel panel-primary pan">
<div class="panel-heading">
<h1 class="panel-title"><i class="fa fa-check-square-o" aria-hidden="true"></i> Reservations</h1>
</div>
<!-- end panel-heading -->
<div class="panel-info">
<h1> <?php echo $count; ?></h1>
</div>
<!-- end panel-body -->
</div>
<!-- end panel-primary -->
</div>
</div>
<?php
$sql = "SELECT * FROM registration";
$result = mysqli_query($conn,$sql);
$count = mysqli_affected_rows($conn);
?>
<div data-aos="flip-down" data-aos-duration="1800">
<div class="col-xs-6">
<div style="text-align:center" class="panel panel-primary pan">
<div class="panel-heading">
<h1 class="panel-title"><i class="fa fa-check-square-o" aria-hidden="true"></i> Registered Users</h1>
</div>
<!-- end panel-heading -->
<div class="panel-info">
<h1> <?php echo $count; ?> </h1>
</div>
<!-- end panel-body -->
</div>
<!-- end panel-primary -->
</div>
</div>
<?php
$sql = "SELECT * FROM reservation WHERE STATUS = 'COMPLETED'";
$result = mysqli_query($conn,$sql);
$count = mysqli_affected_rows($conn);
?>
<div data-aos="flip-down" data-aos-duration="2500">
<div class="col-xs-6">
<div style="text-align:center" class="panel panel-primary pan">
<div class="panel-heading">
<h1 class="panel-title"><i class="fa fa-check-square-o" aria-hidden="true"></i> Finished Events</h1>
</div>
<!-- end panel-heading -->
<div class="panel-info">
<h1> <?php echo $count; ?> </h1>
</div>
<!-- end panel-body -->
</div>
<!-- end panel-primary -->
</div>
</div>
<div class="col-md-12">
<div data-aos="zoom-out-down" data-aos-duration="2500">
<div class="wrap">
<h3 class="title"><i class="fa fa-pencil-square-o" aria-hidden="true"></i> Todo List</h3>
<div class="task-list">
<ul>
<?php
$query = mysqli_query($conn,"SELECT * FROM tasks ORDER BY date ASC, time ASC");
$numrows = mysqli_num_rows($query);
if($numrows>0){
while( $row = mysqli_fetch_assoc( $query ) ){
$task_id = $row['id'];
$task_name = $row['task'];
echo '<li>
<span>'.$task_name.'</span>
<img id="'.$task_id.'" class="delete-button" width="10px" src="img/close.svg" />
</li>';
}
}
?>
</ul>
</div>
<form class="add-new-task" autocomplete="off">
<input type="text" name="new-task" placeholder="Add a new item..." />
</form>
</div>
</div>
</div> <!-- col-md-12 -->
<div class="col-md-12"><!-- col-md-12 -->
<h3 class="title"><i class="fa fa-signal" aria-hidden="true"></i> Send Sms</h3>
<div class="form-horizontal">
<br/>
<fieldset>
<!-- Email input-->
<div class="form-group">
<label class="col-md-3 control-label" for="email">Number</label>
<div class="col-md-9">
<input id="sms" name="sms" type="text" placeholder="example@example.com" class="form-control">
</div>
</div>
<!-- Message body -->
<div class="form-group">
<label class="col-md-3 control-label" for="message">Your message</label>
<div class="col-md-9">
<textarea class="form-control" id="message" name="message" placeholder="Please enter your message here..." rows="5"></textarea>
</div>
</div>
<!-- Form actions -->
<div class="form-group">
<div class="col-md-12 text-right">
<div class="col-lg-7 col-lg-offset-2">
</div>
<div class="col-lg-3">
<button onclick="sendSms()" class="btn btn-primary btn-lg">Submit</button>
</div>
</div>
</div>
<!-- Message -->
<div class="form-group">
<div class="col-md-9">
</div>
</div>
</fieldset>
</div>
</div>
</div> <!-- col-md-5 -->
</div>
<?php
include_once("footeradmin.php");
?>