-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsearch.html
116 lines (102 loc) · 5.48 KB
/
search.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Agile Automotives - Home</title>
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<!-- Favicon -->
<link href="img/favicon.ico" rel="icon">
<!-- Google Web Fonts -->
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Oswald:wght@400;500;600;700&family=Rubik&display=swap" rel="stylesheet">
<!-- Font Awesome -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.0/css/all.min.css" rel="stylesheet">
<!-- Libraries Stylesheet -->
<link href="lib/owlcarousel/assets/owl.carousel.min.css" rel="stylesheet">
<link href="lib/tempusdominus/css/tempusdominus-bootstrap-4.min.css" rel="stylesheet" />
<!-- Customized Bootstrap Stylesheet -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Template Stylesheet -->
<link href="css/style.css" rel="stylesheet">
<!-- JS Session Dropdown -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script type="text/javascript">
window.onload = function() {
document.getElementById("DropDownCarType").value = JSON.parse(sessionStorage.carType);
document.getElementById("DropDownTag").value = JSON.parse(sessionStorage.carTag);
document.getElementById("DropDownPrice").value = JSON.parse(sessionStorage.carPrice);
document.querySelector('input[type="date"]').value = JSON.parse(sessionStorage.carDate);
}
function updateSearch()
{
sessionStorage.setItem("carType", JSON.stringify(document.getElementById("DropDownCarType").value));
sessionStorage.setItem("carTag", JSON.stringify(document.getElementById("DropDownTag").value));
sessionStorage.setItem("carPrice", JSON.stringify(document.getElementById("DropDownPrice").value));
sessionStorage.setItem("carDate", JSON.stringify(document.querySelector('input[type="date"]').value));
}
function clearSearch()
{
sessionStorage.removeItem("carType");
sessionStorage.removeItem("carTag");
sessionStorage.removeItem("carPrice");
sessionStorage.removeItem("carDate");
document.getElementById("DropDownCarType").value = "Car Type";
document.getElementById("DropDownTag").value = "Tags";
document.getElementById("DropDownPrice").value = "Price Range";
document.querySelector('input[type="date"]').value = "";
}
</script>
</head>
<body>
<section>
<!-- Search Start -->
<div class="cbg-white pt-1 px-lg-5" style="align-content: center;">
<div class="row mx-n2" style="align-content: center;">
<div class="col-xl-2 col-lg-4 col-md-5 px-2">
<select class="custom-select px-4 mb-3" style="height: 50px;" id="DropDownCarType" onchange="updateSearch()" >
<option selected>Car Type</option>
<option value="Truck">Truck</option>
<option value="SUV">SUV</option>
<option value="Hatchback">Hatchback</option>
<option value="Minivan">Minivan</option>
<option value="Convertible">Convertible</option>
<option value="Coupe">Coupe</option>
<option value="Sports Car">Sports Car</option>
</select>
</div>
<div class="col-xl-2 col-lg-4 col-md-6 px-2">
<select class="custom-select px-4 mb-3" style="height: 50px;" id="DropDownTag" onchange="updateSearch()">
<option selected>Tags</option>
<option value="0">High Occupancy Vehicle</option>
<option value="1">Low Occupancy Vehicle</option>
<option value="2">Large Trunk</option>
<option value="3">Luxury</option>
</select>
</div>
<div class="col-xl-2 col-lg-4 col-md-6 px-2">
<select class="custom-select px-4 mb-3" style="height: 50px;" id="DropDownPrice" onchange="updateSearch()">
<option selected>Price Range</option>
<option value="0">< $100</option>
<option value="100">$100 < $200</option>
<option value="200">$200 < $500</option>
<option value="500">$500 <</option>
</select>
</div>
<div class="col-xl-2 col-lg-4 col-md-6 px-2">
<div class="date mb-3" id="date" data-target-input="nearest" id="DropDownDate" onchange="updateSearch()">
<input type="date" class="form-control p-4 datetimepicker-input" placeholder="Availablity Date"
min="2022-01-01" max="2023-12-31"/>
</div>
</div>
<div class="col-xl-2 col-lg-4 col-md-6 px-2">
<button class="btn btn-primary btn-block mb-3" style="height: 50px; line-height: 35px; filter: grayscale(1);" onclick="clearSearch()" target="_top">Clear Search</button>
</div>
<div class="col-xl-2 col-lg-4 col-md-6 px-2">
<a class="btn btn-primary btn-block mb-3" style="height: 50px; line-height: 35px;" href="car.html" target="_top">Search</a>
</div>
</div>
</div>
<!-- Search End -->
</section>
</body>
</html>