-
Notifications
You must be signed in to change notification settings - Fork 0
/
my_booking.php
217 lines (196 loc) · 9.12 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
<?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>
<meta charset="utf-8">
<title>Car Rental Portal | My Booking</title>
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<meta content="" name="keywords">
<meta content="" name="description">
<meta content="Author" name="WebThemez">
<!-- Favicons -->
<link href="img/favicon.png" rel="icon">
<link href="img/apple-touch-icon.png" rel="apple-touch-icon">
<!-- Google Fonts -->
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,700,700i|Raleway:300,400,500,700,800|Montserrat:300,400,700" rel="stylesheet">
<!-- Bootstrap CSS File -->
<link href="lib/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- Libraries CSS Files -->
<link href="lib/font-awesome/css/font-awesome.min.css" rel="stylesheet">
<link href="lib/animate/animate.min.css" rel="stylesheet">
<link href="lib/ionicons/css/ionicons.min.css" rel="stylesheet">
<link href="lib/owlcarousel/assets/owl.carousel.min.css" rel="stylesheet">
<link href="lib/magnific-popup/magnific-popup.css" rel="stylesheet">
<link href="lib/ionicons/css/ionicons.min.css" rel="stylesheet">
<!-- Main Stylesheet File -->
<link href="css/style.css" rel="stylesheet">
</head>
<body id="body">
<?php include('includes/header.php');?>
<section id="innerBanner">
<div class="inner-content">
<h2><span>My Bookings</span><br>We create the opportunities!</h2>
<div>
</div>
</div>
</section><!-- #Page Banner -->
<main id="main">
<?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="admin/img/vehicleimages/dealer-logo.jpg" 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 Bookings </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";
$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="car_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="car_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>Car 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>
<hr />
<?php
}
} else { ?>
<h5 align="center" style="color:red">No booking yet</h5>
<?php
} ?>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
<section id="call-to-action" class="wow fadeInUp">
<div class="container">
<div class="row">
<div class="col-lg-9 text-center text-lg-left">
<h3 class="cta-title">Get Our Service</h3>
<p class="cta-text">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolores quae porro consequatur aliquam, incidunt fugiat culpa esse aute nulla cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>
<div class="col-lg-3 cta-btn-container text-center">
<a class="cta-btn align-middle" href="#contact">Contact Us</a>
</div>
</div>
</div>
</section><!-- #call-to-action -->
</main>
<?php include('includes/footer.php');?><!-- #footer -->
<a href="#" class="back-to-top"><i class="fa fa-chevron-up"></i></a>
<!--Login-Form -->
<?php include('includes/login.php');?>
<!--/Login-Form -->
<!--Register-Form -->
<?php include('includes/registration.php');?>
<!--/Register-Form -->
<!--Forgot-password-Form -->
<?php include('includes/forgotpassword.php');?>
<!--/Forgot-password-Form -->
<!-- JavaScript -->
<script src="lib/jquery/jquery.min.js"></script>
<script src="lib/jquery/jquery-migrate.min.js"></script>
<script src="lib/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="lib/easing/easing.min.js"></script>
<script src="lib/superfish/hoverIntent.js"></script>
<script src="lib/superfish/superfish.min.js"></script>
<script src="lib/wow/wow.min.js"></script>
<script src="lib/owlcarousel/owl.carousel.min.js"></script>
<script src="lib/magnific-popup/magnific-popup.min.js"></script>
<script src="lib/sticky/sticky.js"></script>
<script src="contact/jqBootstrapValidation.js"></script>
<script src="contact/contact_me.js"></script>
<script src="js/main.js"></script>
</body>
</html>
<?php
} ?>