-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathview_visitors.php
552 lines (489 loc) · 30.7 KB
/
view_visitors.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
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
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
<?php include("header.php"); ?>
<?php
if(isset($_GET['id'])){
$id=$_GET['id'];
$query="select parking_number from tblvisitors where visitor_id=$id";
$get=mysqli_query($conn,$query);
$row=mysqli_fetch_array($get);
$parking_number=$row['parking_number'];
date_default_timezone_set("Asia/Calcutta");
$time=date("Y-m-d H:i:s");
$array=explode('-',$parking_number);
//echo "<script>alert('$time');</script>";
$query="update tblparking_plot set status=0 where plot_name='$array[0]' and plot_no=$array[1]";
$get=mysqli_query($conn,$query);
$query="update tblvisitors set exit_time='$time' where visitor_id=$id";
$get=mysqli_query($conn,$query);
echo "<script>window.location='view_visitors.php'</script>";
}
?>
<div id="main">
<div class="container">
<h2 style="text-align: center;margin: 10px;">Visitor Details</h2>
<br>
<!-- Nav pills -->
<div style="padding-left: 3%">
<ul class="nav nav-pills" role="tablist">
<li class="nav-item">
<a class="nav-link active" data-toggle="pill" href="#latest">Parked</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="pill" href="#processing">Exited</a>
</li>
</ul>
</div>
<!-- Tab panes -->
<div class="tab-content">
<div id="latest" class="container tab-pane active"><br>
<div class="container">
<div class="jumbotron">
<center>
<table id="example" class="row-border hover order-column" style="width:100%">
<thead>
<tr>
<th>Visitor Name</th>
<th>Contact number</th>
<th>Owner block number</th>
<th>Vehicle Number</th>
<th>Parking Slot</th>
<th></th>
</tr>
</thead>
<tbody>
<?php
$query = "select * from tblvisitors where exit_time is null";
$get = mysqli_query($conn, $query);
while ($row = mysqli_fetch_array($get)) {
$vid = $row['visitor_id'];
$vname = $row['visitor_name'];
$vmob = $row['mobile_no'];
$vrel = $row['relation'];
$vreason = $row['reason'];
$vplot = $row['plot_no'];
$vcount = $row['total_visitors'];
$vnum = $row['vehicle_no'];
$vpnum = $row['parking_number'];
$vemail = $row['email_id'];
$vtype = $row['vehicle_type'];
?>
<tr>
<td><?php echo $vname; ?></td>
<td><?php echo $vmob; ?></td>
<td><?php echo $vplot; ?></td>
<td><?php echo $vnum; ?></td>
<td><?php echo $vpnum; ?></td>
<td><button type="button" class="btn btn-primary" data-toggle="modal" data-target="#parkmodal<?php echo $vid; ?>"> View </button></td>
</tr>
<div class="modal" id="parkmodal<?php echo $vid; ?>">
<div class="modal-dialog modal-lg" style="text-align: left;">
<div class="modal-content">
<!-- Modal Header -->
<div class="modal-header">
<h4 class="modal-title">Visitors Details</h4>
<button type="button" class="close" data-dismiss="modal">×</button>
</div>
<!-- Modal body -->
<div class="modal-body" style="font-family: verdana;">
<div class="row">
<div class="col-sm-4">
<h6>Visitor Name</h6>
</div>
<div class="col-sm-4">
<p>: <?php echo $vname; ?></p>
</div>
</div>
<div class="row">
<div class="col-sm-4">
<h6>Visitor Mobile number</h6>
</div>
<div class="col-sm-4">
<p>: <?php echo $vmob; ?></p>
</div>
</div>
<div class="row">
<div class="col-sm-4">
<h6>Visitor Email ID</h6>
</div>
<div class="col-sm-4">
<p>: <?php echo $vemail; ?></p>
</div>
</div>
<div class="row">
<div class="col-sm-4">
<h6>Block Number</h6>
</div>
<div class="col-sm-4">
<p>: <?php echo $vplot; ?></p>
</div>
</div>
<div class="row">
<div class="col-sm-4">
<h6>Relation</h6>
</div>
<div class="col-sm-4">
<p>: <?php echo $vrel; ?></p>
</div>
</div>
<div class="row">
<div class="col-sm-4">
<h6>Vehicle Number</h6>
</div>
<div class="col-sm-4">
<p>: <?php echo $vnum; ?></p>
</div>
</div>
<div class="row">
<div class="col-sm-4">
<h6>Vehicle Type</h6>
</div>
<div class="col-sm-4">
<p>: <?php echo $vtype; ?>-Wheeler</p>
</div>
</div>
<div class="row">
<div class="col-sm-4">
<h6>Parking Number</h6>
</div>
<div class="col-sm-4">
<p>: <?php echo $vpnum; ?></p>
</div>
</div>
<div class="row">
<div class="col-sm-4">
<h6>Total Number Of Visitor</h6>
</div>
<div class="col-sm-4">
<p>: <?php echo $vcount; ?></p>
</div>
</div>
<h6>
<hr><b>Reason for visit</b> <br></h6>
<?php echo $vreason; ?>
<br>
</div>
<!-- Modal footer -->
<div class="modal-footer">
<a href="view_visitors.php?id=<?php echo $vid;?>"><button type="submit" class="btn btn-info float-right">Free The Spot</button></a>
<button class="btn btn-secondary" type="button" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<?php } ?>
</tbody>
<tfoot>
<tr>
<th>Visitor Name</th>
<th>Contact number</th>
<th>Owner block number</th>
<th>Vehicle Number</th>
<th>Parking Slot</th>
<th></th>
</tr>
</tfoot>
</table>
</center>
</div>
</div>
</div>
<div id="processing" class="container tab-pane fade"><br>
<div class="container">
<div class="jumbotron">
<center>
<table id="example1" class="row-border hover order-column" style="width:100%">
<thead>
<tr>
<th>Visitor Name</th>
<th>Contact number</th>
<th>Owner block number</th>
<th>Vehicle Number</th>
<th>Exit Time</th>
<th></th>
</tr>
</thead>
<tbody>
<?php
$query = "select * from tblvisitors where exit_time is not null and status=0";
$get = mysqli_query($conn, $query);
while ($row = mysqli_fetch_array($get)) {
$vid = $row['visitor_id'];
$vname = $row['visitor_name'];
$vmob = $row['mobile_no'];
$vrel = $row['relation'];
$vreason = $row['reason'];
$vplot = $row['plot_no'];
$vcount = $row['total_visitors'];
$vnum = $row['vehicle_no'];
$vpnum = $row['parking_number'];
$vemail = $row['email_id'];
$vtype = $row['vehicle_type'];
$date=$row['exit_time'];
$current = date("Y-m-d", time());
$time = strtotime($date);
$final = date("Y-m-d", strtotime("+6 month", $time));
if($current>$final){
$query3="update tblvisitors set status=1 where visitor_id=$vid";
$get1=mysqli_query($conn,$query3);
}
?>
<tr>
<td><?php echo $vname; ?></td>
<td><?php echo $vmob; ?></td>
<td><?php echo $vplot; ?></td>
<td><?php echo $vnum; ?></td>
<td><?php echo $row['exit_time']; ?></td>
<td><button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exitmodal<?php echo $vid; ?>"> View </button></td>
</tr>
<div class="modal" id="exitmodal<?php echo $vid; ?>">
<div class="modal-dialog modal-lg" style="text-align: left;">
<div class="modal-content">
<!-- Modal Header -->
<div class="modal-header">
<h4 class="modal-title">Visitors Details</h4>
<button type="button" class="close" data-dismiss="modal">×</button>
</div>
<!-- Modal body -->
<div class="modal-body" style="font-family: verdana;">
<div class="row">
<div class="col-sm-4">
<h6>Visitor Name</h6>
</div>
<div class="col-sm-4">
<p>: <?php echo $vname; ?></p>
</div>
</div>
<div class="row">
<div class="col-sm-4">
<h6>Visitor Mobile number</h6>
</div>
<div class="col-sm-4">
<p>: <?php echo $vmob; ?></p>
</div>
</div>
<div class="row">
<div class="col-sm-4">
<h6>Visitor Email ID</h6>
</div>
<div class="col-sm-4">
<p>: <?php echo $vemail; ?></p>
</div>
</div>
<div class="row">
<div class="col-sm-4">
<h6>Block Number</h6>
</div>
<div class="col-sm-4">
<p>: <?php echo $vplot; ?></p>
</div>
</div>
<div class="row">
<div class="col-sm-4">
<h6>Relation</h6>
</div>
<div class="col-sm-4">
<p>: <?php echo $vrel; ?></p>
</div>
</div>
<div class="row">
<div class="col-sm-4">
<h6>Vehicle Number</h6>
</div>
<div class="col-sm-4">
<p>: <?php echo $vnum; ?></p>
</div>
</div>
<div class="row">
<div class="col-sm-4">
<h6>Vehicle Type</h6>
</div>
<div class="col-sm-4">
<p>: <?php echo $vtype; ?>-Wheeler</p>
</div>
</div>
<div class="row">
<div class="col-sm-4">
<h6>Parking Number</h6>
</div>
<div class="col-sm-4">
<p>: <?php echo $vpnum; ?></p>
</div>
</div>
<div class="row">
<div class="col-sm-4">
<h6>Total Number Of Visitor</h6>
</div>
<div class="col-sm-4">
<p>: <?php echo $vcount; ?></p>
</div>
</div>
<h6>
<hr><b>Reason for visit</b> <br></h6>
<?php echo $vreason; ?>
<br>
</div>
<!-- Modal footer -->
<div class="modal-footer">
<button class="btn btn-secondary" type="button" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<?php } ?>
</tbody>
<tfoot>
<tr>
<th>Visitor Name</th>
<th>Contact number</th>
<th>Owner block number</th>
<th>Vehicle Number</th>
<th>Exit Time</th>
<th></th>
</tr>
</tfoot>
</table>
</center>
</div>
</div>
</div>
<!-- The Modal -->
<!-- The Modal -->
<div class="modal" id="exitmodal">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<!-- Modal Header -->
<div class="modal-header">
<h4 class="modal-title">Visitors Details</h4>
<button type="button" class="close" data-dismiss="modal">×</button>
</div>
<!-- Modal body -->
<div class="modal-body" style="font-family: verdana;">
<div class="row">
<div class="col-sm-4">
<h6>Visitor Name</h6>
</div>
<div class="col-sm-4">
<p>: Harshillllll</p>
</div>
</div>
<div class="row">
<div class="col-sm-4">
<h6>Visitor Mobile number</h6>
</div>
<div class="col-sm-4">
<p>: 9191919191</p>
</div>
</div>
<div class="row">
<div class="col-sm-4">
<h6>Visitor Email ID</h6>
</div>
<div class="col-sm-4">
<p>: Harshil@gmail.com</p>
</div>
</div>
<div class="row">
<div class="col-sm-4">
<h6>Block Number</h6>
</div>
<div class="col-sm-4">
<p>: A-101</p>
</div>
</div>
<div class="row">
<div class="col-sm-4">
<h6>Relation</h6>
</div>
<div class="col-sm-4">
<p>: Brother</p>
</div>
</div>
<div class="row">
<div class="col-sm-4">
<h6>Vehicle Number</h6>
</div>
<div class="col-sm-4">
<p>: GJ-01-SJ-1999</p>
</div>
</div>
<div class="row">
<div class="col-sm-4">
<h6>Vehicle Type</h6>
</div>
<div class="col-sm-4">
<p>: 2-Wheeler</p>
</div>
</div>
<div class="row">
<div class="col-sm-4">
<h6>Parking Number</h6>
</div>
<div class="col-sm-4">
<p>: AV-10</p>
</div>
</div>
<div class="row">
<div class="col-sm-4">
<h6>Total Number Of Visitor</h6>
</div>
<div class="col-sm-4">
<p>: 4</p>
</div>
</div>
<h6>
<hr><b>Reason for visit</b> <br></h6>
Living in a housing society is akin to being in a committed relationship, except it gets murkier when things go awry as they sometimes do. We’ve all been in catch 22 situations where if a problem persists, we are damned if we try to solve it and damned if we don’t. After all, it is better to resolve a conflict or dispute peacefully in a way that is acceptable to both parties. This post covers the different problems that may arise for members in a housing society and various ways for redressal.
<br>
</div>
<!-- Modal footer -->
<div class="modal-footer">
<button class="btn btn-secondary" type="button" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<script>
function openNav() {
document.getElementById("heading").style.marginLeft = "200px";
document.getElementById("mySidenav").style.width = "250px";
document.getElementById("main").style.marginLeft = "250px";
document.getElementById("main2").style.marginLeft = "250px";
document.getElementById("mySidebar").style.display = "block";
document.getElementById("openNav").style.display = 'none';
}
function closeNav() {
document.getElementById("heading").style.marginLeft = "0";
document.getElementById("mySidenav").style.width = "0";
document.getElementById("main").style.marginLeft = "0%";
document.getElementById("mySidebar").style.display = "none";
document.getElementById("openNav").style.display = "inline-block";
}
$(document).ready(function() {
var table = $('#example1').DataTable();
$('#example tbody')
.on('mouseenter', 'td', function() {
var colIdx = table.cell(this).index().column;
$(table.cells().nodes()).removeClass('highlight');
$(table.column(colIdx).nodes()).addClass('highlight');
});
});
$(document).ready(function() {
var table = $('#example2').DataTable();
$('#example tbody')
.on('mouseenter', 'td', function() {
var colIdx = table.cell(this).index().column;
$(table.cells().nodes()).removeClass('highlight');
$(table.column(colIdx).nodes()).addClass('highlight');
});
});
$(document).ready(function() {
var table = $('#example').DataTable();
$('#example tbody')
.on('mouseenter', 'td', function() {
var colIdx = table.cell(this).index().column;
$(table.cells().nodes()).removeClass('highlight');
$(table.column(colIdx).nodes()).addClass('highlight');
});
});
</script>
</body>
</html>