<!-- Main Sidebar Container -->
<aside class="main-sidebar sidebar-dark-primary elevation-4">
    <!-- Brand Logo -->
    <a href="/spk-komputer/index.php" class="brand-link">
        <img src="/spk-komputer/assets/dist/img/AdminLTELogo.png" alt="AdminLTE Logo" class="brand-image img-circle elevation-3" style="opacity: .8">
        <span class="brand-text font-weight-light">SPK Komputer</span>
    </a>

    <!-- Sidebar -->
    <div class="sidebar">
        <!-- Sidebar user panel -->
        <div class="user-panel mt-3 pb-3 mb-3 d-flex">
            <div class="info">
                <a href="#" class="d-block"><?php echo htmlspecialchars($_SESSION['username'] ?? ''); ?></a>
            </div>
        </div>

        <!-- Sidebar Menu -->
        <nav class="mt-2">
            <ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu">
                <li class="nav-item">
                    <a href="/spk-komputer/index.php" class="nav-link">
                        <i class="nav-icon fas fa-tachometer-alt"></i>
                        <p>Dashboard</p>
                    </a>
                </li>
                
                <?php if (in_array(getUserRole(), ['super_admin', 'admin'])): ?>
                <li class="nav-item">
                    <a href="#" class="nav-link">
                        <i class="nav-icon fas fa-microchip"></i>
                        <p>
                            Komponen
                            <i class="right fas fa-angle-left"></i>
                        </p>
                    </a>
                    <ul class="nav nav-treeview">
                        <li class="nav-item">
                            <a href="/spk-komputer/modules/components/processor/" class="nav-link">
                                <i class="far fa-circle nav-icon"></i>
                                <p>Processor</p>
                            </a>
                        </li>
                        <li class="nav-item">
                            <a href="/spk-komputer/modules/components/motherboard/" class="nav-link">
                                <i class="far fa-circle nav-icon"></i>
                                <p>Motherboard</p>
                            </a>
                        </li>
                        <li class="nav-item">
                            <a href="/spk-komputer/modules/components/vga/" class="nav-link">
                                <i class="far fa-circle nav-icon"></i>
                                <p>VGA</p>
                            </a>
                        </li>
                        <li class="nav-item">
                            <a href="/spk-komputer/modules/components/ram/" class="nav-link">
                                <i class="far fa-circle nav-icon"></i>
                                <p>RAM</p>
                            </a>
                        </li>
                        <li class="nav-item">
                            <a href="/spk-komputer/modules/components/storage/" class="nav-link">
                                <i class="far fa-circle nav-icon"></i>
                                <p>Storage</p>
                            </a>
                        </li>
                        <li class="nav-item">
                            <a href="/spk-komputer/modules/components/power_supply/" class="nav-link">
                                <i class="far fa-circle nav-icon"></i>
                                <p>Power Supply</p>
                            </a>
                        </li>
                        <li class="nav-item">
                            <a href="/spk-komputer/modules/components/casing/" class="nav-link">
                                <i class="far fa-circle nav-icon"></i>
                                <p>Casing</p>
                            </a>
                        </li>
                    </ul>
                </li>
                <?php endif; ?>
				
				<?php if (getUserRole() === 'super_admin'): ?>
				<li class="nav-item">
					<a href="#" class="nav-link">
						<i class="nav-icon fas fa-cogs"></i>
						<p>
							Master Data
							<i class="right fas fa-angle-left"></i>
						</p>
					</a>
					<ul class="nav nav-treeview">
						<li class="nav-item">
							<a href="/spk-komputer/modules/master/socket/" class="nav-link">
								<i class="far fa-circle nav-icon"></i>
								<p>Socket Types</p>
							</a>
						</li>
						<li class="nav-item">
							<a href="/spk-komputer/modules/master/ram_type/" class="nav-link">
								<i class="far fa-circle nav-icon"></i>
								<p>RAM Types</p>
							</a>
						</li>
					</ul>
				</li>
				<?php endif; ?>
				
				
				
                <li class="nav-item">
                    <a href="/spk-komputer/modules/fuzzy/calculate.php" class="nav-link">
                        <i class="nav-icon fas fa-calculator"></i>
                        <p>Hitung Harga</p>
                    </a>
                </li>

                <?php if (getUserRole() === 'super_admin'): ?>
                <li class="nav-item">
                    <a href="/spk-komputer/admin/users.php" class="nav-link">
                        <i class="nav-icon fas fa-users"></i>
                        <p>Manajemen User</p>
                    </a>
                </li>
                <?php endif; ?>
                <li class="nav-item">
                    <a href="/spk-komputer/admin/foto.php" class="nav-link">
                        <i class="nav-icon fas fa-users"></i>
                        <p>Foto Komputer</p>
                    </a>
                </li>
            </ul>
        </nav>
    </div>
</aside>