forked from James471/foundation-day-2022
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadmin.html
61 lines (60 loc) · 2.32 KB
/
admin.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Admin Dashboard</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<script>
function checkCredentials() {
const username = document.getElementById("username").value;
const password = document.getElementById("password").value;
if (username === "admin" && password === "password") {
document.getElementById("authSection").style.display = "none";
document.getElementById("dataSection").style.display = "block";
} else {
document.getElementById("restrictedMessage").style.display = "block";
}
}
</script>
</head>
<body>
<div id="authSection" class="container mt-5">
<h2>Login</h2>
<label for="username">Username: </label>
<input type="text" id="username" class="form-control"><br>
<label for="password">Password: </label>
<input type="password" id="password" class="form-control"><br>
<button onclick="checkCredentials()" class="btn btn-primary">Login</button>
<div id="restrictedMessage" style="display:none; color: red; margin-top: 10px;">
Restricted Page
</div>
</div>
<div id="dataSection" style="display:none;" class="container mt-5">
<h2>Admin Dashboard</h2>
<table class="table table-bordered">
<thead>
<tr>
<th>ID</th>
<th>Candidate's Name</th>
<th>Institution Name</th>
<th>Grade/Class</th>
<th>Mobile Number</th>
<th>Email ID</th>
</tr>
</thead>
<tbody>
{% for registration in registrations %}
<tr>
<td>{{ registration.id }}</td>
<td>{{ registration.candidateName }}</td>
<td>{{ registration.institutionName }}</td>
<td>{{ registration.grade }}</td>
<td>{{ registration.mobileNumber }}</td>
<td>{{ registration.emailId }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</body>
</html>