-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprint.html
More file actions
96 lines (84 loc) · 3.18 KB
/
print.html
File metadata and controls
96 lines (84 loc) · 3.18 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
<!DOCTYPE html>
<html>
<head>
<title>Ticket Details</title>
<style>
/* Your CSS styles here */
.ticket {
font-family: Montserrat, sans-serif;
}
.ticketdesign {
background: linear-gradient(to bottom, #FFC107 0%, #FFC107 19%, #d9d9d9 19%, #d9d9d9 100%);
height: 29em;
float: left;
object-position: center;
padding: 1em;
margin-top: 100px;
}
.ticketstructure {
align-content: center;
border-top-left-radius: 8px;
border-bottom-left-radius: 8px;
border-top-right-radius: 8px;
border-bottom-right-radius: 8px;
width: 44em;
}
h1 {
font-size: 40px;
margin-top: 0;
font-family: Montserrat, sans-serif;
}
h2, h3 {
font-size: 20px;
margin-top: 0;
font-family: Montserrat, sans-serif;
color: black;
}
span {
color: black;
}
#options {
align-content: center;
align-items: center;
text-align: center;
}
.printable {
padding-left: 10px;
text-align: left;
}
</style>
</head>
<body>
<div class="ticket " id="printable">
<div class="ticketdesign ticketstructure">
<h1 align="left"><b>M-TICKET</b> Booking ID: 12345
</h1>
<div class="title"><br>
<h1 align="center"><span id="source">Source</span> To <span id="dest">Destination</span>
</h1>
<h2 align="left"><span>DATE & TIME : <span id="date-time">Date Time</span></span></h2>
<h2 align="left"><span>NO. OF PASSENGERS : <span id="passengers">3</span></span></h2>
<h2 align="left"><span>AMOUNT : ₹<span id="amount">500</span></span></h2>
<h2 align="left"><span>ROUTE : <span id="route">Route</span></span></h2>
<h2 align="center"><span>WISH YOU A HAPPY & SAFE JOURNEY</span></h2>
</div>
</div>
</div>
<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");
const price = params.get("price");
// Populate the ticket details with the extracted data
document.getElementById("source").textContent = source;
document.getElementById("dest").textContent = dest;
document.getElementById("date-time").textContent = "Date Time"; // Replace with actual date
document.getElementById("passengers").textContent = numberOfPassengers;
document.getElementById("amount").textContent = `₹${price}`;
document.getElementById("route").textContent = "Route"; // Replace with actual route
});
</script>
</body>
</html>