-
Notifications
You must be signed in to change notification settings - Fork 1
/
my-booking.php
299 lines (261 loc) · 10.3 KB
/
my-booking.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
<?php
session_start();
error_reporting(0);
include('includes/config.php');
if(strlen($_SESSION['login'])==0)
{
header('location:index.php');
}
else{
?><!DOCTYPE HTML>
<html lang="en">
<head>
<title>Matatu E-booking Portal - My Booking</title>
<!--Bootstrap -->
<link rel="stylesheet" href="assets/css/bootstrap.min.css" type="text/css">
<!--Custome Style -->
<link rel="stylesheet" href="assets/css/style.css" type="text/css">
<!--OWL Carousel slider-->
<link rel="stylesheet" href="assets/css/owl.carousel.css" type="text/css">
<link rel="stylesheet" href="assets/css/owl.transitions.css" type="text/css">
<!--slick-slider -->
<link href="assets/css/slick.css" rel="stylesheet">
<!--bootstrap-slider -->
<link href="assets/css/bootstrap-slider.min.css" rel="stylesheet">
<!--FontAwesome Font Style -->
<link href="assets/css/font-awesome.min.css" rel="stylesheet">
<!-- SWITCHER -->
<link rel="stylesheet" id="switcher-css" type="text/css" href="assets/switcher/css/switcher.css" media="all" />
<link rel="alternate stylesheet" type="text/css" href="assets/switcher/css/red.css" title="red" media="all" data-default-color="true" />
<link rel="alternate stylesheet" type="text/css" href="assets/switcher/css/orange.css" title="orange" media="all" />
<link rel="alternate stylesheet" type="text/css" href="assets/switcher/css/blue.css" title="blue" media="all" />
<link rel="alternate stylesheet" type="text/css" href="assets/switcher/css/pink.css" title="pink" media="all" />
<link rel="alternate stylesheet" type="text/css" href="assets/switcher/css/green.css" title="green" media="all" />
<link rel="alternate stylesheet" type="text/css" href="assets/switcher/css/purple.css" title="purple" media="all" />
<!-- Fav and touch icons -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="assets/images/favicon-icon/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="assets/images/favicon-icon/apple-touch-icon-114-precomposed.html">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="assets/images/favicon-icon/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="assets/images/favicon-icon/apple-touch-icon-57-precomposed.png">
<link rel="shortcut icon" href="assets/images/favicon-icon/mat.png">
<!-- Google-Font-->
<link href="https://fonts.googleapis.com/css?family=Lato:300,400,700,900" rel="stylesheet">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<!-- Start Switcher -->
<?php include('includes/colorswitcher.php');?>
<!-- /Switcher -->
<!--Header-->
<?php include('includes/header.php');?>
<!--Page Header-->
<!-- /Header -->
<!--Page Header-->
<section class="page-header profile_page">
<div class="container">
<div class="page-header_wrap">
<div class="page-heading">
<h1>My Booking</h1>
</div>
<ul class="coustom-breadcrumb">
<li><a href="#">Home</a></li>
<li>My Booking</li>
</ul>
</div>
</div>
<!-- Dark Overlay-->
<div class="dark-overlay"></div>
</section>
<!-- /Page Header-->
<?php
$useremail=$_SESSION['login'];
$sql = "SELECT * from tblusers where EmailId=:useremail ";
$query = $dbh -> prepare($sql);
$query -> bindParam(':useremail',$useremail, PDO::PARAM_STR);
$query->execute();
$results=$query->fetchAll(PDO::FETCH_OBJ);
$cnt=1;
if($query->rowCount() > 0)
{
foreach($results as $result)
{ ?>
<section class="user_profile inner_pages">
<div class="container">
<div class="user_profile_info gray-bg padding_4x4_40">
<div class="upload_user_logo"> <img src="assets/images/booking-icon.png" alt="image">
</div>
<div class="dealer_info">
<h5><?php echo htmlentities($result->FullName);?></h5>
<p><?php echo htmlentities($result->Address);?><br>
<?php echo htmlentities($result->City);?> <?php echo htmlentities($result->Country); }}?></p>
</div>
</div>
<div class="row">
<div class="col-md-3 col-sm-3">
<?php include('includes/sidebar.php');?>
<div class="col-md-8 col-sm-8">
<div class="profile_wrap">
<h5 class="uppercase underline">My Booking </h5>
<div class="my_vehicles_list">
<ul class="vehicle_listing">
<?php
$useremail=$_SESSION['login'];
$sql = "SELECT tblvehicles.Vimage1 as Vimage1,tblvehicles.VehiclesTitle,tblvehicles.id as vid,tblbrands.BrandName,tblbooking.FromDate,tblbooking.ToDate,tblbooking.message,tblbooking.Status,tblvehicles.PricePerDay,DATEDIFF(tblbooking.ToDate,tblbooking.FromDate) as totaldays,tblbooking.BookingNumber from tblbooking join tblvehicles on tblbooking.VehicleId=tblvehicles.id join tblbrands on tblbrands.id=tblvehicles.VehiclesBrand where tblbooking.userEmail=:useremail order by tblbooking.id desc";
$query = $dbh -> prepare($sql);
$query-> bindParam(':useremail', $useremail, PDO::PARAM_STR);
$query->execute();
$results=$query->fetchAll(PDO::FETCH_OBJ);
$cnt=1;
if($query->rowCount() > 0)
{
foreach($results as $result)
{ ?>
<li>
<h4 style="color:red">Booking No #<?php echo htmlentities($result->BookingNumber);?></h4>
<div class="vehicle_img"> <a href="vehical-details.php?vhid=<?php echo htmlentities($result->vid);?>"><img src="admin/img/vehicleimages/<?php echo htmlentities($result->Vimage1);?>" alt="image"></a> </div>
<div class="vehicle_title">
<h6><a href="vehical-details.php?vhid=<?php echo htmlentities($result->vid);?>"> <?php echo htmlentities($result->BrandName);?> , <?php echo htmlentities($result->VehiclesTitle);?></a></h6>
<p><b>From </b> <?php echo htmlentities($result->FromDate);?> <b>To </b> <?php echo htmlentities($result->ToDate);?></p>
<div style="float: left"><p><b>Message:</b> <?php echo htmlentities($result->message);?> </p></div>
</div>
<?php if($result->Status==1)
{ ?>
<div class="vehicle_status"> <a href="#" class="btn outline btn-xs active-btn">Confirmed</a>
<div class="clearfix"></div>
</div>
<?php } else if($result->Status==2) { ?>
<div class="vehicle_status"> <a href="#" class="btn outline btn-xs">Cancelled</a>
<div class="clearfix"></div>
</div>
<?php } else { ?>
<div class="vehicle_status"> <a href="#" class="btn outline btn-xs">Not Confirm yet</a>
<div class="clearfix"></div>
</div>
<?php } ?>
</li>
<h5 style="color:blue">Invoice</h5>
<table>
<tr>
<th>Vehicle Name</th>
<th>From Date</th>
<th>To Date</th>
<th>Total Days</th>
<th>Rent / Day</th>
</tr>
<tr>
<td><?php echo htmlentities($result->VehiclesTitle);?>, <?php echo htmlentities($result->BrandName);?></td>
<td><?php echo htmlentities($result->FromDate);?></td>
<td> <?php echo htmlentities($result->ToDate);?></td>
<td><?php echo htmlentities($tds=$result->totaldays);?></td>
<td> <?php echo htmlentities($ppd=$result->PricePerDay);?></td>
</tr>
<tr>
<th colspan="4" style="text-align:center;"> Grand Total</th>
<th><?php echo htmlentities($tds*$ppd);?></th>
</tr>
</table>
<p>Dear customer please proceed to pay <b>Ksh <?php echo htmlentities($tds*$ppd);?> </b> using your preferred payment method below, please note if the payment is not made within the next 12 hours your booking will be cancelled.</p>
<hr />
<?php }} else { ?>
<h5 align="center" style="color:red">No booking yet</h5>
<?php } ?>
</ul>
</div>
</div>
</div>
</div>
</div>
<style>
* {
box-sizing: border-box;
}
body {
font-family: Arial, Helvetica, sans-serif;
}
/* Float four columns side by side */
.column {
float: left;
width: 25%;
padding: 0 10px;
}
/* Remove extra left and right margins, due to padding */
.row {margin: 1px;}
/* Clear floats after the columns */
.row:after {
content: "";
display: table;
clear: both;
}
/* Responsive columns */
@media screen and (max-width: 600px) {
.column {
width: 100%;
display: block;
margin-bottom: 20px;
}
}
/* Style the counter cards */
.card {
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
padding: 16px;
text-align: center;
background-color: #f1f1f1;
}
</style>
<center>
<section>
<h2 class="center">Payment methods</h2>
</section>
</center>
<div class="row">
<div class="column">
<div class="card">
<h3>M-Pesa</h3>
<img src="assets/images/payment.jpeg" height="150" width="220" alt="">
<p>Till number: 123456</p>
</div>
</div>
<div class="column">
<div class="card">
<h3>Equity Bank</h3>
<img src="assets/images/equity.jpeg" height="150" width="220" alt="">
<p>Account number: 02200000000</p>
</div>
</div>
<div class="column">
<div class="card">
<h3>KCB Bank</h3>
<img src="assets/images/kcb.jpeg" height="150" width="250" alt="">
<p>Account number: 0800000000</p>
</div>
</div>
<div class="column">
<div class="card">
<h3>Standard Chartered</h3>
<img src="assets/images/sc.jpeg" height="150" width="250" alt="">
<p>Account number: 01000000000</p>
</div>
</div>
</div>
</section>
<!--/my-vehicles-->
<?php include('includes/footer.php');?>
<!-- Scripts -->
<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
<script src="assets/js/interface.js"></script>
<!--Switcher-->
<script src="assets/switcher/js/switcher.js"></script>
<!--bootstrap-slider-JS-->
<script src="assets/js/bootstrap-slider.min.js"></script>
<!--Slider-JS-->
<script src="assets/js/slick.min.js"></script>
<script src="assets/js/owl.carousel.min.js"></script>
</body>
</html>
<?php } ?>