MSivasandeep commited on
Commit
0e58a8b
·
verified ·
1 Parent(s): 95ff181

Update templates/booking.html

Browse files
Files changed (1) hide show
  1. 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
- <div>
10
- <h1>MuseumTicket</h1>
11
- <div>
12
- <a href="/">Home</a>
13
- <a href="/museums">Museums</a>
 
 
14
  </div>
15
- </div>
16
 
17
- <div>
18
- <div style="display: flex; gap: 20px;">
19
  <!-- Booking Form -->
20
- <div style="flex: 2;">
21
- <div style="border: 1px solid #ccc; padding: 20px;">
22
- <div style="display: flex; align-items: center; margin-bottom: 20px;">
23
- <img src="{{ museum.image }}" alt="{{ museum.name }}" width="120" style="margin-right: 20px;">
24
- <div>
25
- <h1>{{ museum.name }}</h1>
26
- <p>📍 {{ museum.location }}</p>
27
- <p style="font-size: 1.2rem; color: green; font-weight: bold;">₹{{ museum.price }} per person</p>
28
- </div>
29
  </div>
 
30
 
31
- <form id="bookingForm">
32
- <input type="hidden" id="museumId" value="{{ museum.id }}">
33
-
34
- <div style="margin-bottom: 15px;">
35
- <label for="visitDate" style="display: block; margin-bottom: 5px; font-weight: bold;">Visit Date</label>
36
- <input type="date" id="visitDate" name="visitDate" required min="{{ now }}" style="width: 100%; padding: 8px; border: 1px solid #ccc;">
37
- </div>
38
 
39
- <div style="margin-bottom: 15px;">
40
- <label for="timeSlot" style="display: block; margin-bottom: 5px; font-weight: bold;">Time Slot</label>
41
- <select id="timeSlot" name="timeSlot" required style="width: 100%; padding: 8px; border: 1px solid #ccc;">
42
- <option value="">Select Time Slot</option>
43
- {% for slot in time_slots %}
44
- <option value="{{ slot }}">{{ slot }}</option>
45
- {% endfor %}
46
- </select>
47
- </div>
48
 
49
- <div style="margin-bottom: 15px;">
50
- <label for="visitors" style="display: block; margin-bottom: 5px; font-weight: bold;">Number of Visitors</label>
51
- <input type="number" id="visitors" name="visitors" min="1" max="10" value="1" required style="width: 100%; padding: 8px; border: 1px solid #ccc;">
52
- </div>
53
 
54
- <div style="margin-bottom: 15px;">
55
- <label for="language" style="display: block; margin-bottom: 5px; font-weight: bold;">Preferred Language</label>
56
- <select id="language" name="language" style="width: 100%; padding: 8px; border: 1px solid #ccc;">
57
- {% for lang in museum.languages %}
58
- <option value="{{ lang }}" {% if lang == 'English' %}selected{% endif %}>{{ lang }}</option>
59
- {% endfor %}
60
- </select>
61
- </div>
62
 
63
- <div style="background: #f9f9f9; padding: 20px; margin: 20px 0; border-left: 4px solid blue;">
64
- <h3>Personal Details</h3>
65
- <div style="margin-bottom: 15px;">
66
- <label for="name" style="display: block; margin-bottom: 5px; font-weight: bold;">Full Name</label>
67
- <input type="text" id="name" name="name" required style="width: 100%; padding: 8px; border: 1px solid #ccc;">
68
- </div>
69
 
70
- <div style="margin-bottom: 15px;">
71
- <label for="email" style="display: block; margin-bottom: 5px; font-weight: bold;">Email Address</label>
72
- <input type="email" id="email" name="email" required style="width: 100%; padding: 8px; border: 1px solid #ccc;">
73
- </div>
74
 
75
- <div style="margin-bottom: 15px;">
76
- <label for="phone" style="display: block; margin-bottom: 5px; font-weight: bold;">Phone Number</label>
77
- <input type="tel" id="phone" name="phone" required style="width: 100%; padding: 8px; border: 1px solid #ccc;">
78
- </div>
79
  </div>
 
80
 
81
- <div style="background: #f0f8f0; padding: 15px; margin: 20px 0; border: 1px solid #ccc;">
82
- <h3>Booking Summary</h3>
83
- <div>
84
- <p>Ticket Price: <span id="ticketPrice">₹{{ museum.price }}</span></p>
85
- <p>Number of Visitors: <span id="visitorCount">1</span></p>
86
- <p style="font-size: 1.2rem; font-weight: bold; border-top: 1px solid #ccc; padding-top: 10px;">Total Amount: <span id="totalAmount">₹{{ museum.price }}</span></p>
87
- </div>
88
  </div>
 
89
 
90
- <button type="button" id="payButton" style="width: 100%; background: blue; color: white; padding: 15px; border: none; font-size: 1.1rem; cursor: pointer;">Proceed to Payment</button>
91
- <div id="paymentStatus" style="margin-top: 15px; padding: 10px; text-align: center;"></div>
92
- </form>
93
- </div>
94
  </div>
95
 
96
- <!-- Museum Location Info -->
97
- <div style="flex: 1;">
98
- <div style="border: 1px solid #ccc; padding: 20px;">
99
- <h2>📍 Museum Location</h2>
100
- <div style="margin-bottom: 15px;">
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" style="background: green; color: white; padding: 10px 15px; text-decoration: none; display: inline-block;">
106
  🗺️ Open in Google Maps
107
  </a>
108
  </div>
 
109
 
110
- <!-- Map Preview -->
111
- <div style="height: 300px; background: #f5f5f5; border: 1px solid #ddd; display: flex; align-items: center; justify-content: center; margin-top: 15px;">
112
- <div style="text-align: center;">
113
- <h3>📍 {{ museum.name }}</h3>
114
- <p>{{ museum.location }}</p>
115
- <a href="{{ museum.map_url }}" target="_blank" style="color: blue; text-decoration: underline;">
116
- View on Google Maps
117
- </a>
118
- </div>
119
  </div>
 
120
 
121
- <!-- Museum Details -->
122
- <div style="margin-top: 20px; padding: 15px; background: #f9f9f9;">
123
- <h3>ℹ️ Museum Information</h3>
124
- <p><strong>Timings:</strong> {{ museum.timings }}</p>
125
- <p><strong>Closed on:</strong> {{ museum.closed_on }}</p>
126
- <p><strong>Languages:</strong> {{ museum.languages|join(', ') }}</p>
127
- <p><strong>Best for:</strong> {{ museum.best_for|join(', ') }}</p>
128
- <p><strong>Rating:</strong> ⭐ {{ museum.rating }}/5</p>
129
- </div>
130
  </div>
131
  </div>
132
  </div>
133
  </div>
134
 
135
- <script>
136
- document.addEventListener('DOMContentLoaded', function() {
137
- const visitorsInput = document.getElementById('visitors');
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>