-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
327 lines (283 loc) · 10.5 KB
/
Copy pathindex.html
File metadata and controls
327 lines (283 loc) · 10.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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Admin Dashboard - Developer Applicants</title>
<!-- Firebase Compat SDK -->
<script src="https://www.gstatic.com/firebasejs/10.8.0/firebase-app-compat.js"></script>
<script src="https://www.gstatic.com/firebasejs/10.8.0/firebase-database-compat.js"></script>
<style>
* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }
body {
background-color: #f4f6f9;
color: #333;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
padding: 20px;
}
/* Password Modal Styling */
#auth-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: #121212;
display: flex;
align-items: center;
justify-content: center;
z-index: 9999;
}
.auth-card {
background: #242424;
padding: 30px;
border-radius: 12px;
width: 90%;
max-width: 380px;
text-align: center;
box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.auth-card h2 {
color: #e50914;
font-size: 22px;
margin-bottom: 15px;
}
.auth-card input {
width: 100%;
padding: 12px;
border-radius: 6px;
border: none;
background: #333;
color: #fff;
font-size: 15px;
margin-bottom: 15px;
outline: none;
text-align: center;
}
.auth-card button {
width: 100%;
padding: 12px;
background-color: #e50914;
color: white;
border: none;
border-radius: 6px;
font-weight: bold;
cursor: pointer;
text-transform: uppercase;
letter-spacing: 1px;
}
.auth-card button:hover {
background-color: #f6121d;
}
.error-msg {
color: #ff4d4d;
font-size: 13px;
margin-top: 10px;
display: none;
}
/* Main Dashboard (Hidden until unlocked) */
#main-dashboard {
display: none;
width: 100%;
flex-direction: column;
align-items: center;
}
h1 {
color: #e50914;
font-size: 28px;
font-weight: 800;
text-transform: uppercase;
margin-bottom: 20px;
text-align: center;
letter-spacing: 1px;
}
.search-container {
width: 100%;
max-width: 600px;
margin-bottom: 20px;
}
.search-box {
width: 100%;
padding: 12px 16px;
border: 1px solid #ccc;
border-radius: 8px;
font-size: 15px;
outline: none;
background: #fff;
box-shadow: 0 2px 5px rgba(0,0,0,0.05);
transition: all 0.3s;
}
.search-box:focus {
border-color: #e50914;
box-shadow: 0 0 8px rgba(229, 9, 20, 0.3);
}
.applicants-container {
width: 100%;
max-width: 600px;
max-height: 70vh;
overflow-y: auto;
padding-right: 5px;
}
.applicants-container::-webkit-scrollbar { width: 6px; }
.applicants-container::-webkit-scrollbar-track { background: rgba(0,0,0,0.05); border-radius: 10px; }
.applicants-container::-webkit-scrollbar-thumb { background: #e50914; border-radius: 10px; }
.card {
background: #fff;
border-radius: 8px;
padding: 20px;
margin-bottom: 15px;
box-shadow: 0 4px 15px rgba(0,0,0,0.08);
border-left: 5px solid #e50914;
position: relative;
}
.card h3 {
font-size: 18px;
color: #111;
margin-bottom: 12px;
border-bottom: 1px solid #eee;
padding-bottom: 8px;
}
.card p {
font-size: 14px;
margin-bottom: 6px;
color: #444;
}
.card p strong {
color: #111;
}
.timestamp {
font-size: 11px;
color: #888;
text-align: right;
margin-top: 10px;
}
.no-data {
text-align: center;
color: #777;
padding: 40px;
font-size: 15px;
background: #fff;
border-radius: 8px;
box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
</style>
</head>
<body>
<!-- Password Prompt Screen -->
<div id="auth-overlay">
<div class="auth-card">
<h2>Admin Access</h2>
<input type="password" id="passwordInput" placeholder="Enter Admin Password">
<button onclick="checkPassword()">Login</button>
<div id="errorMsg" class="error-msg">Incorrect Password! Try again.</div>
</div>
</div>
<!-- Main Dashboard Screen -->
<div id="main-dashboard">
<h1>Admin Dashboard</h1>
<div class="search-container">
<input type="text" id="searchInput" class="search-box" placeholder="Search by name, email, country, or #id...">
</div>
<div class="applicants-container" id="applicantsList">
<div class="no-data">Loading applications...</div>
</div>
</div>
<script>
// Yahan apna password change kar sakta hai
const adminPassword = "winds@123";
function checkPassword() {
const enteredPass = document.getElementById('passwordInput').value;
const errorMsg = document.getElementById('errorMsg');
if (enteredPass === adminPassword) {
document.getElementById('auth-overlay').style.display = 'none';
document.getElementById('main-dashboard').style.display = 'flex';
loadFirebaseData(); // Load data only after successful login
} else {
errorMsg.style.display = 'block';
document.getElementById('passwordInput').value = '';
}
}
// Allow pressing Enter key to login
document.getElementById('passwordInput').addEventListener('keypress', function (e) {
if (e.key === 'Enter') {
checkPassword();
}
});
function loadFirebaseData() {
const firebaseConfig = {
apiKey: "AIzaSyCa0A0fuxJ-DbbTi6wrk0ts2UU_hHdT5SI",
authDomain: "adminofsw.firebaseapp.com",
databaseURL: "https://adminofsw-default-rtdb.firebaseio.com",
projectId: "adminofsw",
storageBucket: "adminofsw.appspot.com",
messagingSenderId: "351370839445",
appId: "1:351370839445:web:a5efcd12e6841ae558a29c",
measurementId: "G-70J5Y5F519"
};
firebase.initializeApp(firebaseConfig);
const db = firebase.database();
let allApplicants = [];
db.ref('applications/').on('value', (snapshot) => {
const data = snapshot.val();
allApplicants = [];
if (data) {
const keys = Object.keys(data);
keys.forEach((key, index) => {
allApplicants.push({
id: key,
serialNumber: index + 1,
...data[key]
});
});
renderApplicants([...allApplicants].reverse());
} else {
document.getElementById('applicantsList').innerHTML = '<div class="no-data">No applications found.</div>';
}
});
function renderApplicants(applicants) {
const container = document.getElementById('applicantsList');
container.innerHTML = '';
if (applicants.length === 0) {
container.innerHTML = '<div class="no-data">No matching applications found.</div>';
return;
}
applicants.forEach((app) => {
const card = document.createElement('div');
card.className = 'card';
card.innerHTML = `
<h3>#${app.serialNumber} - ${app.name || 'Unknown'}</h3>
<p><strong>Email Address:</strong> ${app.email || 'N/A'}</p>
<p><strong>Age:</strong> ${app.age || 'N/A'} Years</p>
<p><strong>Location/Country:</strong> ${app.country || 'N/A'}</p>
<p><strong>Work Track:</strong> ${app.workType || 'None selected'}</p>
<p><strong>Reason to choose us:</strong> ${app.whyChooseUs || 'N/A'}</p>
<div class="timestamp">Submitted on: ${app.timestamp || 'N/A'}</div>
`;
container.appendChild(card);
});
}
const searchInput = document.getElementById('searchInput');
searchInput.addEventListener('input', (e) => {
const query = e.target.value.toLowerCase().trim();
const filtered = allApplicants.filter(app => {
const name = (app.name || '').toLowerCase();
const email = (app.email || '').toLowerCase();
const country = (app.country || '').toLowerCase();
const workType = (app.workType || '').toLowerCase();
const serial = app.serialNumber.toString();
return name.includes(query) ||
email.includes(query) ||
country.includes(query) ||
workType.includes(query) ||
serial.includes(query) ||
`#${serial}`.includes(query);
});
renderApplicants([...filtered].reverse());
});
}
</script>
</body>
</html>