-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheckout.html
More file actions
100 lines (93 loc) · 4.03 KB
/
checkout.html
File metadata and controls
100 lines (93 loc) · 4.03 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
89
90
91
92
93
94
95
96
97
98
99
100
<!DOCTYPE html>
<html>
<head>
<link rel='stylesheet' href='index.css'>
<title>Checkout</title>
<style>
/* Increase font size for the displayed information */
p {
font-size: 30px;
background-color: #bcb547; /* Yellow background color */
padding: 10px; /* Add padding for better visibility */
border: 2px solid #4a54c1; /* Red border */
}
</style>
</head>
<body>
<iframe src="header.html" frameborder="0" width="100%" height="100"></iframe>
<script>
document.addEventListener("DOMContentLoaded", function () {
const params = new URLSearchParams(window.location.search);
const source = params.get("source");
const dest = params.get("dest");
const numberOfPassengers = params.get("number");
// Calculate the price based on source and destination (Add your logic here)
let price = calculatePrice(source, dest);
// Display the information with the calculated price
const infoElement = document.createElement("p");
infoElement.innerHTML = `<center><b>Source:</b> ${source}, <b>Destination:</b> ${dest}, <b>Passengers:</b> ${numberOfPassengers}, <b>Price:</b> ₹${price}</center>`;
document.body.appendChild(infoElement);
});
// Function to calculate the price based on source and destination
function calculatePrice(source, dest) {
// Replace this with your logic to calculate the price
// Example: Price calculation based on source and destination
if (source === "Panvel" && dest === "Khandeshwar") {
return 500;
} else if (source === "Panvel" && dest === "Kharghar") {
return 160;
}else if(source === "Kharghar" && dest === "Khandeshwar") {
return 200;
}else if(source === "Panvel" && dest === "Vashi"){
return 300;
}else if (source === "vashi" && dest === "Panvel"){
return 300;
}else if(source === "Kharghar"&& dest === "Panvel"){
return 160;
}else if (source === "Khandeshwar" && dest === "Panvel"){
return 500;
}else if(source === "Khandeshwar" && dest === "Kharghar") {
return 200;
}else if(source === "Khandeshwar" && dest === "Thane"){
return 200;
}else if(source === "Kharghar" && dest === "Thane"){
return 400;
}else if(source === "Vashi" && dest ==="Thane"){
return 210;
}else if(source === "Panvel" && dest ==="Thane"){
return 100;
}else if (source === "Thane" && dest ==="Panvel"){
return 100;
}else if(source === "Thane" && dest ==="Vashi"){
return 160;
}else if(source === "Thane" && dest ==="Kharghar"){
return 200;
}else if(source==="Thane" && dest==="Khandeshwar"){
return 200;
} else if(source==="Vashi" && dest==="Kharghar"){
return 500;
}else if(source==="Vashi" && dest==="Khandeshwar"){
return 160;
}else if(source==="Kharghar" && dest ==="Vashi"){
return 200;
}else if(source==="Khandeshwar" && dest==="Vashi"){
return 300;
}
// Add more conditions for other routes
return 0; // Default price if no match
}
</script>
<center>
<form action="pay.html">
<button style="background-color: black; padding: 25px 70px;" type="submit"><span
style="color: white;"><h3>Pay</h3></span></button>
</form>
</center>
<center>
<form action="book.html">
<button style="background-color: black; padding: 28px 80px;" type="submit"><span
style="color: white;"><h3>Go back</h3></span></button>
</form>
</center>
</body>
</html>