-
Notifications
You must be signed in to change notification settings - Fork 0
/
Renting.php
220 lines (211 loc) · 12.3 KB
/
Renting.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
<?php
session_start();
if (!isset($_SESSION["customer_id"]))
header("location:homepage.html");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Renting Page</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">-->
<!-- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>-->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/bootstrap-table.min.css">
<script src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js"
integrity="sha384-Atwg2Pkwv9vp0ygtn1JAojH0nYbwNJLPhwyoVbhoPwBhjQPR5VtM2+xf0Uwh9KtT"
crossorigin="anonymous"></script>
<script src="https://unpkg.com/[email protected]/dist/bootstrap-table.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist/themes/bootstrap-table/bootstrap-table.min.js"></script>
<!--Fontawesome CDN-->
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css"
integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous">
<!--Custom styles-->
<link rel="stylesheet" type="text/css" href="styles.css">
<script src="Renting.js"></script>
</head>
<body>
<div class="container">
<div class="d-flex justify-content-center h-100">
<div class="card" style="width: 60rem;height: 42rem;">
<!-- Header -->
<div class="card-header">
<h3>Rent your car</h3>
</div>
<div class="card-body">
<form id="filter-form" action="filter.php" method="POST">
<div id="Dropdown-group" class="form-group">
<div class="row">
<!--Filters Col-->
<div class="col-sm-4">
<div class="card-header">
<h3>Filter by</h3>
</div>
<!-- Model Dropdown Box -->
<div class="form-group">
<select class="custom-select mr-sm-2"
id="model-filter"
style="width: 18rem;">
<option selected value="">(Model)</option>
<?php
$connection = mysqli_connect('localhost', 'root', '', 'car_rental_system');
$sql = "SELECT distinct c.model model FROM `car` c ";
$query = mysqli_query($connection, $sql);
while ($row = mysqli_fetch_assoc($query)) {
echo "<option> $row[model] </option>";
}
mysqli_close($connection);
?>
</select>
</div>
<!-- Year Dropdown Box -->
<div class="form-group">
<select class="custom-select mr-sm-2"
id="year-filter"
style="width: 18rem;">
<option selected value="">(Year)</option>
<?php
$connection = mysqli_connect('localhost', 'root', '', 'car_rental_system');
$sql = "SELECT distinct c.year `year` FROM `car` c ";
$query = mysqli_query($connection, $sql);
while ($row = mysqli_fetch_assoc($query)) {
echo "<option> $row[year] </option>";
}
mysqli_close($connection);
?>
</select>
</div>
<!-- Color Dropdown Box -->
<div class="form-group">
<select class="custom-select mr-sm-2"
id="color-filter"
style="width: 18rem;">
<option selected value="">(Color)</option>
<?php
$connection = mysqli_connect('localhost', 'root', '', 'car_rental_system');
$sql = "SELECT distinct c.color `color` FROM `car` c ";
$query = mysqli_query($connection, $sql);
while ($row = mysqli_fetch_assoc($query)) {
echo "<option> $row[color] </option>";
}
mysqli_close($connection);
?>
</select>
</div>
<!-- Country Dropdown Box -->
<div class="form-group">
<select class="custom-select mr-sm-2"
id="country-filter"
style="width: 18rem;">
<option selected value="">(Country)</option>
<?php
$connection = mysqli_connect('localhost', 'root', '', 'car_rental_system');
$sql = "SELECT distinct o.country `country` FROM `car` c NATURAL JOIN office o";
$query = mysqli_query($connection, $sql);
while ($row = mysqli_fetch_assoc($query)) {
echo "<option> $row[country] </option>";
}
mysqli_close($connection);
?>
</select>
</div>
<!-- Price Range-->
<div class="mt-2 row">
<!-- Min Price-->
<div class="col">
<div class="input-group form-group">
<input id="MinPrice" type="text" class="form-control input-sm"
placeholder="Min Price">
</div>
</div>
<!--Max Price-->
<div class="col">
<div class="input-group form-group">
<input id="MaxPrice" type="text" class="form-control"
placeholder="Max Price">
</div>
</div>
</div>
<!-- Reservation Period-->
<div class="row">
<div class="mt-2 remember">
<label for="ReservationDate" style="font-size: 17px">
Reservation Date:</label>
</div>
<!-- Start Date-->
<div class="col">
<div class="input-group form-group" style="width: 8rem;">
<input
id="StartDate"
type="text"
class="form-control input-sm"
placeholder="Start date">
</div>
</div>
<!--End Date-->
<div class="col">
<div class="input-group form-group" style="width: 8rem;">
<input id="EndDate"
type="text"
class="form-control"
placeholder="End date">
</div>
</div>
</div>
<div class="input-group form-group">
<input id="plate-id" type="text" class="form-control input-sm"
placeholder="Plate ID">
</div>
<div class="mt-2 form-group">
<input type="submit" value="Filter" class="btn float-right login_btn">
</div>
</div>
<!-- Results Col -->
<div class="col">
<div class="card text-white bg-primary mb-3"
style="width: 37rem;height: 30rem;overflow: auto;">
<div class="card-body text-white">
<div class="container-fluid">
<table
data-click-to-select="true"
data-search="true"
id="infoTable"
class="text-white table table-fixed table-condensed">
<thead>
<tr>
<th class="col-xs-3">car ID</th>
<th class="col-xs-3">Model</th>
<th class="col-xs-6">Year</th>
<th class="col-xs-6">Color</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</form>
<form id="continue-form" action="startReservationSession.php" method="POST">
<div class="mt-2 form-group">
<input
type="submit"
id="continue-btn"
value="Continue"
class="btn pull-right login_btn">
</div>
</form>
</div>
<div class="card-footer">
<div class="d-flex justify-content-left links">
<a href="homepage.html">Sign Out</a>
</div>
</div>
</div>
</div>
</div>
</body>
</html>