<!DOCTYPE html>
<html lang=”en”>
<head>
<meta charset=”UTF-8″>
<meta name=”viewport” content=”width=device-width, initial-scale=1.0″>
<title>Cable Car Ticket Ordering System</title>
<style>
body {
font-family: Arial, sans-serif;
background: #f0f8ff;
text-align: center;
padding: 20px;
}
h1 {
color: #2f4f4f;
animation: fadeIn 2s ease-in-out;
}
.container {
background: #fff;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0,0,0,0.1);
padding: 20px;
display: inline-block;
}
input, select {
width: 100%;
padding: 10px;
margin: 10px 0;
border-radius: 5px;
border: 1px solid #ccc;
}
button {
padding: 10px 20px;
background: #2f4f4f;
color: #fff;
border: none;
border-radius: 5px;
cursor: pointer;
}
button:hover {
background: #4682b4;
}
#bill {
margin-top: 20px;
display: none;
}
#bill img {
width: 100px;
height: 100px;
margin-top: 20px;
animation: zoomIn 1s ease-in-out;
}
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
@keyframes zoomIn {
from { transform: scale(0); }
to { transform: scale(1); }
}
</style>
</head>
<body>
<h1>🎢 Cable Car Ticket Ordering System 🎢</h1>
<div class=”container”>
<form id=”ticketForm”>
<input type=”text” id=”uniqueID” placeholder=”Enter Unique ID (if any)” />
<input type=”text” id=”name” placeholder=”Your Name” required />
<input type=”text” id=”phone” placeholder=”Phone Number” required />
<input type=”email” id=”email” placeholder=”Email Address” required />
<select id=”ticketQty” required>
<option value=””>Select Number of Tickets</option>
<option value=”1″>1 Ticket</option>
<option value=”2″>2 Tickets</option>
<option value=”3″>3 Tickets</option>
<option value=”4″>4 Tickets</option>
<option value=”5″>5 Tickets</option>
</select>
<button type=”submit”>Buy Tickets</button>
</form>
<div id=”bill”>
<h2>🧾 Your Ticket Bill 🧾</h2>
<p id=”billDetails”></p>
<button onclick=”downloadBill(‘pdf’)”>Download PDF</button>
<button onclick=”downloadBill(‘jpeg’)”>Download JPEG</button>
<button onclick=”printBill()”>Print Bill</button>
</div>
</div>
<script>
document.getElementById(‘ticketForm’).addEventListener(‘submit’, function(event) {
event.preventDefault();
const uniqueID = document.getElementById(‘uniqueID’).value;
const name = document.getElementById(‘name’).value;
const phone = document.getElementById(‘phone’).value;
const email = document.getElementById(’email’).value;
const ticketQty = document.getElementById(‘ticketQty’).value;
let userID = uniqueID || ‘ID’ + Math.floor(Math.random() * 100000);
localStorage.setItem(userID, JSON.stringify({name, phone, email, ticketQty}));
document.getElementById(‘billDetails’).innerText = `Unique ID: ${userID}\nName: ${name}\nPhone: ${phone}\nEmail: ${email}\nTickets: ${ticketQty}`;
document.getElementById(‘bill’).style.display = ‘block’;
});
document.getElementById(‘uniqueID’).addEventListener(‘input’, function() {
const userData = JSON.parse(localStorage.getItem(this.value));
if (userData) {
document.getElementById(‘name’).value = userData.name;
document.getElementById(‘phone’).value = userData.phone;
document.getElementById(’email’).value = userData.email;
document.getElementById(‘ticketQty’).value = userData.ticketQty;
}
});
function downloadBill(format) {
alert(`Bill downloaded as ${format.toUpperCase()}.`);
// Implementation to download the bill in the desired format.
}
function printBill() {
alert(‘Printing Bill…’);
// Implementation to print the bill.
}
</script>
</body>
</html>