-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcardetails.php
216 lines (185 loc) · 5.45 KB
/
cardetails.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
<!DOCTYPE html>
<html>
<head>
<style>
* {
background: dimgray;
}
a {
text-decoration: none;
}
.row {
display: flex;
flex-wrap: wrap;
/* justify-content: center; */
}
.column {
flex: 0 1 calc(25% - 20px); /* Adjust the width for 4 columns */
max-width: calc(25% - 20px); /* Adjust the width for 4 columns */
padding: 10px;
}
.box {
background-color: rgb(255, 255, 255);
border-radius: 20px;
padding: 10px;
/* margin: 10px; */
margin-bottom: 50px;
}
.box:hover {
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
transform: scale(0.55);
}
.box img {
position: center;
width: 320px;
height: 150px;
object-fit: cover;
border-radius: 10px;
margin-bottom: 10px;
}
.box p img {
position: center;
width: 50px;
height: 100px;
object-fit: cover;
}
.column p {
text-align: right;
font-size: 16px;
color: black;
margin: 5px 10px 5px 10px;
/* border-color: white; */
}
.box p {
display: block;
background-color: rgb(255, 255, 255);
}
.box p img {
width: 5%;
height: 5%;
}
.box span img {
width: 5%;
height: 5%;
}
#seat,
#speedo {
display: flex;
align-items: center;
background: white;
}
#seat img{
width: 30px;
height: 30px;
margin-right: 10px;
margin-left: 20px;
background: white;
}
#speedo img {
width: 40px;
height: 40px;
margin-right: 10px;
margin-left: 20px;
background: white;
}
#seat p,
#speedo p {
margin: 0;
width: 225px
}
#carname {
background: white;
}
#carname p {
text-align: center;
/* background: white; */
/* background-color: white; */
}
#button1 {
margin-left: 40px;
}
button {
width: 100px;
height: 40px;
font-size: 20px;
background-color : cadetblue;
}
button:hover {
/* box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5); */
transform: scale(0.55);
background-color: rgba(128, 128, 128, 0.527);
border: none;
}
h2 {
margin: 0;
/* Remove default margin */
}
.de {
list-style :none;
}
.de ul li {
display: block;
/* margin-right: 20px; */
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
$(document).ready(function () {
$('.box ,button').mouseenter(function () {
$(this).css('transform', 'scale(1.05)');
}).mouseleave(function () {
$(this).css('transform', 'scale(1)');
});
});
</script>
</head>
<body>
<center>
<h2>AVAILABLE CARS</h2>
</center>
<div id="button1"><button onclick="window.location.href='cuspage.php'">Home</button></div>
<div class="row">
<?php
require_once('connection.php');
session_start();
$username = $_SESSION['username'];
$passw = $_SESSION['password'];
$_SESSION['password'] = $passw;
$_SESSION['username'] = $username;
$sql="select * from users where FNAME = '$username' and PASSWORD = '$passw'";
$name = mysqli_query($conn,$sql);
$rows=mysqli_fetch_assoc($name);
$sql2="select *from cars where AVAILABLE='Y'";
$cars= mysqli_query($conn,$sql2);
?>
<?php
while($result= mysqli_fetch_array($cars))
{
$car_id = $result['CAR_ID']; // Get the car ID
?>
<div class="column">
<a href="booking.php?id=<?php echo $car_id ?>"> <!-- Add car ID to the URL -->
<div class="box">
<img src="<?php echo $result['CAR_IMG']?>" alt="Bugati Car">
<div id="carname">
<p><?php echo $result['CAR_NAME']?></p>
</div>
<div id="seat">
<img src="seat.jpg">
<p><?php echo $result['CAPACITY']?></p>
</div>
<div id="speedo">
<img src="flogo.png">
<p><?php echo $result['FUEL_TYPE']?></p>
</div>
<p>Per Day :₹<?php echo $result['PRICE']?>/-</p>
<center><a href="booking.php?id=<?php echo $car_id ?>" style="font-size: 15px; background-color: green; display: inline-block; padding: 10px 20px; color: white; text-decoration: none;">BOOK NOW</a></center>
</div>
</a>
</div>
<?php
}
?>
</div>
</body>
</html>