71 lines
3.2 KiB
PHP
71 lines
3.2 KiB
PHP
<?php
|
|
$current_page = basename($_SERVER['PHP_SELF']);
|
|
?>
|
|
<nav id="sidebar" class="d-flex flex-column flex-shrink-0 p-3">
|
|
<a href="/" class="d-flex align-items-center mb-3 mb-md-0 me-md-auto text-decoration-none">
|
|
<span class="fs-4">IC-Inventory</span>
|
|
</a>
|
|
<hr>
|
|
<ul class="nav nav-pills flex-column mb-auto">
|
|
<li class="nav-item">
|
|
<a href="index.php" class="nav-link <?php echo ($current_page === 'index.php') ? 'active' : ''; ?>" aria-current="page">
|
|
<i data-feather="home" class="me-2"></i>
|
|
Dashboard
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a href="index.php" class="nav-link <?php echo ($current_page === 'add-asset.php' || $current_page === 'edit-asset.php') ? 'active' : ''; ?>">
|
|
<i data-feather="box" class="me-2"></i>
|
|
Assets
|
|
</a>
|
|
</li>
|
|
<?php if (can($_SESSION['user_role_id'], 'user', 'read')): ?>
|
|
<li>
|
|
<a href="users.php" class="nav-link <?php echo ($current_page === 'users.php' || $current_page === 'add-user.php' || $current_page === 'edit-user.php') ? 'active' : ''; ?>">
|
|
<i data-feather="users" class="me-2"></i>
|
|
Users
|
|
</a>
|
|
</li>
|
|
<?php endif; ?>
|
|
<?php if (can($_SESSION['user_role_id'], 'category', 'read')): ?>
|
|
<li>
|
|
<a href="categories.php" class="nav-link <?php echo ($current_page === 'categories.php' || $current_page === 'add-category.php' || $current_page === 'edit-category.php') ? 'active' : ''; ?>">
|
|
<i data-feather="grid" class="me-2"></i>
|
|
Categories
|
|
</a>
|
|
</li>
|
|
<?php endif; ?>
|
|
<?php if (can($_SESSION['user_role_id'], 'location', 'read')): ?>
|
|
<li>
|
|
<a href="locations.php" class="nav-link <?php echo ($current_page === 'locations.php' || $current_page === 'add-location.php' || $current_page === 'edit-location.php') ? 'active' : ''; ?>">
|
|
<i data-feather="map-pin" class="me-2"></i>
|
|
Locations
|
|
</a>
|
|
</li>
|
|
<?php endif; ?>
|
|
<?php if (can($_SESSION['user_role_id'], 'role', 'read')): ?>
|
|
<li>
|
|
<a href="roles.php" class="nav-link <?php echo ($current_page === 'roles.php' || $current_page === 'add-role.php' || $current_page === 'edit-role.php') ? 'active' : ''; ?>">
|
|
<i data-feather="shield" class="me-2"></i>
|
|
Roles
|
|
</a>
|
|
</li>
|
|
<?php endif; ?>
|
|
<?php if (can($_SESSION['user_role_id'], 'permission', 'update')): ?>
|
|
<li>
|
|
<a href="settings.php" class="nav-link <?php echo ($current_page === 'settings.php') ? 'active' : ''; ?>">
|
|
<i data-feather="settings" class="me-2"></i>
|
|
Settings
|
|
</a>
|
|
</li>
|
|
<?php endif; ?>
|
|
</ul>
|
|
<hr>
|
|
<div>
|
|
<span class="d-flex align-items-center text-decoration-none"><strong><?php echo htmlspecialchars($_SESSION['user_name']); ?></strong></span>
|
|
<a href="logout.php" class="d-flex align-items-center text-decoration-none">
|
|
<i data-feather="log-out" class="me-2"></i>
|
|
<strong>Logout</strong>
|
|
</a>
|
|
</div>
|
|
</nav>
|