-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmin.php
More file actions
150 lines (143 loc) · 5 KB
/
Copy pathadmin.php
File metadata and controls
150 lines (143 loc) · 5 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Admin Panel</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
<style>
body {
min-height: 100vh;
}
.sidebar {
height: 100vh;
position: fixed;
top: 0;
left: 0;
width: 220px;
background-color: #1e1e2f;
color: #fff;
padding-top: 60px; /* Navbar height */
}
.sidebar a {
display: block;
color: #fff;
padding: 12px 20px;
text-decoration: none;
border-radius: 5px;
}
.sidebar a:hover {
background-color: #343454;
}
.main-content {
margin-left: 220px;
padding: 20px;
}
</style>
</head>
<body>
<!-- Top Navbar -->
<nav class="navbar navbar-dark bg-dark fixed-top">
<div class="container-fluid">
<a class="navbar-brand" href="#">Admin Panel</a>
</div>
</nav>
<!-- Sidebar -->
<div class="sidebar">
<a href="#" id="nav-trains">🚆 Trains</a>
<a href="#" id="nav-bookings">📋 Bookings</a>
<!-- Future Modules -->
<!-- <a href="#" id="nav-users">👤 Users</a> -->
</div>
<!-- Main Content -->
<div class="main-content" id="main-content">
<h3>Welcome to Admin Panel</h3>
<p>Select a module from the sidebar.</p>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<script>
// Sidebar Navigation Logic
const trainsLink = document.getElementById('nav-trains');
const bookingsLink = document.getElementById('nav-bookings');
const mainContent = document.getElementById('main-content');
trainsLink.addEventListener('click', () => {
mainContent.innerHTML = `
<h3>Manage Trains</h3>
<form id="trainForm">
<div class="mb-3">
<label class="form-label">Train Name</label>
<input type="text" class="form-control" placeholder="Enter train name">
</div>
<div class="mb-3">
<label class="form-label">Route Name</label>
<input type="text" class="form-control" placeholder="Enter route name">
</div>
<div class="mb-3">
<label class="form-label">Class</label>
<select class="form-select">
<option>Business</option>
<option>Economy</option>
<option>AC Standard</option>
</select>
</div>
<div class="mb-3">
<label class="form-label">Departure Time</label>
<input type="time" class="form-control">
</div>
<div class="mb-3">
<label class="form-label">Seats</label>
<input type="number" class="form-control" placeholder="Total seats">
</div>
<div class="mb-3">
<label class="form-label">Price</label>
<input type="number" class="form-control" placeholder="Price per seat">
</div>
<div class="mb-3">
<label class="form-label">Train Image</label>
<input type="file" class="form-control">
</div>
<button class="btn btn-primary">Add Train</button>
</form>
<hr>
<h5>Existing Trains Table</h5>
<table class="table table-bordered">
<thead>
<tr>
<th>Name</th>
<th>Route</th>
<th>Class</th>
<th>Seats</th>
<th>Price</th>
</tr>
</thead>
<tbody>
<!-- Existing trains data will go here -->
</tbody>
</table>
`;
});
bookingsLink.addEventListener('click', () => {
mainContent.innerHTML = `
<h3>Manage Bookings</h3>
<p>Booking records will appear here.</p>
<table class="table table-bordered">
<thead>
<tr>
<th>Booking ID</th>
<th>Passenger Name</th>
<th>Train</th>
<th>Class</th>
<th>Seats</th>
<th>Price</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<!-- Booking records go here -->
</tbody>
</table>
`;
});
</script>
</body>
</html>