-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtwo.html
More file actions
390 lines (326 loc) · 11.7 KB
/
two.html
File metadata and controls
390 lines (326 loc) · 11.7 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Railway Management System</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet"/>
<style>
:root {
--primary-color: #0d1b2a;
--accent-color: #fca311;
--light-bg: #f5f7fb;
--text-muted: #6c757d;
}
body {
background-color: var(--light-bg);
font-family: Arial, sans-serif;
}
.navbar {
background: linear-gradient(90deg, #0b1320, #152238);
box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
.hero {
position: relative;
height: 80vh;
overflow: hidden;
}
.hero video {
position: absolute;
width: 100%;
height: 100%;
object-fit: cover;
filter: brightness(0.6);
}
.hero-content {
position: relative;
z-index: 10;
color: white;
padding-top: 120px;
}
.train-card {
border-radius: 14px;
overflow: hidden;
border: 1px solid #ccc;
background: white;
transition: 0.3s;
}
.train-card:hover {
transform: translateY(-4px);
box-shadow: 0px 10px 25px rgba(0,0,0,0.2);
}
.route-chip {
position: absolute;
bottom: 10px;
left: 10px;
background: rgba(0,0,0,0.7);
padding: 5px 12px;
border-radius: 20px;
color: white;
font-size: 12px;
}
</style>
</head>
<body>
<div id="uniBackToTop">⬆</div>
<!-- NAVBAR -->
<nav class="navbar navbar-expand-lg navbar-dark">
<div class="container">
<a class="navbar-brand" href="#">🚆 RailwaySystem</a>
<button class="navbar-toggler" data-bs-toggle="collapse" data-bs-target="#nav">
<span class="navbar-toggler-icon"></span>
</button>
<div id="nav" class="collapse navbar-collapse">
<ul class="navbar-nav ms-auto">
<li class="nav-item"><a class="nav-link active" href="#">Home</a></li>
<li class="nav-item"><a class="nav-link" href="#classes">Classes</a></li>
<li class="nav-item"><a class="nav-link" href="#why">Why Us</a></li>
</ul>
</div>
</div>
</nav>
<!-- HERO SECTION -->
<section class="hero">
<video autoplay muted loop>
<source src="https://videos.pexels.com/video-files/856186/856186-hd_1280_720_25fps.mp4" type="video/mp4">
</video>
<div class="container hero-content">
<h1 class="fw-bold">Travel Smart with Pakistan Railway</h1>
<p>Book your seats instantly with our online system.</p>
<button class="btn btn-warning btn-lg" data-bs-toggle="modal" data-bs-target="#bookingModal">Quick Book</button>
</div>
</section>
<!-- TRAIN CLASSES SECTION -->
<section id="classes" class="container py-5">
<h2 class="mb-4 fw-bold">Train Classes & Routes</h2>
<!-- BUSINESS CLASS -->
<h4>AC Business Class</h4>
<div class="row g-3">
<!-- Card 1 -->
<div class="col-md-4">
<div class="train-card position-relative">
<img src="https://images.pexels.com/photos/730945/pexels-photo-730945.jpeg?auto=compress" class="w-100" height="180">
<div class="route-chip">Karachi → Lahore</div>
<div class="p-3">
<h5 class="fw-bold">Karakoram Express</h5>
<p class="text-muted">Departure 15:00 — Arrival 07:00</p>
<button class="btn btn-warning book-btn"
data-bs-toggle="modal"
data-bs-target="#bookingModal"
data-class="AC Business"
data-route="Karachi → Lahore - Karakoram Express">
Book Now
</button>
</div>
</div>
</div>
<!-- Card 2 -->
<div class="col-md-4">
<div class="train-card position-relative">
<img src="https://images.pexels.com/photos/980874/pexels-photo-980874.jpeg" class="w-100" height="180">
<div class="route-chip">Lahore → Islamabad</div>
<div class="p-3">
<h5 class="fw-bold">Green Line Express</h5>
<p class="text-muted">Departure 08:30 — Arrival 14:00</p>
<button class="btn btn-warning book-btn"
data-bs-toggle="modal"
data-bs-target="#bookingModal"
data-class="AC Business"
data-route="Lahore → Islamabad - Green Line Express">
Book Now
</button>
</div>
</div>
</div>
<!-- Card 3 -->
<div class="col-md-4">
<div class="train-card position-relative">
<img src="https://images.pexels.com/photos/276503/pexels-photo-276503.jpeg" class="w-100" height="180">
<div class="route-chip">Quetta → Karachi</div>
<div class="p-3">
<h5 class="fw-bold">Jaffar Express</h5>
<p class="text-muted">Departure 19:00 — Arrival 09:30</p>
<button class="btn btn-warning book-btn"
data-bs-toggle="modal"
data-bs-target="#bookingModal"
data-class="AC Business"
data-route="Quetta → Karachi - Jaffar Express">
Book Now
</button>
</div>
</div>
</div>
</div>
</section>
<!-- BOOKING MODAL -->
<div class="modal fade" id="bookingModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Book Ticket</h5>
<button class="btn-close" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body">
<form>
<label>Full Name</label>
<input type="text" class="form-control mb-2">
<label>Email</label>
<input type="email" class="form-control mb-2">
<label>Travel Class</label>
<input id="bookingClass" type="text" class="form-control mb-2" readonly>
<label>Selected Route</label>
<input id="bookingRoute" type="text" class="form-control mb-2" readonly>
<label>Date</label>
<input type="date" class="form-control mb-2">
<button class="btn btn-success w-100 mt-2">Submit Booking</button>
</form>
</div>
</div>
</div>
</div>
<!-- FOOTER -->
<footer class="bg-dark text-white text-center py-3 mt-5">
Railway Management System · Semester Project
</footer>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
<script>
document.querySelectorAll(".book-btn").forEach(btn => {
btn.addEventListener("click", () => {
document.getElementById("bookingClass").value = btn.dataset.class;
document.getElementById("bookingRoute").value = btn.dataset.route;
});
});
</script>
</body>
</html>
<script>
document.getElementById("bookingForm").addEventListener("submit", function(e) {
let hasError = false;
// Clear previous errors
document.querySelectorAll(".field-error").forEach(el => el.innerText = "");
// List of required fields with their IDs and error messages
const requiredFields = [
{id: "formRoute", errorId: "errorRoute", message: "Route is required"},
{id: "travelDate", errorId: "errorDate", message: "Travel date is required"},
{id: "passengerName", errorId: "errorPassenger", message: "Passenger name is required"},
{id: "cnic", errorId: "errorCnic", message: "CNIC is required"},
{id: "email", errorId: "errorEmail", message: "Email is required"},
{id: "payment_method", errorId: "errorPayment", message: "Payment method is required"}
];
// Loop through all required fields and check for empty values
requiredFields.forEach(f => {
const field = document.getElementById(f.id);
const val = field.value.trim();
if (!val) {
document.getElementById(f.errorId).innerText = f.message;
field.classList.add("is-invalid"); // Add red border to highlight error
hasError = true;
} else {
field.classList.remove("is-invalid");
}
});
if (hasError) {
e.preventDefault(); // Prevent form submission if any field is empty
}
});
</script>
<script>
document.getElementById('payment_method').addEventListener('change', function() {
var stripe = document.getElementById('stripeFields');
var jazz = document.getElementById('jazzcashFields');
stripe.style.display = 'none';
jazz.style.display = 'none';
if(this.value === 'stripe') stripe.style.display = 'block';
if(this.value === 'jazzcash') jazz.style.display = 'block';
});
</script>
<style>
/* Red border for invalid fields */
.is-invalid {
border-color: #dc3545 !important;
}
</style>
<script>
document.addEventListener('click', function(e){
if(e.target.closest('.book-btn')){
const btn = e.target.closest('.book-btn');
document.getElementById('formTrainId').value = btn.dataset.id;
document.getElementById('formRoute').value = btn.dataset.route;
document.getElementById('formTrain').value = btn.dataset.train;
document.getElementById('formClass').value = btn.dataset.class;
document.getElementById('formPrice').value = btn.dataset.price;
document.getElementById('formTime').value = btn.dataset.time;
const dateInput = document.getElementById('travelDate');
const today = new Date().toISOString().split('T')[0];
dateInput.min = today;
if(!dateInput.value) dateInput.value = today;
const modal = new bootstrap.Modal(document.getElementById('bookingModal'));
modal.show();
}
});
</script>
<script>
const btn = document.getElementById("backToTop");
window.addEventListener("scroll", () => {
if (window.scrollY > 200) {
btn.style.display = "flex";
} else {
btn.style.display = "none";
}
});
btn.addEventListener("click", () => {
window.scrollTo({ top: 0, behavior: "smooth" });
});
</script>
<footer class="uni-footer bg-dark">
<div class="container">
<div class="row gy-4">
<!-- Brand -->
<div class="col-md-4">
<span class="uni-footer-brand d-block mb-3">🚆 Railway Management System</span>
<p class="small">
Smart digital railway reservation and management platform connecting cities across Pakistan.
</p>
<p class="small">
<strong>Support:</strong> <span class="text-warning">info@railway.com</span>
</p>
</div>
<!-- Quick Links -->
<div class="col-md-4">
<h6 class="uni-footer-title">Quick Links</h6>
<ul class="list-unstyled">
<li><a href="index.php">Home</a></li>
<li><a href="./pages/trains.php">Train Schedules</a></li>
<li><a href="#bookingModal" data-bs-toggle="modal">Ticket Booking</a></li>
<li><a href="#">Tracking System</a></li>
<li><a href="./pages/contact.php">Help Center</a></li>
</ul>
</div>
<!-- System Stats -->
<div class="col-md-4 text-md-end">
<h6 class="uni-footer-title">System Stats</h6>
<div class="uni-footer-stats mb-3">
<span>24+</span> Active Trains<br>
<span>15+</span> Connected Cities<br>
<span>4</span> Travel Classes
</div>
<!-- Social -->
<div class="d-flex gap-3 justify-content-md-end">
<a class="uni-social-link" href="#">🌐</a>
<a class="uni-social-link" href="#">📘</a>
<a class="uni-social-link" href="#">📷</a>
<a class="uni-social-link" href="#">🐦</a>
</div>
</div>
</div>
<!-- Bottom -->
<div class="uni-footer-bottom row mt-4 align-items-center">
<div class="col-md-6">
© <?php echo date("Y"); ?> Railway Management System. All rights reserved.
</div>
<div class="col-md-6 text-md-end">
Designed for Academic Project
</div>
</div>
</div>
</footer>