-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnavbar.php
More file actions
103 lines (92 loc) · 3.13 KB
/
navbar.php
File metadata and controls
103 lines (92 loc) · 3.13 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
<style>
/* Sidebar Styling */
#sidebar {
width: 250px;
height: 100vh;
position: fixed;
left: 0;
top: 0;
background: white;
transition: all 0.3s;
z-index: 1000;
box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
padding-top: 20px;
}
.sidebar-list {
padding: 10px;
}
.nav-item {
display: block;
padding: 10px 15px;
color: black;
text-decoration: none;
font-size: 16px;
transition: 0.3s;
}
.nav-item:hover, .nav-item.active {
background: #007bff;
color: white;
}
/* Adjust Content Area */
#content {
margin-left: 250px;
padding: 20px;
transition: 0.3s;
}
/* Responsive Sidebar */
@media screen and (max-width: 768px) {
#sidebar {
left: -250px;
position: fixed;
}
#content {
margin-left: 0;
}
.sidebar-toggle {
display: block;
}
}
/* Sidebar Toggle Button */
.sidebar-toggle {
position: fixed;
left: 260px;
top: 10px;
background: #007bff;
color: white;
border: none;
padding: 8px 12px;
cursor: pointer;
display: none;
z-index: 1100;
}
</style>
<nav id="sidebar">
<div class="sidebar-list">
<a href="index.php?page=home" class="nav-item nav-home"><i class="fa fa-home"></i> Home</a>
<a href="index.php?page=departments" class="nav-item nav-departments"><i class="fa fa-building"></i> Departments</a>
<a href="index.php?page=members" class="nav-item nav-members"><i class="fa fa-users"></i> Members</a>
<a href="index.php?page=view_members_agreement" class="nav-item nav-agreements"><i class="fa fa-file-signature"></i> Agreements</a>
<a href="index.php?page=contributions" class="nav-item nav-contributions"><i class="fa fa-money-check"></i> Contributions</a>
<a href="index.php?page=memberloan" class="nav-item nav-borrowers"><i class="fa fa-user-friends"></i> Loan</a>
<a href="index.php?page=loan_repayment" class="nav-item nav-plan"><i class="fa fa-list-alt"></i> Loan Repayment</a>
<a href="index.php?page=view_loan" class="nav-item nav-plan"><i class="fa fa-list-alt"></i> View Loan</a>
<a href="index.php?page=users" class="nav-item nav-users"><i class="fa fa-users"></i> Users</a>
<a href="ajax.php?action=logout" class="nav-item nav-logout"><i class="fa fa-lock"></i> Logout</a>
</div>
</nav>
<!-- Sidebar Toggle Script -->
<script>
function toggleSidebar() {
var sidebar = document.getElementById("sidebar");
var content = document.getElementById("content");
if (sidebar.style.left === "0px") {
sidebar.style.left = "-250px";
content.style.marginLeft = "0";
} else {
sidebar.style.left = "0px";
content.style.marginLeft = "250px";
}
}
// Highlight Active Page
document.querySelector('.nav-<?php echo isset($_GET["page"]) ? $_GET["page"] : "" ?>')?.classList.add('active');
</script>