-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuser_admin.php
More file actions
122 lines (111 loc) · 3.47 KB
/
Copy pathuser_admin.php
File metadata and controls
122 lines (111 loc) · 3.47 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Admin Login</title>
<style>
body {
margin: 0;
padding: 0;
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background: linear-gradient(120deg, #2b2f77, #ff5ca2);
}
.login-box {
width: 380px;
padding: 40px;
border-radius: 20px;
backdrop-filter: blur(15px);
background: rgba(255, 255, 255, 0.95);
color: #333;
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
text-align: center;
}
.login-box h2 {
margin-bottom: 25px;
color: #0b5ed7;
}
.login-box input {
width: 100%;
padding: 12px;
margin: 10px 0;
border: 1px solid #cbd5e1;
border-radius: 10px;
outline: none;
font-size: 14px;
background: #ffffff;
color: #333;
}
.login-box button {
width: 100%;
padding: 12px;
background: #0b5ed7;
color: #fff;
border: none;
border-radius: 10px;
font-weight: bold;
cursor: pointer;
transition: background 0.3s ease;
}
.login-box button:hover {
background: #084aaa;
}
.error {
color: #ff5555;
margin-top: 10px;
font-size: 14px;
}
.nav-links a {
color: #0b5ed7;
text-decoration: none;
font-weight: 600;
transition: color 0.3s ease;
}
.nav-links a:hover {
color: #084aaa;
text-decoration: underline;
}
</style>
</head>
<body>
<div class="login-box">
<h2>Admin Login</h2>
<form action="admin_login_process.php" method="POST" autocomplete="on" novalidate id="adminLoginForm">
<input type="text" id="office_id" name="office_id" placeholder="Enter Office ID" required autocomplete="username" autocapitalize="off" autocorrect="off" spellcheck="false" style="border: 1px solid #cbd5e1;">
<input type="password" id="password" name="password" placeholder="Enter Password" required autocomplete="current-password" autocapitalize="off" autocorrect="off" style="border: 1px solid #cbd5e1;">
<button type="submit">Login</button>
</form>
<script>
// Validate office_id on blur - reject email format
document.getElementById('office_id').addEventListener('blur', function() {
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
if (emailRegex.test(this.value)) {
alert('Please enter your Office ID, not your email address.');
this.value = '';
this.focus();
}
});
// Validate fields on form submission
document.getElementById('adminLoginForm').addEventListener('submit', function(e) {
if (!document.getElementById('office_id').value || !document.getElementById('password').value) {
e.preventDefault();
alert('Please fill in all fields.');
}
});
</script>
<!-- Error message example -->
<!-- <div class="error">Invalid office_id or password</div> -->
<div class="nav-links" style="margin-top: 20px;">
<a href="forgot_password.php?role=admin">Forgot Password?</a> <br>
<a href="#"
onclick="if (window.parent && window.parent.swapBack) { window.parent.swapBack(); } else { window.location.href='index.php'; } return false;">
← Back
</a>
</div>
</div>
</body>
</html>