-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuserhome.html
73 lines (67 loc) · 2.24 KB
/
userhome.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
62
63
64
65
66
67
68
69
70
71
72
73
<!DOCTYPE html>
<html>
<head>
<title>User Panel</title>
<link rel="stylesheet" type="text/css" href="styles.css">
</head>
<body>
<nav class="navbar">
<div id="mySidenav" class="sidenav">
<a href="javascript:void(0)" class="closebtn" onclick="closeNav()">×</a>
<a href="userhome.html">Home</a>
<a href="managecustomer.html">Customer Management</a>
<a href="transaction.html">Transaction</a>
<a href="manageitem.html">Stock Management</a>
<a href="updatepassword.html">Update Password</a>
</div>
<span class="open" onclick="openNav()">  ☰  
<div class="logo">
<a href="">
<img src="assets/sale-sign.png" alt="SDS_logo">
<span>  SALES PILOT  </span>
<img src="assets/cashier-machine.png" alt="SDS_logo">
</a>
</div>
</span>
<a class="logout" href="#" onclick="logout()">Log Out  </a>
</nav>
<table class="userHome">
<tr>
<th>
<button type="button" onclick="window.location.href='managecustomer.html'">
<img src="assets/customer.png" width="80" height="80"><br>Customer Management
</button>
</th>
<th>
<button type="button" onclick="window.location.href='transaction.html'">
<img src="assets/transaction.png" width="80" height="80"><br>Transaction
</button>
</th>
<th>
<button type="button" onclick="window.location.href='manageitem.html'">
<img src="assets/stock.png" width="80" height="80"><br>Stock Management
</button>
</th>
</tr>
</table>
<script>
const token = localStorage.getItem("token");
if (!token) {
window.location.href = "login.html";
}
// Open Side Navigation Bar
function openNav() {
document.getElementById("mySidenav").style.width = "280px";
}
// Close Side Navigation Bar
function closeNav() {
document.getElementById("mySidenav").style.width = "0";
}
// Logout and clear data from local storage
function logout() {
localStorage.removeItem("token");
window.location.href = "login.html";
}
</script>
</body>
</html>