-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
312 lines (266 loc) · 12.1 KB
/
index.php
File metadata and controls
312 lines (266 loc) · 12.1 KB
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
<?php
session_start();
include('includes/config.php');
error_reporting(0);
?>
<!DOCTYPE HTML>
<html lang="en">
<head>
<title>DriveMate</title>
<!--Bootstrap -->
<link rel="stylesheet" href="assets/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="assets/css/style.css" type="text/css">
<link rel="stylesheet" href="assets/css/owl.carousel.css" type="text/css">
<link rel="stylesheet" href="assets/css/owl.transitions.css" type="text/css">
<link href="assets/css/slick.css" rel="stylesheet">
<link href="assets/css/bootstrap-slider.min.css" rel="stylesheet">
<link href="assets/css/font-awesome.min.css" rel="stylesheet">
<!-- <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" /> -->
<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/favicon.png">
<link href="https://fonts.googleapis.com/css?family=Lato:300,400,700,900" rel="stylesheet">
</head>
<body>
<!-- Start Switcher -->
<!-- <? #php include('includes/colorswitcher.php');
?> -->
<!-- /Switcher -->
<!--Header-->
<?php include('includes/header.php'); ?>
<!-- /Header -->
<!-- Banners -->
<section id="banner" class="banner-section">
<div class="container">
<div class="div_zindex">
<div class="row">
<div class="col-md-5 col-md-push-7">
<div class="banner_content">
<h1> </h1>
<p> </p>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- /Banners -->
<!-- Resent Cat-->
<section class="section-padding gray-bg">
<div class="container">
<div class="section-header text-center">
<h2>Find the Best <span>DriveMate</span></h2>
<p>At DriveMate, we make car rentals simple, affordable, and tailored to your needs. Whether you're planning a road trip, a business meeting, or a weekend getaway, DriveMate is here to match you with the perfect vehicle. Explore our wide range of cars, flexible rental plans, and unbeatable customer service.Drive with ease. Drive with DriveMate.</p>
</div>
<div class="city-filter">
<form method="GET" action="index.php">
<label for="city">Choose Your City:</label>
<select id="city" name="city" onchange="this.form.submit()">
<option value="">All Cities</option>
<option value="Anand" <?php if (isset($_GET['city']) && $_GET['city'] == 'Anand') echo 'selected'; ?>>Anand</option>
<option value="Nadiad" <?php if (isset($_GET['city']) && $_GET['city'] == 'Nadiad') echo 'selected'; ?>>Nadiad</option>
<option value="Bharuch" <?php if (isset($_GET['city']) && $_GET['city'] == 'Bharuch') echo 'selected'; ?>>Bharuch</option>
</select>
</form>
</div>
<div class="row">
<div class="tab-content">
<div role="tabpanel" class="tab-pane active" id="resentnewcar">
<?php
$items_per_page = 6; // 2 rows, 3 cars per row
$page = isset($_GET['page']) ? (int)$_GET['page'] : 1;
$start = ($page - 1) * $items_per_page;
$city = isset($_GET['city']) ? $_GET['city'] : '';
$sql = "SELECT tblvehicles.VehiclesTitle, tblbrands.BrandName, tblvehicles.PricePerDay,
tblvehicles.FuelType, tblvehicles.ModelYear, tblvehicles.id,
tblvehicles.SeatingCapacity, tblvehicles.VehiclesOverview,
tblvehicles.Vimage1
FROM tblvehicles
JOIN tblbrands ON tblbrands.id = tblvehicles.VehiclesBrand";
if (!empty($city)) {
$sql .= " WHERE tblvehicles.city = :city";
}
$sql .= " LIMIT :start, :items_per_page";
$query = $dbh->prepare($sql);
if (!empty($city)) {
$query->bindParam(':city', $city, PDO::PARAM_STR);
}
$query->bindParam(':start', $start, PDO::PARAM_INT);
$query->bindParam(':items_per_page', $items_per_page, PDO::PARAM_INT);
$query->execute();
$results = $query->fetchAll(PDO::FETCH_OBJ);
$sql_total = "SELECT COUNT(*) FROM tblvehicles";
$query_total = $dbh->prepare($sql_total);
$query_total->execute();
$total_cars = $query_total->fetchColumn();
$total_pages = ceil($total_cars / $items_per_page);
if ($query->rowCount() == 0): ?>
<div class="no-cars-message">
<h4>No Cars Available in <?php echo htmlspecialchars($_GET['city'] ?? 'this location'); ?></h4>
<p>Try selecting a different city or check back later for updates.</p>
</div>
<?php endif;
if ($query->rowCount() > 0) {
foreach ($results as $result) {
?>
<div class="col-list-3">
<div class="recent-car-list">
<div class="car-info-box">
<a href="vehical-details.php?vhid=<?php echo htmlentities($result->id); ?>">
<img src="admin/img/vehicleimages/<?php echo htmlentities($result->Vimage1); ?>" class="img-responsive" alt="image">
</a>
<ul>
<li><i class="fa fa-car" aria-hidden="true"></i><?php echo htmlentities($result->FuelType); ?></li>
<li><i class="fa fa-calendar" aria-hidden="true"></i><?php echo htmlentities($result->ModelYear); ?> Model</li>
<li><i class="fa fa-user" aria-hidden="true"></i><?php echo htmlentities($result->SeatingCapacity); ?> seats</li>
</ul>
</div>
<div class="car-title-m">
<h6>
<a href="vehical-details.php?vhid=<?php echo htmlentities($result->id); ?>">
<?php echo htmlentities($result->VehiclesTitle); ?>
</a>
</h6>
<span class="price">₹<?php echo htmlentities($result->PricePerDay); ?> /Day</span>
</div>
<div class="inventory_info_m">
<p class="car-description"><?php echo substr($result->VehiclesOverview, 0, 70); ?></p>
</div>
</div>
</div>
<?php }
} ?>
<!-- Pagination Controls -->
</div>
</div>
</div>
<div class="pagination">
<?php
$cityParam = !empty($city) ? "&city=" . urlencode($city) : "";
?>
<?php if ($page > 1) : ?>
<a href="?page=<?php echo ($page - 1) . $cityParam; ?>">Previous</a>
<?php endif; ?>
<?php
// Check how many cars were actually retrieved on this page
$current_page_cars = $query->rowCount();
if ($current_page_cars == 6) : ?>
<a href="?page=<?php echo ($page + 1) . $cityParam; ?>">Next</a>
<?php endif; ?>
</div>
</section>
<!-- /Resent Cat -->
<!-- Fun Facts-->
<section class="fun-facts-section">
<div class="container div_zindex">
<div class="row">
<div class="col-lg-3 col-xs-6 col-sm-3">
<div class="fun-facts-m">
<div class="cell">
<h2><i class="fa fa-calendar" aria-hidden="true"></i>5+</h2>
<p>Years In Business</p>
</div>
</div>
</div>
<div class="col-lg-3 col-xs-6 col-sm-3">
<div class="fun-facts-m">
<div class="cell">
<h2><i class="fa fa-car" aria-hidden="true"></i>50+</h2>
<p>Cars For Rent</p>
</div>
</div>
</div>
<div class="col-lg-3 col-xs-6 col-sm-3">
<div class="fun-facts-m">
<div class="cell">
<h2><i class="fa fa-car" aria-hidden="true"></i>10+</h2>
<p>Luxury Cars For Rent</p>
</div>
</div>
</div>
<div class="col-lg-3 col-xs-6 col-sm-3">
<div class="fun-facts-m">
<div class="cell">
<h2><i class="fa fa-user-circle-o" aria-hidden="true"></i>100+</h2>
<p>Satisfied Customers</p>
</div>
</div>
</div>
</div>
</div>
<!-- Dark Overlay-->
<div class="dark-overlay"></div>
</section>
<!-- /Fun Facts-->
<!--Testimonial -->
<section class="section-padding testimonial-section parallex-bg">
<div class="container div_zindex">
<div class="section-header white-text text-center">
<h2>Our Satisfied <span>Customers</span></h2>
</div>
<div class="row">
<div id="testimonial-slider">
<?php
$tid = 1;
$sql = "SELECT tbltestimonial.Testimonial,tblusers.FullName from tbltestimonial join tblusers on tbltestimonial.UserEmail=tblusers.EmailId where tbltestimonial.status=:tid limit 4";
$query = $dbh->prepare($sql);
$query->bindParam(':tid', $tid, PDO::PARAM_STR);
$query->execute();
$results = $query->fetchAll(PDO::FETCH_OBJ);
$cnt = 1;
if ($query->rowCount() > 0) {
foreach ($results as $result) { ?>
<div class="testimonial-m">
<div class="testimonial-content">
<div class="testimonial-heading">
<h5><?php echo htmlentities($result->FullName); ?></h5>
<p><?php echo htmlentities($result->Testimonial); ?></p>
</div>
</div>
</div>
<?php }
} ?>
</div>
</div>
</div>
<!-- Dark Overlay-->
<div class="dark-overlay"></div>
</section>
<!-- /Testimonial-->
<!--Footer -->
<?php include('includes/footer.php'); ?>
<!-- /Footer-->
<!--Back to top-->
<div id="back-top" class="back-top"> <a href="#top"><i class="fa fa-angle-up" aria-hidden="true"></i> </a> </div>
<!--/Back to top-->
<!--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 -->
<!-- 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>
<!-- Mirrored from themes.webmasterdriver.net/carforyou/demo/index.html by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 16 Jun 2017 07:22:11 GMT -->
</html>