-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbooking_list.php
82 lines (81 loc) · 4.25 KB
/
booking_list.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
<div class="content py-5 mt-5">
<div class="container">
<div class="card card-outline card-purple shadow rounded-0">
<div class="card-header">
<h4 class="card-title">My Booking List</h4>
</div>
<div class="card-body">
<table class="table table-striped table-bordered table-hover">
<colgroup>
<col width="5%">
<col width="15%">
<col width="15%">
<col width="30%">
<col width="10%">
<col width="15%">
</colgroup>
<thead>
<tr class="bg-gradient-dark text-light">
<th class="text-center">#</th>
<th class="text-center">Date Booked</th>
<th class="text-center">Ref. Code</th>
<th class="text-center">Details</th>
<th class="text-center">Status</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
<?php
$i = 1;
$qry = $conn->query("SELECT * FROM `booking_list` where client_id = '{$_settings->userdata('id')}' order by unix_timestamp(date_created) desc");
while($row = $qry->fetch_assoc()):
?>
<tr>
<td class="text-center"><?= $i++; ?></td>
<td><?= date("Y-m-d H:i", strtotime($row['date_created'])) ?></td>
<td><?= $row['ref_code'] ?></td>
<td>
<p class="m-0 truncate-1"><b>Pickup:</b> <?= $row['pickup_zone'] ?></p>
<p class="m-0 truncate-1"><b>Dropoff:</b> <?= $row['drop_zone'] ?></p>
</td>
<td class="text-center">
<?php
switch($row['status']){
case 0:
echo "<span class='badge badge-secondary bg-gradient-secondary px-3 rounded-pill'>Pending</span>";
break;
case 1:
echo "<span class='badge badge-primary bg-gradient-primary px-3 rounded-pill'>Driver Confirmed</span>";
break;
case 2:
echo "<span class='badge badge-warning bg-gradient-warning px-3 rounded-pill'>Picked-up</span>";
break;
case 3:
echo "<span class='badge badge-success bg-gradient-success px-3 rounded-pill'>Dropped off</span>";
break;
case 4:
echo "<span class='badge badge-danger bg-gradient-danger px-3 rounded-pill'>Cancelled</span>";
break;
}
?>
</td>
<td class="text-center">
<button type="button" class="btn btn-flat btn-info border btn-sm view_data" data-id="<?= $row['id'] ?>">View Details</button>
</td>
</tr>
<?php endwhile; ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<script>
$(function(){
$('table th, table td').addClass('px-2 py-1 align-middle')
$('table').dataTable();
$('.view_data').click(function(){
uni_modal("Booking Details","view_booking.php?id="+$(this).attr('data-id'))
})
})
</script>