-
Notifications
You must be signed in to change notification settings - Fork 0
/
booking.html
205 lines (175 loc) · 8.9 KB
/
booking.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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Booking - Steak and Sip - Steakhouse and Winery Restaurant</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Edu+SA+Beginner:wght@400;500;600;700&display=swap"
rel="stylesheet">
<link rel="stylesheet" href="style.css">
<script src="https://code.jquery.com/jquery-3.6.0.js"></script>
</head>
<body class="bookingBody">
<div id="" class="container">
<!-- <h2>Steak and Sip Booking</h2> -->
<form method="" action="" id="secondForm" class="confirm" >
<h3>CONFIRM SELECTION</h3>
<div class="select2 date2">
<img src="https://img.icons8.com/color/48/000000/calendar--v1.png"/>
<input type="date" min="2022-08-29" class="select2 date2" id="date2" name="date" required >
</div>
<select class="select2 time2" id="time2" name="time2" required>
<option value="11:00 A.M.">11:00 A.M.</option>
<option value="11:30 A.M.">11:30 A.M.</option>
<option value="12:00 P.M.">12:00 P.M.</option>
<option value="12:30 P.M.">12:30 P.M.</option>
<option value="01:00 P.M.">01:00 P.M.</option>
<option value="01:30 P.M.">01:30 P.M.</option>
<option value="02:00 P.M.">02:00 P.M.</option>
<option value="02:30 P.M.">02:30 P.M.</option>
<option value="03:00 P.M.">03:00 P.M.</option>
<option value="03:30 P.M.">03:30 P.M.</option>
<option value="04:00 P.M.">04:00 P.M.</option>
<option value="04:30 P.M.">04:30 P.M.</option>
<option value="05:00 P.M.">05:00 P.M.</option>
<option value="05:30 P.M.">05:30 P.M.</option>
<option value="06:00 P.M.">06:00 P.M.</option>
<option value="06:30 P.M.">06:30 P.M.</option>
<option value="07:00 P.M.">07:00 P.M.</option>
<option value="07:30 P.M.">07:30 P.M.</option>
<option value="08:00 P.M.">08:00 P.M.</option>
<option value="08:30 P.M.">08:30 P.M.</option>
<option value="09:00 P.M.">09:00 P.M.</option>
</select>
<select class="select2 guests2" id="guests2" name="guests2" required>
<option value="1 guest">1 guest</option>
<option value="2 guests">2 guests</option>
<option value="3 guests">3 guests</option>
<option value="4 guests">4 guests</option>
<option value="5 guests">5 guests</option>
<option value="6 guests">6 guests</option>
<option value="7 guests">7 guests</option>
<option value="8 guests">8 guests</option>
<option value="9 guests">9 guests</option>
<option value="10 guests">10 guests</option>
<option value="11 guests">11 guests</option>
<option value="12 guests">12 guests</option>
</select>
<div class="btn-box">
<button type="button" class="" id="next">NEXT</button>
</div>
</form>
<form action="" id="thirdForm" class="confirm">
<h3>Your Details</h3>
<input type="text" id="fName" class="select2" name="firstName" required placeholder="First Name*" autocomplete="off">
<input type="text" id="lName" class="select2" name="lastName" required placeholder="Last Name*" autocomplete="off">
<input type="tel" id="mobile" class="select2" name="phoneNumber" required placeholder="Phone Number*" autocomplete="off">
<input type="text" id="eMail" class="select2" name="email" required placeholder="E-mail Address*" autocomplete="off">
<select name="occasion" id="occasion" class="select2">
<option value="" disabled selected hidden>Select an Occasion (optional)</option>
<option value="none">None</option>
<option value="birthday">Birthday</option>
<option value="anniversary">Anniversary</option>
<option value="date">Date</option>
<option value="special occasion">Special Occasion</option>
<option value="business meal">Business Meal</option>
</select>
<input type="text" id="special" class="select2" name="request" placeholder="Special Requests (optional)" autocomplete="off">
<p>*We endeavour to meet all requests, regrettable some cannot be guaranteed.*</p>
<div class="btn-box">
<button type="button" class="" id="back">BACK</button>
<button type="submit" class="" id="confirmBtn">CONFIRM</button>
</div>
</form>
<div class="step-row">
<div id="progress"></div>
<div class="step-col"><small>1</small></div>
<div class="step-col"><small>2</small></div>
</div>
<!-- <button class="closePopup" onclick="closePopup()"></button> -->
</div>
<footer class="pageFooter">
<div class="footerContent">
<p>©2022, STEAK AND SIP</p>
<p>DINE-IN / TAKEOUT / DELIVERY</p>
<P>0 (542) 123-456 . 7890 AVENUE I NICOSIA</P>
</div>
</footer>
<!-- <script src="script.js"></script> -->
<script>
console.log('timevalues', localStorage.getItem('timevalue'));
document.getElementById('time2').value = localStorage.getItem('timevalue');
document.getElementById('guests2').value = localStorage.getItem('guests');
document.getElementById('date2').value = localStorage.getItem('datevalue');
var date = new Date();
var tdate = date.getDate();
var month = date.getMonth() + 1;
if(tdate < 10){
date = '0' + tdate;
}
if(month < 10){
month = '0' + month;
}
var year = date.getUTCFullYear();
var minDate = year + '-' + month + '-' + tdate;
document.getElementById('date2').setAttribute('min', minDate);
var form1 = document.getElementById('secondForm');
var form2 = document.getElementById('thirdForm');
var next = document.getElementById('next');
var back = document.getElementById('back');
var confirm = document.getElementById('confirmBtn');
var progress = document.getElementById('progress')
next.onclick = function(){
console.log('next');
form1.style.left = '-960px'
form2.style.left = '5%';
progress.style.width = '100%'
let date2 = document.getElementById('date2');
let time2 = document.getElementById('time2');
let guests2 = document.getElementById('guests2');
date2.addEventListener("change", stateHandle);
time2.addEventListener("change", stateHandle);
guests2.addEventListener("change", stateHandle);
//form validation
function stateHandle() {
if(date2.value === ""|| time2.value === ""|| guests2.value === "") {
next.disabled = true;
} else {
next.disabled = false;
}
}
}
back.onclick = function(){
console.log('back');
form1.style.left = '5%'
form2.style.left = '960px';
progress.style.width = '50%';
}
confirm.onclick = function(){
console.log('confirm');
let fName = querySelector('input[id="fName"]');
let lName = querySelector('input[id="lName"]');
let mobile = querySelector('input[id="mobile"]');
let eMail = querySelector('input[id="eMail"]');
confirm.disabled = true;
fName.addEventListener("change", stateHandle);
lName.addEventListener("change", stateHandle);
mobile.addEventListener("change", stateHandle);
eMail.addEventListener("change", stateHandle);
//form validation
function stateHandle() {
if(fName.value === ""|| lName.value === ""|| mobile.value === "" || eMail.value ==="") {
confirm.disabled = true;
} else {
confirm.disabled = false;
}
}
}
// window.onload( () => {
// });
</script>
</body>
</html>