-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstaff.html
More file actions
186 lines (169 loc) Β· 7.28 KB
/
staff.html
File metadata and controls
186 lines (169 loc) Β· 7.28 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Staff Management - Library Management System</title>
<!-- Favicon -->
<link rel="icon" type="image/svg+xml" href="favicon.svg">
<link rel="alternate icon" href="favicon.svg">
<link rel="mask-icon" href="favicon.svg" color="#2563eb">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<div class="container">
<!-- Sidebar -->
<aside class="sidebar">
<div class="sidebar-header">
<div class="logo-small">
<svg width="30" height="30" viewBox="0 0 24 24" fill="none" stroke="currentColor">
<path d="M4 19.5A2.5 2.5 0 0 1 6.5 17H20"></path>
<path d="M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"></path>
</svg>
</div>
<h2>Library MS</h2>
</div>
<nav class="sidebar-nav">
<a href="dashboard.html" class="nav-item">
<span class="icon">π</span>
<span>Dashboard</span>
</a>
<a href="books.html" class="nav-item">
<span class="icon">π</span>
<span>Books</span>
</a>
<a href="members.html" class="nav-item">
<span class="icon">π₯</span>
<span>Members</span>
</a>
<a href="loans.html" class="nav-item">
<span class="icon">π</span>
<span>Loans</span>
</a>
<a href="fines.html" class="nav-item">
<span class="icon">π°</span>
<span>Fines</span>
</a>
<a href="reports.html" class="nav-item">
<span class="icon">π</span>
<span>Reports</span>
</a>
<a href="staff.html" class="nav-item active">
<span class="icon">π</span>
<span>Staff</span>
</a>
<a href="login-logs.html" class="nav-item" id="loginLogsLink" style="display: none;">
<span class="icon">π</span>
<span>Login Logs</span>
</a>
</nav>
<div class="sidebar-footer">
<button onclick="logout()" class="btn btn-danger btn-block">Logout</button>
</div>
</aside>
<!-- Sidebar Overlay for Mobile -->
<div class="sidebar-overlay" id="sidebarOverlay"></div>
<!-- Main Content -->
<main class="main-content">
<!-- Header -->
<header class="page-header">
<div>
<!-- Hamburger Menu Button -->
<button class="hamburger" id="hamburger" aria-label="Toggle menu">
<span></span>
<span></span>
<span></span>
</button>
<div>
<h1>Staff Management</h1>
<p class="text-muted">Manage library staff (Admin Only)</p>
</div>
</div>
<button class="btn btn-primary" onclick="showAddModal()">+ Add Staff</button>
</header>
<!-- Staff Table -->
<div class="card">
<div class="card-body">
<div class="table-container">
<table>
<thead>
<tr>
<th>Staff ID</th>
<th>Name</th>
<th>Username</th>
<th>Role</th>
<th>Actions</th>
</tr>
</thead>
<tbody id="staffTable">
<tr>
<td colspan="5" class="text-center">
<div class="loader" style="margin: 20px auto;"></div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</main>
</div>
<!-- Add/Edit Staff Modal -->
<div id="staffModal" class="modal">
<div class="modal-content">
<div class="modal-header">
<h3 id="modalTitle">Add Staff</h3>
<button class="modal-close" onclick="closeModal()">×</button>
</div>
<div class="modal-body">
<form id="staffForm">
<input type="hidden" id="staffId">
<div class="form-group">
<label for="firstName">First Name *</label>
<input type="text" id="firstName" required>
</div>
<div class="form-group">
<label for="lastName">Last Name *</label>
<input type="text" id="lastName" required>
</div>
<div class="form-group">
<label for="username">Username *</label>
<input type="text" id="username" required>
</div>
<div class="form-group">
<label for="password">Password *</label>
<input type="password" id="password" required>
</div>
<div class="form-group">
<label for="email">Email</label>
<input type="email" id="email">
</div>
<div class="form-group">
<label for="phone">Phone</label>
<input type="tel" id="phone">
</div>
<div class="form-group">
<label for="role">Role *</label>
<select id="role" required>
<option value="">Select Role</option>
<option value="Admin">Admin</option>
<option value="Librarian">Librarian</option>
<option value="Assistant">Assistant</option>
</select>
</div>
<div id="modalError" class="error-message" style="display: none;"></div>
<div id="modalSuccess" class="success-message" style="display: none;"></div>
</form>
</div>
<div class="modal-footer">
<button class="btn btn-secondary" onclick="closeModal()">Cancel</button>
<button class="btn btn-primary" onclick="saveStaff()">Save Staff</button>
</div>
</div>
</div>
<script src="js/config.js"></script>
<script src="js/auth.js"></script>
<script src="js/mobile.js"></script>
<script src="js/staff.js"></script>
</body>
</html>