-
Notifications
You must be signed in to change notification settings - Fork 1
/
car_type.php
105 lines (70 loc) · 3.92 KB
/
car_type.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>D P Car Rentals | Cars</title>
<link rel="shortcut icon" sizes="144x144" href="images/favicon.png">
<!-- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous"> -->
<link rel="stylesheet" href="admin/assets/css/bootstrap.min.css">
<link rel="stylesheet" href="css/cars.css">
</head>
<body>
<?php include('menubar.inc.php');
$type_id = $_GET["car_type"];
?>
<!-- Available Cars Section Starts Here -->
<section class="latest-cars">
<div class="container1">
<h2 class="text-center"><?php echo $type_id ?></h2>
<div id="sec2">
<br>
<section class="menu-content">
<?php
$sql="select *from cars where status=1";
$res=mysqli_query($conn,$sql);
$count=mysqli_num_rows($res);
if($count>0)
{
// Cars Available
while($row1 = mysqli_fetch_assoc($res)){
if($type_id==$row1['type_id']){
$car_id = $row1["id"];
$car_name = $row1["car_name"];
$car_brand = $row1["brand_id"];
$car_type = $row1["type_id"];
$ac_price = $row1["ac_price"];
$ac_price_per_day = $row1["ac_price_per_day"];
$non_ac_price = $row1["non_ac_price"];
$non_ac_price_per_day = $row1["non_ac_price_per_day"];
$image = $row1["image"];
$sql2="select count(car_name) as count from cars where status=1 and car_name='$car_name'";
$result2= mysqli_query($conn,$sql2);
while($row2=mysqli_fetch_assoc($result2)){
$count=$row2['count'];}
?>
<a class="car-details" href="bookings.php?id=<?php echo $car_id ?>">
<div class="sub-menu">
<img class="card-img-top" src="<?php echo CAR_IMAGE_SITE_PATH.$image?>" alt="Card image cap">
<h5 class="car-details"> <?php echo $car_name; ?> </h5>
<h6><?php echo $car_brand; ?></h6>
<h6> Car Type: <?php echo $car_type; ?></h6>
<h6> AC Fare: <?php echo ("₹" . $ac_price . "/km & ₹" . $ac_price_per_day . "/day"); ?></h6>
<h6> Non-AC Fare: <?php echo ("₹" . $non_ac_price . "/km & ₹" . $non_ac_price_per_day . "/day"); ?></h6>
<h6>No. of <?php echo $car_name ?> car available: <?php echo $count; ?></h6>
</div>
</a>
<?php }
}}
else
{?>
<h1> Data Not Found :( </h1>
<?php }
?>
</section>
</div>
<div class="clearfix"></div>
</div>
</section>
<!-- Available Cars Section Ends Here -->
<?php include('footer.inc.php'); ?>