-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbooking-list.php
130 lines (115 loc) · 4.06 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
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
<!-- booking-list.php -->
<?php include 'template/header.php';
if (!isset($_SESSION['isLoggedIn'])) {
echo '<script>window.location="login.php"</script>';
}
?>
<body>
<section class="body">
<!-- start: header -->
<?php include 'template/top-bar.php'; ?>
<!-- end: header -->
<div class="inner-wrapper">
<!-- start: sidebar -->
<?php include 'template/left-bar.php'; ?>
<!-- end: sidebar -->
<section role="main" class="content-body">
<header class="page-header">
<h2>Table</h2>
<div class="right-wrapper pull-right">
<ol class="breadcrumbs">
<li>
<a href="index.php">
<i class="fa fa-home"></i>
</a>
</li>
<li><span>Tables</span></li>
<li><span>Booking List</span></li>
</ol>
<a class="sidebar-right-toggle" data-open="sidebar-right"><i class="fa fa-chevron-left"></i></a>
</div>
</header>
<!-- start: page -->
<section class="panel">
<header class="panel-heading">
<div class="panel-actions">
<a href="#" class="fa fa-caret-down"></a>
<a href="#" class="fa fa-times"></a>
</div>
<h2 class="panel-title">All Bookings</h2>
</header>
<div class="panel-body">
<table class="table table-bordered table-striped mb-none" id="datatable-tabletools" data-swf-path="assets/vendor/jquery-datatables/extras/TableTools/swf/copy_csv_xls_pdf.swf">
<thead>
<tr>
<th>No</th>
<th>Transaction Id</th>
<th>Name</th>
<th>Phone</th>
<th>Date</th>
<th>Time</th>
<th>Bill</th>
<th class="hidden-phone">Status</th>
<th class="hidden-phone">Action</th>
<th class="hidden-phone">View</th>
</tr>
</thead>
<tbody>
<?php
$count = 1;
include 'dbCon.php';
$con = connect();
$res_id = $_SESSION['id'];
$sql = "SELECT * FROM `booking_details` WHERE res_id = '$res_id' ORDER BY make_date DESC;";
$result = $con->query($sql);
foreach ($result as $r) {
?>
<tr class="gradeX">
<td class="center hidden-phone"><?php echo $count; ?></td>
<td class="center hidden-phone"><?php echo $r['transactionid']; ?></td>
<td><?php echo $r['name']; ?></td>
<td><?php echo $r['phone']; ?></td>
<td><?php echo $r['booking_date']; ?></td>
<td><?php echo $r['booking_time']; ?></td>
<td><?php echo $r['bill']; ?> ₹</td>
<td class="center hidden-phone">
<?php
$status = $r['status'];
if ($status == 0) {
?>
<p class="text-danger">Rejected</p>
<?php }else{ ?>
<p class="text-success">Confirmed</p>
<?php } ?>
</td>
<td class="center hidden-phone">
<?php
if ($status == 1) {
?>
<a href="approve-reject.php?breject_id=<?php echo $r['id']; ?>&booking-number=<?php echo $r['booking_id']; ?>" class="btn btn-danger" onclick="if (!Done()) return false; ">Reject</a>
<?php }else{ ?>
<a href="approve-reject.php?bapprove_id=<?php echo $r['id']; ?>&booking-number=<?php echo $r['booking_id']; ?>" class="btn btn-success" onclick="if (!Done()) return false; ">Confirm</a>
<?php } ?>
</td>
<td class="center hidden-phone">
<a href="invoice.php?booking-number=<?php echo $r['booking_id']; ?>" class="btn btn-primary">View</a>
</td>
</tr>
<?php $count++; } ?>
</tbody>
</table>
</div>
</section>
<!-- end: page -->
</section>
</div>
<?php include 'template/right-bar.php'; ?>
</section>
<script type="text/javascript">
function Done(){
return confirm("Are you sure?");
}
</script>
<?php include 'template/script-res.php'; ?>
</body>
</html>