-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbooks.html
More file actions
193 lines (175 loc) Β· 7.71 KB
/
books.html
File metadata and controls
193 lines (175 loc) Β· 7.71 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Books - 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 active">
<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" id="staffLink" style="display: none;">
<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>Books Management</h1>
<p class="text-muted">Manage library books inventory</p>
</div>
</div>
<button class="btn btn-primary" onclick="showAddModal()">+ Add Book</button>
</header>
<!-- Search & Filter -->
<div class="search-bar">
<input type="text" id="searchInput" class="search-input" placeholder="Search by title, author, or ISBN...">
<select id="categoryFilter" class="form-group" style="width: 200px; margin: 0;">
<option value="">All Categories</option>
</select>
<button class="btn btn-primary" onclick="loadBooks()">Search</button>
</div>
<!-- Books Table -->
<div class="card">
<div class="card-body">
<div class="table-container">
<table>
<thead>
<tr>
<th>ISBN</th>
<th>Title</th>
<th>Author</th>
<th>Category</th>
<th>Location</th>
<th>Quantity</th>
<th>Price</th>
<th>Actions</th>
</tr>
</thead>
<tbody id="booksTable">
<tr>
<td colspan="8" class="text-center">
<div class="loader" style="margin: 20px auto;"></div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</main>
</div>
<!-- Add/Edit Book Modal -->
<div id="bookModal" class="modal">
<div class="modal-content">
<div class="modal-header">
<h3 id="modalTitle">Add Book</h3>
<button class="modal-close" onclick="closeModal()">×</button>
</div>
<div class="modal-body">
<form id="bookForm">
<input type="hidden" id="bookId">
<div class="form-group">
<label for="isbn">ISBN *</label>
<input type="text" id="isbn" required>
</div>
<div class="form-group">
<label for="title">Title *</label>
<input type="text" id="title" required>
</div>
<div class="form-group">
<label for="author">Author *</label>
<input type="text" id="author" required>
</div>
<div class="form-group">
<label for="category">Category *</label>
<input type="text" id="category" required>
</div>
<div class="form-group">
<label for="location">Location *</label>
<input type="text" id="location" placeholder="e.g., Shelf A1" required>
</div>
<div class="form-group">
<label for="quantity">Quantity *</label>
<input type="number" id="quantity" min="0" required>
</div>
<div class="form-group">
<label for="price">Price (βΉ) *</label>
<input type="number" id="price" step="0.01" min="0" required>
</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="saveBook()">Save Book</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/books.js"></script>
</body>
</html>