Spaces:
Sleeping
Sleeping
Update templates/booking.html
Browse files- templates/booking.html +96 -127
templates/booking.html
CHANGED
|
@@ -4,161 +4,130 @@
|
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
<title>Book Tickets - {{ museum.name }}</title>
|
|
|
|
| 7 |
</head>
|
| 8 |
<body>
|
| 9 |
-
<
|
| 10 |
-
<
|
| 11 |
-
|
| 12 |
-
<
|
| 13 |
-
|
|
|
|
|
|
|
| 14 |
</div>
|
| 15 |
-
</
|
| 16 |
|
| 17 |
-
<div>
|
| 18 |
-
<div
|
| 19 |
<!-- Booking Form -->
|
| 20 |
-
<div
|
| 21 |
-
<div
|
| 22 |
-
<
|
| 23 |
-
|
| 24 |
-
<
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
<p style="font-size: 1.2rem; color: green; font-weight: bold;">₹{{ museum.price }} per person</p>
|
| 28 |
-
</div>
|
| 29 |
</div>
|
|
|
|
| 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 |
-
</div>
|
| 79 |
</div>
|
|
|
|
| 80 |
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
</div>
|
| 88 |
</div>
|
|
|
|
| 89 |
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
</div>
|
| 94 |
</div>
|
| 95 |
|
| 96 |
-
<!--
|
| 97 |
-
<div
|
| 98 |
-
<
|
| 99 |
-
|
| 100 |
-
<
|
| 101 |
-
<p><strong>Address:</strong><br>{{ museum.address }}</p>
|
| 102 |
-
</div>
|
| 103 |
-
|
| 104 |
<div style="margin: 15px 0;">
|
| 105 |
-
<a href="{{ museum.map_url }}" target="_blank"
|
| 106 |
🗺️ Open in Google Maps
|
| 107 |
</a>
|
| 108 |
</div>
|
|
|
|
| 109 |
|
| 110 |
-
|
| 111 |
-
<div style="
|
| 112 |
-
<
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
</a>
|
| 118 |
-
</div>
|
| 119 |
</div>
|
|
|
|
| 120 |
|
| 121 |
-
|
| 122 |
-
<
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
<p><strong>Rating:</strong> ⭐ {{ museum.rating }}/5</p>
|
| 129 |
-
</div>
|
| 130 |
</div>
|
| 131 |
</div>
|
| 132 |
</div>
|
| 133 |
</div>
|
| 134 |
|
| 135 |
-
<script>
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
const totalAmountElement = document.getElementById('totalAmount');
|
| 139 |
-
const visitorCountElement = document.getElementById('visitorCount');
|
| 140 |
-
const payButton = document.getElementById('payButton');
|
| 141 |
-
const ticketPrice = parseInt(document.getElementById('ticketPrice').textContent.replace('₹', ''));
|
| 142 |
-
|
| 143 |
-
function updateTotalAmount() {
|
| 144 |
-
const visitors = parseInt(visitorsInput.value) || 1;
|
| 145 |
-
const totalAmount = visitors * ticketPrice;
|
| 146 |
-
totalAmountElement.textContent = `₹${totalAmount}`;
|
| 147 |
-
visitorCountElement.textContent = visitors;
|
| 148 |
-
}
|
| 149 |
-
|
| 150 |
-
visitorsInput.addEventListener('input', updateTotalAmount);
|
| 151 |
-
updateTotalAmount();
|
| 152 |
-
|
| 153 |
-
payButton.addEventListener('click', async function() {
|
| 154 |
-
const formData = new FormData(document.getElementById('bookingForm'));
|
| 155 |
-
const bookingData = {
|
| 156 |
-
museum_id: document.getElementById('museumId').value,
|
| 157 |
-
visit_date: formData.get('visitDate'),
|
| 158 |
-
time_slot: formData.get('timeSlot'),
|
| 159 |
-
visitors: parseInt(formData.get('visitors')),
|
| 160 |
-
language: formData.get('language'),
|
| 161 |
-
name: formData.get('name'),
|
| 162 |
-
email: formData.get('email'),
|
| 163 |
-
phone: formData.get('phone')
|
| 164 |
-
};
|
|
|
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
<title>Book Tickets - {{ museum.name }}</title>
|
| 7 |
+
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
|
| 8 |
</head>
|
| 9 |
<body>
|
| 10 |
+
<nav class="navbar">
|
| 11 |
+
<div class="nav-container">
|
| 12 |
+
<h1 class="logo">MuseumTicket</h1>
|
| 13 |
+
<div class="nav-links">
|
| 14 |
+
<a href="{{ url_for('home') }}">Home</a>
|
| 15 |
+
<a href="{{ url_for('museums') }}">Museums</a>
|
| 16 |
+
</div>
|
| 17 |
</div>
|
| 18 |
+
</nav>
|
| 19 |
|
| 20 |
+
<div class="container">
|
| 21 |
+
<div class="booking-container">
|
| 22 |
<!-- Booking Form -->
|
| 23 |
+
<div class="booking-form-container">
|
| 24 |
+
<div class="museum-header">
|
| 25 |
+
<img src="{{ museum.image }}" alt="{{ museum.name }}">
|
| 26 |
+
<div class="museum-header-info">
|
| 27 |
+
<h1>{{ museum.name }}</h1>
|
| 28 |
+
<p class="location">📍 {{ museum.location }}</p>
|
| 29 |
+
<p class="price">₹{{ museum.price }} per person</p>
|
|
|
|
|
|
|
| 30 |
</div>
|
| 31 |
+
</div>
|
| 32 |
|
| 33 |
+
<form id="bookingForm" class="booking-form">
|
| 34 |
+
<input type="hidden" id="museumId" value="{{ museum.id }}">
|
| 35 |
+
|
| 36 |
+
<div class="form-group">
|
| 37 |
+
<label for="visitDate">Visit Date</label>
|
| 38 |
+
<input type="date" id="visitDate" name="visitDate" required min="{{ now }}">
|
| 39 |
+
</div>
|
| 40 |
|
| 41 |
+
<div class="form-group">
|
| 42 |
+
<label for="timeSlot">Time Slot</label>
|
| 43 |
+
<select id="timeSlot" name="timeSlot" required>
|
| 44 |
+
<option value="">Select Time Slot</option>
|
| 45 |
+
{% for slot in time_slots %}
|
| 46 |
+
<option value="{{ slot }}">{{ slot }}</option>
|
| 47 |
+
{% endfor %}
|
| 48 |
+
</select>
|
| 49 |
+
</div>
|
| 50 |
|
| 51 |
+
<div class="form-group">
|
| 52 |
+
<label for="visitors">Number of Visitors</label>
|
| 53 |
+
<input type="number" id="visitors" name="visitors" min="1" max="10" value="1" required>
|
| 54 |
+
</div>
|
| 55 |
|
| 56 |
+
<div class="form-group">
|
| 57 |
+
<label for="language">Preferred Language</label>
|
| 58 |
+
<select id="language" name="language">
|
| 59 |
+
{% for lang in museum.languages %}
|
| 60 |
+
<option value="{{ lang }}" {% if lang == 'English' %}selected{% endif %}>{{ lang }}</option>
|
| 61 |
+
{% endfor %}
|
| 62 |
+
</select>
|
| 63 |
+
</div>
|
| 64 |
|
| 65 |
+
<div class="form-section">
|
| 66 |
+
<h3>Personal Details</h3>
|
| 67 |
+
<div class="form-group">
|
| 68 |
+
<label for="name">Full Name</label>
|
| 69 |
+
<input type="text" id="name" name="name" required>
|
| 70 |
+
</div>
|
| 71 |
|
| 72 |
+
<div class="form-group">
|
| 73 |
+
<label for="email">Email Address</label>
|
| 74 |
+
<input type="email" id="email" name="email" required>
|
| 75 |
+
</div>
|
| 76 |
|
| 77 |
+
<div class="form-group">
|
| 78 |
+
<label for="phone">Phone Number</label>
|
| 79 |
+
<input type="tel" id="phone" name="phone" required>
|
|
|
|
| 80 |
</div>
|
| 81 |
+
</div>
|
| 82 |
|
| 83 |
+
<div class="summary">
|
| 84 |
+
<h3>Booking Summary</h3>
|
| 85 |
+
<div class="summary-details">
|
| 86 |
+
<p>Ticket Price: <span id="ticketPrice">₹{{ museum.price }}</span></p>
|
| 87 |
+
<p>Number of Visitors: <span id="visitorCount">1</span></p>
|
| 88 |
+
<p class="total">Total Amount: <span id="totalAmount">₹{{ museum.price }}</span></p>
|
|
|
|
| 89 |
</div>
|
| 90 |
+
</div>
|
| 91 |
|
| 92 |
+
<button type="button" id="payButton" class="submit-btn">Proceed to Payment</button>
|
| 93 |
+
<div id="paymentStatus" class="payment-status"></div>
|
| 94 |
+
</form>
|
|
|
|
| 95 |
</div>
|
| 96 |
|
| 97 |
+
<!-- Location Sidebar -->
|
| 98 |
+
<div class="location-sidebar">
|
| 99 |
+
<h2>📍 Museum Location</h2>
|
| 100 |
+
<div class="museum-info-sidebar">
|
| 101 |
+
<p><strong>Address:</strong><br>{{ museum.address }}</p>
|
|
|
|
|
|
|
|
|
|
| 102 |
<div style="margin: 15px 0;">
|
| 103 |
+
<a href="{{ museum.map_url }}" target="_blank" class="map-link">
|
| 104 |
🗺️ Open in Google Maps
|
| 105 |
</a>
|
| 106 |
</div>
|
| 107 |
+
</div>
|
| 108 |
|
| 109 |
+
<div class="map-preview">
|
| 110 |
+
<div style="text-align: center;">
|
| 111 |
+
<h3>📍 {{ museum.name }}</h3>
|
| 112 |
+
<p>{{ museum.location }}</p>
|
| 113 |
+
<a href="{{ museum.map_url }}" target="_blank" style="color: blue; text-decoration: underline;">
|
| 114 |
+
View on Google Maps
|
| 115 |
+
</a>
|
|
|
|
|
|
|
| 116 |
</div>
|
| 117 |
+
</div>
|
| 118 |
|
| 119 |
+
<div class="museum-info-sidebar">
|
| 120 |
+
<h3>ℹ️ Museum Information</h3>
|
| 121 |
+
<p><strong>Timings:</strong> {{ museum.timings }}</p>
|
| 122 |
+
<p><strong>Closed on:</strong> {{ museum.closed_on }}</p>
|
| 123 |
+
<p><strong>Languages:</strong> {{ museum.languages|join(', ') }}</p>
|
| 124 |
+
<p><strong>Best for:</strong> {{ museum.best_for|join(', ') }}</p>
|
| 125 |
+
<p><strong>Rating:</strong> ⭐ {{ museum.rating }}/5</p>
|
|
|
|
|
|
|
| 126 |
</div>
|
| 127 |
</div>
|
| 128 |
</div>
|
| 129 |
</div>
|
| 130 |
|
| 131 |
+
<script src="{{ url_for('static', filename='script.js') }}"></script>
|
| 132 |
+
</body>
|
| 133 |
+
</html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|