-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmin.html
More file actions
452 lines (387 loc) · 19.3 KB
/
admin.html
File metadata and controls
452 lines (387 loc) · 19.3 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
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Admin Dashboard</title>
<link rel="icon" type="image" href="./asset/img/logo.png">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
<link rel="stylesheet" href="./asset/css/admin.css">
<link rel="stylesheet" href="./asset/css/item.css">
</head>
<body>
<button class="sidebar-toggle" onclick="toggleSidebar()">☰</button>
<div class="sidebar">
<a href="index.html">
<img src="./asset/img/logo.png" alt="MOS Burger Logo" class="logo">
</a>
<ul>
<li><a href="#home" onclick="showSection('home')">HOME</a></li>
<li><a href="#staff" onclick="showSection('staff')">STAFF</a></li>
<li><a href="#customers" onclick="showSection('customers')">CUSTOMERS</a></li>
<li><a href="#orders" onclick="showSection('orders')">ORDERS</a></li>
<li><a href="#items" onclick="showSection('items')">ITEMS</a></li>
<li><a href="#reports" onclick="showSection('reports')">REPORTS</a></li>
<li>
<button id="btn-logout" class="logout-link" onclick="logout()">Logout</button>
</li>
</ul>
</div>
<div class="main-content">
<h1>Admin Dashboard</h1>
<section id="home" class="content-section">
<h2>Items</h2>
<div class="filter-buttons">
<button class="filter-btn active" data-category="ALL">ALL</button>
<button class="filter-btn" data-category="Burgers">Burgers</button>
<button class="filter-btn" data-category="Submarines">Submarines</button>
<button class="filter-btn" data-category="Fries">Fries</button>
<button class="filter-btn" data-category="Pasta">Pasta</button>
<button class="filter-btn" data-category="Chicken">Chicken</button>
<button class="filter-btn" data-category="Beverages">Beverages</button>
</div>
<div class="item-container" id="home-item-container">
</div>
<button id="cart-toggle"><i class="fa fa-shopping-cart"></i></button>
<div class="cart">
<h3>Cart</h3>
<label for="customer-select">Select Customer:</label>
<select id="customer-select">
</select>
<div id="cart-sidebar">
<ul id="cart-items">
</ul>
<div id="cart-summary">
<p>Total: <span id="total-price">0.00</span></p>
<p>Discount: <span id="discount-price">0.00</span></p>
<p>Final Total: <span id="final-total-price">0.00</span></p>
</div>
<button id="send-order-btn">Send to Orders</button>
<button id="generate-pdf-btn">Generate Bill PDF</button>
</div>
</div>
</section>
<section id="staff" class="content-section">
<h2>Staff Management</h2>
<div class="staff-buttons">
<button onclick="showModalContent('addStaff')">
<i class="fa fa-user-plus"></i>
<span>ADD STAFF MEMBER</span>
</button>
<button onclick="showModalContent('updateStaff')">
<i class="fa fa-user"></i>
<span>UPDATE STAFF MEMBER</span>
</button>
<button onclick="showModalContent('deleteStaff')">
<i class="fa fa-trash"></i>
<span>DELETE STAFF MEMBER</span>
</button>
<button onclick="showModalContent('viewStaff')">
<i class="fa fa-user"></i>
<span>VIEW STAFF</span>
</button>
</div>
<div id="staffModalContent" class="modal-content" >
</div>
</section>
<section id="customers" class="content-section">
<h2>Customer Management</h2>
<div class="customer-buttons">
<button onclick="showModalContent('addCustomer')">
<i class="fa fa-user-plus"></i>
<span>ADD CUSTOMER</span>
</button>
<button onclick="showModalContent('updateCustomer')">
<i class="fa fa-user"></i>
<span>UPDATE CUSTOMER</span>
</button>
<button onclick="showModalContent('deleteCustomer')">
<i class="fa fa-trash"></i>
<span>DELETE CUSTOMER</span>
</button>
<button onclick="showModalContent('viewCustomers')">
<i class="fa fa-users"></i>
<span>VIEW CUSTOMERS</span>
</button>
</div>
<div id="customerModalContent" class="modal-content">
</div>
</section>
<section id="orders" class="content-section">
<h2>Order Details</h2>
<input type="text" id="search-bar" placeholder="Enter Customer ID to search">
<button id="search-btn">Search</button>
<button id="clear-search-btn">Clear</button>
<div class="total-summary">
<b><p class="discount-price">Discount Price: Rs. X</p></b>
<b><p class="final-total-price">Final Total: Rs. Y</p></b>
</div>
<table id="orders-table">
<thead>
<tr>
<th>Date & Time</th>
<th>Customer Code</th>
<th>Customer Name</th>
<th>Items</th>
<th>Quantity</th>
<th>Price</th>
<th>Total Price</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</section>
<div id="home-item-container">
</div>
<section id="items" class="content-section">
<h2>Store Management</h2>
<div class="filter-buttons">
<button class="filter-btn active" data-category="ALL">ALL</button>
<button class="filter-btn" data-category="Burgers">Burgers</button>
<button class="filter-btn" data-category="Submarines">Submarines</button>
<button class="filter-btn" data-category="Fries">Fries</button>
<button class="filter-btn" data-category="Pasta">Pasta</button>
<button class="filter-btn" data-category="Chicken">Chicken</button>
<button class="filter-btn" data-category="Beverages">Beverages</button>
</div>
<button id="add-item-btn">Add New Item</button>
<div class="item-container" id="item-container">
</div>
<div id="edit-dialog" class="dialog">
<div class="dialog-content">
<span class="close-btn">×</span>
<h2>Edit Item</h2>
<form id="edit-form">
<input type="hidden" id="edit-item-id">
<label for="edit-item-code">Item Code:</label>
<input type="text" id="edit-item-code" name="itemCode" readonly>
<label for="edit-item-name">Item Name:</label>
<input type="text" id="edit-item-name" name="itemName">
<label for="edit-item-price">Price:</label>
<input type="number" id="edit-item-price" name="price" step="0.01">
<label for="edit-item-discount">Discount:</label>
<input type="number" id="edit-item-discount" name="discount" step="0.01">
<label for="edit-item-image">Image URL:</label>
<input type="text" id="edit-item-image" name="image">
<label for="edit-item-expiry">Expiry Date:</label>
<input type="date" id="edit-item-expiry" />
<button type="submit">Save</button><br>
</form>
</div>
</div>
<div id="add-dialog" class="dialog">
<div class="dialog-content">
<span class="close-btn" id="close-add-dialog">×</span>
<h2>Add New Item</h2>
<form id="add-form">
<label for="add-item-category">Category:</label>
<select id="add-item-category" name="category" required>
<option value="Burgers">Burgers</option>
<option value="Submarines">Submarines</option>
<option value="Fries">Fries</option>
<option value="Pasta">Pasta</option>
<option value="Chicken">Chicken</option>
<option value="Beverages">Beverages</option>
</select>
<label for="add-item-code">Item Code:</label>
<input type="text" id="add-item-code" name="itemCode" required>
<label for="add-item-name">Item Name:</label>
<input type="text" id="add-item-name" name="itemName" required>
<label for="add-item-price">Price:</label>
<input type="number" id="add-item-price" name="price" step="0.01" required>
<label for="add-item-discount">Discount:</label>
<input type="number" id="add-item-discount" name="discount" step="0.01">
<label for="add-item-image">Image URL:</label>
<input type="text" id="add-item-image" name="image" required>
<label for="add-item-expiry">Expiry Date:</label>
<input type="date" id="add-item-expiry" />
<button type="submit">Add Item</button><br>
</form>
</div>
</div>
</section>
<section id="reports" class="content-section">
<h2>Report Details</h2>
<div class="report-buttons">
<button id="monthly-report-btn">Generate Monthly Sales Report</button>
<button id="annual-report-btn">Generate Annual Sales Report</button>
<button id="top-customers-btn">View Top Customers of the Month</button>
<button id="food-items-report-btn">Generate Food Items Count Report</button>
</div>
<div id="report-output">
<!-- Monthly Sales Report -->
<div id="monthly-report" class="report-section">
<h3>Monthly Sales Report</h3>
<table id="monthly-report-table">
<thead>
<tr>
<th>Month</th>
<th>Total Price</th>
<th>Total Quantity</th>
</tr>
</thead>
<tbody>
<!-- Data will be dynamically inserted here -->
</tbody>
</table>
</div>
<!-- Annual Sales Report -->
<div id="annual-report" class="report-section">
<h3>Annual Sales Report</h3>
<table id="annual-report-table">
<thead>
<tr>
<th>Year</th>
<th>Total Sales Price</th>
</tr>
</thead>
<tbody>
<!-- Data will be dynamically inserted here -->
</tbody>
</table>
</div>
<!-- Top Customers Report -->
<div id="top-customers-report" class="report-section">
<h3>Top Customers of the Month</h3>
<table id="top-customers-table">
<thead>
<tr>
<th>Customer ID</th>
<th>Customer Name</th>
<th>Total Spent</th>
</tr>
</thead>
<tbody>
<!-- Data will be dynamically inserted here -->
</tbody>
</table>
</div>
<!-- Food Items Count Report -->
<div id="food-items-report" class="report-section">
<h3>Food Items Count Report</h3>
<table id="food-items-table">
<thead>
<tr>
<th>Item Name</th>
<th>Total Sold</th>
</tr>
</thead>
<tbody>
<!-- Data will be dynamically inserted here -->
</tbody>
</table>
</div>
</div>
</section>
</div>
<div id="addStaff" class="modal-template" style="display:none;">
<h2>Add Staff Member</h2>
<form id="addStaffForm">
<label for="staffId">Staff Member ID:</label>
<input type="text" id="staffId" name="staffId" required>
<label for="mobileNumber">Enter Mobile Number:</label>
<input type="text" id="mobileNumber" name="mobileNumber" required>
<label for="staffName">Staff Member Name:</label>
<input type="text" id="staffName" name="staffName" required>
<label for="staffAddress">Staff Member Address:</label>
<input type="text" id="staffAddress" name="staffAddress" required>
<label for="staffNIC">Staff Member NIC:</label>
<input type="text" id="staffNIC" name="staffNIC" required>
<button type="button" onclick="addStaffMember()">Add</button>
</form>
<button class="back-button" onclick="showStaffButtons()">Back</button>
</div>
<div id="updateStaff" class="modal-template" style="display:none;">
<h2>Update Staff Member</h2>
<form id="updateStaffForm">
<label for="updateStaffId">Staff Member ID:</label>
<input type="text" id="updateStaffId" name="updateStaffId" required>
<button type="button" onclick="fetchAndShowStaff('update')">Fetch Details</button>
<div id="updateStaffDetails"></div>
<button type="button" onclick="updateStaffMember()">Update</button>
</form>
<button class="back-button" onclick="showStaffButtons()">Back</button>
</div>
<div id="deleteStaff" class="modal-template" style="display:none;">
<h2>Delete Staff Member</h2>
<form id="deleteStaffForm">
<label for="deleteStaffId">Staff Member ID:</label>
<input type="text" id="deleteStaffId" name="deleteStaffId" required>
<button type="button" onclick="deleteStaffMember()">Delete</button>
</form>
<button class="back-button" onclick="showStaffButtons()">Back</button>
</div>
<div id="viewStaff" class="modal-template" style="display:none;">
<h2>View Staff</h2>
<table id="staffList" class="staff-list">
<thead>
<tr>
<th>ID</th>
<th>Name</th>
<th>Mobile</th>
<th>Address</th>
<th>NIC</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
<button class="back-button" onclick="showStaffButtons()">Back</button>
</div>
<div id="addCustomer" class="modal-template" style="display:none;">
<h2>Add Customer</h2>
<form id="addCustomerForm">
<label for="customerId">Customer ID:</label>
<input type="text" id="customerId" name="customerId" required>
<label for="customerName">Customer Name:</label>
<input type="text" id="customerName" name="customerName" required>
<label for="customerEmail">Customer Email:</label>
<input type="email" id="customerEmail" name="customerEmail" required>
<label for="customerPhone">Customer Phone:</label>
<input type="text" id="customerPhone" name="customerPhone" required>
<button type="button" onclick="addCustomer()">Add</button>
</form>
<button class="back-button" onclick="showCustomerButtons()">Back</button>
</div>
<div id="updateCustomer" class="modal-template" style="display:none;">
<h2>Update Customer</h2>
<form id="updateCustomerForm">
<label for="updateCustomerId">Customer ID:</label>
<input type="text" id="updateCustomerId" name="updateCustomerId" required>
<button type="button" onclick="fetchAndShowCustomer('update')">Fetch Details</button>
<div id="updateCustomerDetails"></div>
<button type="button" onclick="updateCustomer()">Update</button>
</form>
<button class="back-button" onclick="showCustomerButtons()">Back</button>
</div>
<div id="deleteCustomer" class="modal-template" style="display:none;">
<h2>Delete Customer</h2>
<form id="deleteCustomerForm">
<label for="deleteCustomerId">Customer ID:</label>
<input type="text" id="deleteCustomerId" name="deleteCustomerId" required>
<button type="button" onclick="deleteCustomer()">Delete</button>
</form>
<button class="back-button" onclick="showCustomerButtons()">Back</button>
</div>
<div id="viewCustomers" class="modal-template" style="display:none;">
<h2>View Customers</h2>
<table id="customerList" class="customer-list">
<thead>
<tr>
<th>ID</th>
<th>Name</th>
<th>Email</th>
<th>Phone</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
<button class="back-button" onclick="showCustomerButtons()">Back</button>
</div>
<script src="./asset/js/admin.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf-autotable/3.5.25/jspdf.plugin.autotable.min.js"></script>
</body>
</html>