-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcarReservations2.php
More file actions
83 lines (72 loc) · 2.37 KB
/
Copy pathcarReservations2.php
File metadata and controls
83 lines (72 loc) · 2.37 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
<!DOCTYPE html>
<html lang="en">
<?php
$from = $_POST['from'];
$to = $_POST['to'];
$plate_id = $_POST['plate_id'];
?>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css">
<link href="carReservations2.css" rel="stylesheet">
<link rel="icon" href="https://cdn-icons-png.flaticon.com/512/809/809998.png" type="image/x-icon">
<title>Car Rental - Car Reservations</title>
<script src="https://kit.fontawesome.com/77fd9664d1.js" crossorigin="anonymous"></script>
</head>
<?php
include_once 'C:\xampp\htdocs\CarRentalSystem\once.php';
session_start();
?>
<body>
<nav class ="navbar">
<div class="logo"><a href="welcome admin.php">Car Rental <i class="fas fa-car"></i></a></div>
<ul class="menu">
<li><a href="welcome admin.php">Home</a></li>
<ul class="dropdown">
<li><a href="index.php">Log out</a></li>
</ul>
<li><a href="">About us</a></li>
</ul>
</nav>
<h1> Car Reservations </h1>
<table>
<tr>
<th>Reservation ID</th>
<th>Start Date</th>
<th>End Date</th>
<th>Entry Date</th>
<th>Action</th>
<th>Plate ID</th>
<th>Brand</th>
<th>Model</th>
<th>Color</th>
<th>Price/Day</th>
<th>Office ID</th>
<th>Year</th>
</tr>
<?php
$sql = "SELECT * FROM reservation
JOIN car ON reservation.Plate_id = car.Plate_id
WHERE (reservation.Start_date <= '$from' AND reservation.End_date >= '$from'
OR reservation.Start_date <= '$to' AND reservation.End_date >= '$to'
OR reservation.Start_date >= '$from' AND reservation.End_date <= '$to'
OR reservation.Start_date <= '$from' AND reservation.End_date >= '$to')
AND car.Plate_id = '$plate_id'
";
$result = $connect->query($sql);
if ($result->num_rows > 0)
{
while($row = $result->fetch_assoc())
{
echo "<tr><td>" . $row["Reservation_id"]. "</td><td>" . $row["Start_date"] . "</td><td>" . $row["End_date"] . "</td><td>" . $row["Entry_date"] . "</td><td>"
. $row["Action"] . "</td><td>" . $row["Plate_id"] . "</td><td>" . $row["Brand"] . "</td><td>" . $row["Model"] . "</td><td>" . $row["Color"] . "</td><td>"
. $row["Price_per_day"] . "</td><td>" . $row["Office_id"] . "</td><td>" . $row["Year"] . "</td><td>" . "</td><td>";
}
}
?>
</table>
<footer>
<p><a href="">Contact us</a></p>
</footer>
</body>
</html>