forked from mrsaurabhmaske/huge-coast-1878
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hotelbooking.html
555 lines (476 loc) · 16 KB
/
hotelbooking.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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
<!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>Hotel_booking_Page</title>
<style>
#title{
/* background-color: rgb(4, 4, 82); */
background-image: linear-gradient( #8a5ff7,#6b32fa);
color: white;
/* background-color: rgb(91, 46, 196); */
height: 50px;
box-shadow: -9px 10px 36px -12px rgba(0,0,0,0.1);
padding: 10px;
padding-left: 30px;
height: 130px;
}
body{
margin: 0px;
font-family: 'monserrat', sans-serif;
background-color:rgb(178, 161, 255);
color: rgb(0, 0, 0);
}
#hoteldetails{
width: 66%;
margin-right: 20px;
margin-left: 20px;
border-radius: 8px;
padding:40px;
box-sizing:content-box;
margin-top: 20px;
box-shadow: -4px 0px 8px 4px rgba(0,0,0,0.1);
background-color: white;
}
#bookingDetails{
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 1px solid grey;
border-top: 1px solid grey;
}
#time{
display:inline;
margin-left: -60px;
}
#time img{
width: 90px;
margin-top: -40px;
margin-left: -20px;
}
#hotelname{
margin-bottom: 10px;
padding-bottom: 30px;
display: flex;
justify-content: space-between;
}
#hotelname :nth-child(1){
box-sizing: border-box;
}
#rating-container{
color: #6b32fa;
font-size: 25px;
}
#hotelname img{
width: 300px;
margin-right: 30px;
border-radius: 5px;
box-shadow: -4px 0px 8px 4px rgba(0,0,0,0.1);
}
#amenities{
display: grid;
grid-template-columns: repeat(3,1fr);
padding: 20px;
border-radius: 5px;
border:1px solid rgb(54, 29, 112);
box-shadow: -9px 10px 36px -12px grey;
margin-bottom: 40px;
margin-top: 20px;
background-color: #6b32fa;
color: white;
}
#rules{
background-color:rgb(178, 161, 255) ;
width: 100%;
margin-left: 0px;;
padding-left: 0px;
border: dashed red 1px;
margin-top: 10px;
padding-top: 20px;
padding-bottom: 10px;
}
#info{
font-size: 22px;
color: rgb(185, 14, 14);
font-weight: 900;
}
#container{
display: flex;
margin-top: -70px;
}
#paybreak{
border-radius: 5px;
box-sizing:content-box;
margin-top: 20px;
box-shadow: -4px 0px 8px 4px rgba(0,0,0,0.1);
background-color: white;
}
#paydetails{
width: 25%;
}
#prices{
display: flex;
justify-content: space-between;
margin-top: 20px;;
margin-bottom: 10px ;
border-bottom: 1px solid rgb(45, 21, 100);
align-items: center;
}
#tax{
display: flex;
justify-content: space-between;
border-bottom: 1px solid rgb(45, 21, 100);
margin-bottom: 20px;
}
#break{
padding: 20px;
margin-bottom: 30px;
}
#total{
display: flex;
justify-content: space-between;
padding: 20px;
background-color: #6b32fa;
border-radius: 0px 0px 5px 5px;
color: white;
font-size: 20px;
}
#date{
color: white;
}
#paycontainer{
padding: 20px;
border-radius: 5px;
font-size: 25px;
box-sizing:content-box;
margin-top: 20px;
box-shadow: -4px 0px 8px 4px rgba(0,0,0,0.1);
padding:12px;
background: #6b32fa;
color:#fff;
margin-top: 20px;
cursor: pointer;
height: 30px;
}
#paycontainer:hover{
background: rgb(45, 21, 100);
box-shadow: 1px 0px 13px 5px rgb(39, 23, 117);
}
.coupon{
border: 3px dotted grey;
padding: 10px;
margin-top: 5px;
}
.coupon h3{
display: inline;
}
.coupon p{
margin-top: 0px;
}
.coupon input{
font-size: 25px;
}
.date{
opacity: 100%;
position: static;
margin-right: 100px;
width: 35px;
outline: none;
border: none;
/* font-size: px; */
margin-left: 2px;
}
input[type="date"]{
background-color: #43206b;
padding: 3px;
position: absolute;
/* transform: translate(-50%,-50%);
top: 50%;
left: 50%;
font-family: "Roboto Mono",monospace;
color: #ffffff;
font-size: 18px;
border: none;
outline: none;*/
border-radius: 5px;
}
::-webkit-calendar-picker-indicator{
background-color: #d0c3d8;
padding: 5px;
cursor: pointer;
border-radius: 3px;
font-size: 25px;
}
:root {
--form-control-color: rebeccapurple;
}
*,
*:before,
*:after {
box-sizing: border-box;
}
body {
margin: 0;
}
form {
display: grid;
place-content: center;
min-height: 100vh;
}
.form-control {
font-family: system-ui, sans-serif;
font-size: 2rem;
font-weight: bold;
line-height: 1.1;
display: grid;
grid-template-columns: 1em auto;
gap: 0.5em;
}
.form-control + .form-control {
margin-top: 1em;
}
.form-control:focus-within {
color: var(--form-control-color);
}
</style>
</head>
<body>
<div id="title"><h1>Review your Booking</h1></div>
<div id="container">
<div id="hoteldetails">
<!-- append all hotel details here -->
<div id="hotelname">
<div>
<h1 id="hotelnaam">Ginger Goa</h1>
<h3 id="hotellocation">Panjin</h3>
<div id="rating-container"> <span id="grey-stars"></span></div>
<h4 id="description">Revel in the living heritage, Ambika Vilas, and live the authentic Kerela life in the calm courtyards and cool verandas.</h4>
</div>
<div>
<img id="hotelimage" src="https://r2imghtlak.mmtcdn.com/r2-mmt-htl-image/htl-imgs/202209151632557883-13ebf9e8461611edb4890a58a9feac02.jpg?&output-quality=75&downsize=583:388&output-format=jpg" alt="">
</div>
</div>
<div id="bookingDetails">
<div id="checkin">
<p>CHECK IN</p>
<h2> <span id="ckindate">9</span> <span id="ckinmonth">May</span> <span id="ckinyear">2023</span><input id="checkinINP" class="date" type="datetime-local"></h2>
<p id="ckintime">8 PM</p>
</div>
<div id="time"><h3><span id="night">1</span> Night</h3></div>
<div id="checkout">
<p>CHECKOUT</p>
<h2>
<span id="ckoutdate">10</span> <span id="ckoutmonth">May</span> <span id="ckoutyear">2023</span> <input id="checkoutINP" class="date" type="datetime-local">
</h2>
<p id="ckouttime"> 12 PM</p>
</div>
</div>
<div id="amenities"></div>
<div id="rules">
<ul> <span id="info">Importan information</span>
<li>Passport, Aadhaar, Driving Licsense and Govt. ID are accepted as ID proof(s)</li>
<li>Pets are not allowed</li>
<li>Smoking within the premises is not allowed</li>
<li>Allows private parties or events</li>
</ul>
</div>
</div>
<div id="paydetails">
<div id="paybreak">
<div id="break">
<h2>Price Breakup</h2>
<!-- <div id="prices">
<p>Base Price</p>
</div>
<div>
1399
</div>
</div> -->
<div id="tax">
<div>Base Price</div>
<div>Rs <span id="base_price">1399</span></div>
</div>
<div id="tax">
<div>Nights</div>
<div><span id="nightbill">1</span></div>
</div>
<div id="tax">
<div>Hotel Taxes</div>
<div>499</div>
</div>
</div>
<div id="total">
<div>Total amount to be paid</div>
<div id="total_amount">4000</div>
</div>
</div>
<div id="paycontainer" style="text-align:center">
<!-- <h2>Coupen Codes</h2>
<div class="coupon">
<input type="radio"> <h3>FLAT25</h3>
<p>Get 25% off on hotel booking upto 500</p>
</div>
<div class="coupon">
<input type="radio"> <h3>FLAT25</h3>
<p>Get 25% off on hotel booking upto 500</p>
</div>
<div class="coupon">
<input type="radio"> <h3>FLAT25</h3>
<p>Get 25% off on hotel booking upto 500</p>
</div>
<div class="coupon">
<input type="radio"> <h3>FLAT25</h3>
<p>Get 25% off on hotel booking upto 500</p> -->
Proceed to Payment
</div>
</div>
</div>
</div>
</body>
<script>
let hotelLSD=JSON.parse(localStorage.getItem("hotel"));
let hotelLS = hotelLSD[0];
let amenity=[
"Free Wi-Fi",
"24-hour room service",
"Restaurant",
"Bar/Lounge",
"Swimming pool",
"Fitness center",
"Spa",
"Business center",
"Conference room"
]
let hotelname=document.getElementById("hotelnaam")
let hotellocation=document.getElementById("hotellocation");
let description=document.getElementById("description")
let hotelimage=document.getElementById("hotelimage")
let checkinINP=document.getElementById("checkinINP")
let ckindate=document.getElementById("ckindate");
let ckinmonth=document.getElementById("ckinmonth");
let ckinyear=document.getElementById("ckinyear")
let ckintime=document.getElementById("ckintime")
let night=document.getElementById("night")
let nightbill=document.getElementById("nightbill")
let baseprice=document.getElementById("base_price")
let total_amount=document.getElementById("total_amount")
console.log(ckintime.textContent)
checkinINP.addEventListener("change",()=>{
let splitT=checkinINP.value.split("T");
let splitdate=splitT[0].split("-");
ckindate.textContent=splitdate[2];
ckinmonth.textContent=convertmonth(splitdate[1]);
ckinyear.textContent=splitdate[0]
let split_time=splitT[1].split(":");
//ckintime.textContent=split_time[0]
if(Number(split_time[0])<=12){
ckintime.textContent=`${Number(split_time[0])} AM`
}else{
ckintime.textContent=`${Number(split_time[0])-12} PM`
}
})
let checkoutINP=document.getElementById("checkoutINP")
let ckoutdate=document.getElementById("ckoutdate");
let ckoutmonth=document.getElementById("ckoutmonth");
let ckoutyear=document.getElementById("ckoutyear")
let ckouttime=document.getElementById("ckouttime")
console.log(ckouttime.textContent)
checkoutINP.addEventListener("change",()=>{
let splitT=checkoutINP.value.split("T");
let splitdate=splitT[0].split("-");
ckoutdate.textContent=splitdate[2];
ckoutmonth.textContent=convertmonth(splitdate[1]);
ckoutyear.textContent=splitdate[0]
let split_time=splitT[1].split(":");
//ckouttime.textContent=split_time[0]
if(Number(split_time[0])<=12){
ckouttime.textContent=`${Number(split_time[0])} AM`
}else{
ckouttime.textContent=`${Number(split_time[0])-12} PM`
}
let total_nights=Number(ckoutdate.textContent)-Number(ckindate.textContent);
night.textContent=total_nights
nightbill.textContent=total_nights
total_amount.textContent=(nightbill.textContent*baseprice.textContent)+499
})
hotelname.textContent=hotelLS.name
hotellocation.textContent=hotelLS.location;
description.textContent=hotelLS.description
hotelimage.setAttribute("src", hotelLS.image)
baseprice.textContent=hotelLS.price
total_amount.textContent=`Rs ${(nightbill.textContent*baseprice.textContent)+499}`;
const rating = hotelLS.rating;
const stars = fillStars(rating); // assuming you have already defined the fillStars function
const ratingContainer = document.getElementById('rating-container');
ratingContainer.innerHTML = stars;
function fillStars(num) {
// round the input number to the nearest 0.5
num = Math.round(num * 2) / 2;
// create an empty string to hold the stars
let stars = '';
// loop through each whole star (left of the decimal point)
for (let i = 0; i < Math.floor(num); i++) {
stars += '★';
}
// if there's a half star (after the decimal point), add a half-filled star
if (num % 1 !== 0) {
stars += '';
}
// return the string of stars
return stars;
}
let amenities=document.getElementById("amenities");
amenity.forEach((ele)=> {
let amendiv=document.createElement("div");
amendiv.textContent=ele
amenities.append(amendiv)
});
// let paynow=document.getElementById("paynow");
// paynow.addEventListener("click",()=>{
// })
function convertmonth(num){
if(num==01){
return "Jan"
}
if(num==02){
return "Feb"
}
if(num==03){
return "Mar"
}
if(num==04){
return "Apr"
}
if(num==05){
return "May"
}
if(num==06){
return "Jun"
}
if(num==07){
return "Jul"
}
if(num==08){
return "Aug"
}
if(num==09){
return "Sept"
}
if(num==10){
return "Oct"
}
if(num==11){
return "Nov"
}
if(num==12){
return "Dec"
}
}
let paycontainer=document.getElementById("paycontainer");
paycontainer.addEventListener("click",()=>{
window.location.href="./payment gateway/paymentgateway.html"
})
</script>
</html>