-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathcus_index.php
314 lines (247 loc) · 6.96 KB
/
cus_index.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
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
<?php
//this is the session check for this page
session_start();
if(!isset($_SESSION['logged_in'])||(isset($_SESSION['logged_in'])&&$_SESSION['usertype']==="dealer")) //user not logged in or user logged in is a dealer
{
header('location:index.php');
}
include("dbconnect.php");
$cusid = $_SESSION['userid']; //getting the customer id
$cusname = $_SESSION['username'];
?>
<!DOCTYPE html>
<html>
<head>
<title><?php echo $cusname."'s " ?> Dashboard - Rustom</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="UTF-8">
<link rel="icon" href="icon.ico">
<!--Google Fonts-->
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@300&display=swap" rel="stylesheet">
<!--BOOTSTRAP CDN-->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
</head>
<style>
.searchbox
{
display:block;
width:80%;
margin-top:50px;
/*height:0;*/
transform: scaleY(0);
transform-origin: top;
transition:transform 0.15s linear;
}
.card{
margin-bottom:10px;
margin-top:15px;
}
.card-img-top
{
min-height:250px;
max-height:250px;
object-fit:cover;
}
#listicon
{
position:absolute;
left:20px;
margin-top:1px;
cursor:pointer;
}
#title
{
font-family: 'Open Sans', sans-serif;
margin:auto;
margin-bottom:0.5px;
text-align:center;
font-weight:300;
font-size:1.5rem;
}
#header #logout
{
position:absolute;
right:20px;
cursor:pointer;
}
#list
{
position:fixed;
top:0;
height:100%;
z-index:20;
left:0;
background-color:#C39BD3;
width:0;
overflow:hidden;
display:flex;
flex-direction:column;
align-items:center;
justify-content:center;
transition:width 0.15s ease-in-out;
}
#list a
{
font-weight:350;
text-align:center;
color:white;
font-size:1.5rem;
margin:5px 0;
transition:color 0.15s ease-in-out;
}
#list #active
{
cursor:default;
color:#76448A;
}
#list a:hover
{
color:#76448A;
text-decoration:none;
}
#list #closelist
{
cursor:pointer;
background-color:#76448A;
width:fit-content;
position:absolute;
top:10px;
padding:5px;
display:flex;
align-items:center;
right:10px;
}
.row
{
align-items:flex-start;
}
li
{
text-align:left;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
margin-bottom:1px;
max-width:100%;
}
#discountbox
{
position:absolute;
top:0;
right:0;
/*background-color:#76448A;*/
background-color:yellow;
padding:10px;
color:black;
font-weight:300;
}
.card-subtitle
{
color:#884EA0;
}
@media screen and (max-width:1000px)
{
#carname
{
font-size:40px;
}
}
@media screen and (max-width:1200px)
{
.row
{
flex-direction:row;
min-width:80%;
}
.col-sm-3
{
min-width:50%;
}
}
@media screen and (max-width:769px)
{
.row
{
justify-content:center;
}
.col-sm-3
{
min-width:80%;
}
#explore
{
text-align:center;
padding:20px 0;
border-bottom:1px solid #C39BD3;
}
}
</style>
<body onload="getcardetails(<?php echo $cusid ?>)">
<div id="list">
<div id="closelist" onclick="openlist()">
<svg class="bi bi-chevron-left" width="1.5em" height="1.5em" viewBox="0 0 16 16" fill="white" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" d="M11.354 1.646a.5.5 0 010 .708L5.707 8l5.647 5.646a.5.5 0 01-.708.708l-6-6a.5.5 0 010-.708l6-6a.5.5 0 01.708 0z" clip-rule="evenodd"/>
</svg>
</div>
<a id="active">Home</a>
<a href="cus_profile.php">Profile</a>
<a href="cus_purchased.php">My Purchases</a>
<a href="cus_rented.php">Rented cars</a>
</div>
<div class="container-fluid text-white py-3" id="header" style="background-color:black;position:fixed;z-index:5;top:0;display:flex;align-items:center">
<div id="listicon" onclick="openlist()">
<svg class="bi bi-list" width="2em" height="2em" viewBox="0 0 16 16" fill="white" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" d="M2.5 11.5A.5.5 0 013 11h10a.5.5 0 010 1H3a.5.5 0 01-.5-.5zm0-4A.5.5 0 013 7h10a.5.5 0 010 1H3a.5.5 0 01-.5-.5zm0-4A.5.5 0 013 3h10a.5.5 0 010 1H3a.5.5 0 01-.5-.5z" clip-rule="evenodd"/>
</svg>
</div>
<a id="logout" href="logout.php">
<svg class="bi bi-x-square" width="1.5em" height="1.5em" viewBox="0 0 16 16" fill="white" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" d="M14 1H2a1 1 0 00-1 1v12a1 1 0 001 1h12a1 1 0 001-1V2a1 1 0 00-1-1zM2 0a2 2 0 00-2 2v12a2 2 0 002 2h12a2 2 0 002-2V2a2 2 0 00-2-2H2z" clip-rule="evenodd"/>
<path fill-rule="evenodd" d="M11.854 4.146a.5.5 0 010 .708l-7 7a.5.5 0 01-.708-.708l7-7a.5.5 0 01.708 0z" clip-rule="evenodd"/>
<path fill-rule="evenodd" d="M4.146 4.146a.5.5 0 000 .708l7 7a.5.5 0 00.708-.708l-7-7a.5.5 0 00-.708 0z" clip-rule="evenodd"/>
</svg>
</a>
<!--<h3 id="title">Rustom</h3>-->
<img src="logow.png" height="50px" style="margin:auto">
</div>
<div class="container" style="width:80%;margin:auto;margin-top:135px">
<h2 id="carname" class="display-4 text-center"><?php echo "Welcome ".$cusname."!" ?></h2>
</div>
<div class="input-group mb-3" style="width:80%;margin:auto;margin-top:65px">
<span class="input-group-text" id="basic-addon1" style="position:relative;margin-right:0;background-color:#C39BD3;border:none;border-radius:0">
<svg class="bi bi-search" width="1em" height="1em" viewBox="0 0 16 16" fill="white" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" d="M10.442 10.442a1 1 0 011.415 0l3.85 3.85a1 1 0 01-1.414 1.415l-3.85-3.85a1 1 0 010-1.415z" clip-rule="evenodd"/>
<path fill-rule="evenodd" d="M6.5 12a5.5 5.5 0 100-11 5.5 5.5 0 000 11zM13 6.5a6.5 6.5 0 11-13 0 6.5 6.5 0 0113 0z" clip-rule="evenodd"/>
</svg>
</span>
<input type="text" id="query" class="form-control shadow-none" placeholder="Search for cars, manufacturers and car types..." onkeyup="searchcars()" onclick="searchcars()" style="border-color:#C39BD3;border-radius:0;border-left:none">
</div>
<div class="searchbox container-fluid py-3">
</div>
</div>
<div class="container-fluid py-3" style="width:80%">
<?php if(isset($_SESSION['boughtnewcar'])&&$_SESSION['boughtnewcar']===true)
{
?>
<div class="alert alert-primary" role="alert">
Hooray! You just bought a new car! Go to <a href="cus_purchased.php">My Purchases</a>!
</div>
<?php
unset($_SESSION['boughtnewcar']);
} ?>
<?php if(isset($_SESSION['rentedcar'])&&$_SESSION['rentedcar']===true)
{
?>
<div class="alert alert-primary" role="alert">
Hooray! You just rented a new car! Go to <a href="cus_rented.php">My Rents</a>!
</div>
<?php
unset($_SESSION['rentedcar']);
} ?>
<h3 id="explore" style="font-weight:lighter">Explore</h3>
<div class="row">
</div>
</body>
<script type="text/javascript" src="JS/home.js"></script>
<script type="text/javascript" src="JS/list.js"></script>
</html>