-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcarReservations.php
More file actions
88 lines (82 loc) · 2.31 KB
/
carReservations.php
File metadata and controls
88 lines (82 loc) · 2.31 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
84
85
86
87
88
<!DOCTYPE html>
<html lang="en">
<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="carReservations.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();
?>
<script>
function validateForm(){
var from= document.getElementById("from").value;
var to= document.getElementById("to").value;
if(from <= to)
{
if(from==document.getElementById("from").defaultValue){
alert("You must enter a date");
return false;
}
else if(to==document.getElementById("to").defaultValue){
alert("You must enter a date");
return false;
}
}
else
{
alert("You entred a WRONG date");
return false;
}
}
</script>
<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>
<div class="specs">
<form id="period" name="period" action="carReservations2.php" method="post" onsubmit="return validateForm()">
<div>
<label class="sort">Date From:</label><br>
<input type="date" class="form-control" name="from" id="from"/>
</div>
<div>
<br>
<label class="sort">To Date:</label><br>
<input type="date" class="form-control" name="to" id="to"/>
</div>
<div>
<br>
<label class="sort">Plate ID:</label>
<input type="text" required name="plate_id"/>
</div>
<div>
<button class="btn" name="plate" type="submit"> Confirm </button>
</div>
</form>
</div>
<footer>
<p><a href="">Contact us</a></p>
</footer>
</body>
<?php
if(isset($_POST['period']))
{
$from = $_POST['from'];
$to = $_POST['to'];
$plate = $_POST['plate_id'];
}
?>
</html>