-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmin-dashboard.html
More file actions
155 lines (131 loc) · 4.49 KB
/
Copy pathadmin-dashboard.html
File metadata and controls
155 lines (131 loc) · 4.49 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Admin Dashboard - Fitness Club</title>
<style>
body {
margin: 0;
font-family: 'Arial', sans-serif;
background:
linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)),
url('https://images.unsplash.com/photo-1581009137042-c552e485697a?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80') no-repeat center center;
background-size: cover;
color: #333;
}
.dashboard-container {
max-width: 1100px;
margin: 0 auto;
padding: 2rem;
}
.dashboard-header {
text-align: center;
color: #fff;
margin-bottom: 2rem;
}
.dashboard-header h1 {
font-size: 2.5rem;
}
.dashboard-cards {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 1.5rem;
}
.dashboard-cards a.card {
background: rgba(255, 255, 255, 0.95);
padding: 1.8rem;
border-radius: 10px;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
text-align: center;
transition: transform 0.25s ease, box-shadow 0.25s ease;
text-decoration: none;
color: inherit;
display: block;
}
.dashboard-cards a.card:hover {
transform: translateY(-6px);
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
}
.dashboard-cards a.card h3 {
color: #ff5a5f;
margin-bottom: 0.5rem;
}
.dashboard-cards a.card p {
color: #444;
font-size: 0.95rem;
}
.logout-btn {
display: block;
width: fit-content;
margin: 2rem auto 0;
padding: 10px 20px;
background: #ff5a5f;
color: white;
border: none;
border-radius: 5px;
font-weight: bold;
cursor: pointer;
text-decoration: none;
text-align: center;
}
.logout-btn:hover {
background: #e0484c;
}
</style>
</head>
<body>
<div class="dashboard-container">
<div class="dashboard-header">
<h1>Admin Dashboard</h1>
<p id="adminEmail">Welcome, Administrator</p>
</div>
<div class="dashboard-cards">
<a href="add-member.html" class="card">
<h3>Add Member</h3>
<p>Register a new gym member</p>
</a>
<a href="manage-members.html" class="card">
<h3>Manage Members</h3>
<p>Update or delete member information</p>
</a>
<a href="create-bill.html" class="card">
<h3>Create Bills</h3>
<p>Generate and manage billing receipts</p>
</a>
<a href="send-notification.html" class="card">
<h3>Send Notifications</h3>
<p>Alert members about fees or holidays</p>
</a>
<a href="supplement-store.html" class="card">
<h3>Supplement Store</h3>
<p>Track supplements and stock details</p>
</a>
<a href="diet-plans.html" class="card">
<h3>Diet Plans</h3>
<p>Assign diet or nutrition advice</p>
</a>
</div>
<button id="logoutBtn" class="logout-btn">Logout</button>
</div>
<script type="module">
import { auth } from './js/firebase-init.js';
import { signOut, onAuthStateChanged } from "https://www.gstatic.com/firebasejs/10.3.1/firebase-auth.js";
// Protect dashboard: Only signed-in admin allowed
onAuthStateChanged(auth, user => {
if (!user || user.email !== "admin123@gmail.com") {
alert("Access Denied. Admins only.");
window.location.href = 'admin.html';
} else {
document.getElementById('adminEmail').textContent = `Welcome, ${user.email}`;
}
});
// Logout function
document.getElementById('logoutBtn').addEventListener('click', () => {
signOut(auth).then(() => {
window.location.href = 'admin.html';
});
});
</script>
</body>
</html>