<?php
// Mengambil nama file yang sedang aktif saat ini di browser
$current_page = basename($_SERVER['PHP_SELF']);
?>

<aside class="main-sidebar sidebar-dark-primary elevation-4">

    <a href="dashboard.php" class="brand-link">
        <span class="brand-text font-weight-light ml-2">
            Sistem Perpustakaan
        </span>
    </a>

    <div class="sidebar">

        <div class="user-panel mt-3 pb-3 mb-3 d-flex">
            <div class="image">
                <img src="upload/logo_stikom.jpg"
                     width="35"
                     height="35"
                     class="img-circle elevation-2">
            </div>
            <div class="info">
                <a href="#" class="d-block">
                    STIKOM Tunas Bangsa
                </a>
            </div>
        </div>

        <nav class="mt-2">
            <ul class="nav nav-pills nav-sidebar flex-column" role="menu">

                <li class="nav-item">
                    <a href="dashboard.php" class="nav-link <?= ($current_page == 'dashboard.php') ? 'active' : ''; ?>">
                        <i class="nav-icon fas fa-tachometer-alt"></i>
                        <p>Dashboard</p>
                    </a>
                </li>

                <li class="nav-item">
                    <a href="anggota.php" class="nav-link <?= ($current_page == 'anggota.php') ? 'active' : ''; ?>">
                        <i class="nav-icon fas fa-users"></i>
                        <p>Data Anggota</p>
                    </a>
                </li>

                <li class="nav-item">
                    <a href="buku.php" class="nav-link <?= ($current_page == 'buku.php') ? 'active' : ''; ?>">
                        <i class="nav-icon fas fa-book"></i>
                        <p>Data Buku</p>
                    </a>
                </li>

                <li class="nav-item">
                    <a href="peminjaman.php" class="nav-link <?= ($current_page == 'peminjaman.php') ? 'active' : ''; ?>">
                        <i class="nav-icon fas fa-book-reader"></i>
                        <p>Peminjaman Buku</p>
                    </a>
                </li>

                <li class="nav-item">
                    <a href="pengembalian.php" class="nav-link <?= ($current_page == 'pengembalian.php') ? 'active' : ''; ?>">
                        <i class="nav-icon fas fa-undo"></i>
                        <p>Pengembalian Buku</p>
                    </a>
                </li>

                <li class="nav-item">

<a href="buku_tamu.php"
class="nav-link <?= ($current_page == 'buku_tamu.php') ? 'active' : ''; ?>">

<i class="nav-icon fas fa-book"></i>

<p>
Buku Tamu
</p>

</a>

</li>

                <li class="nav-item">
                    <a href="laporan.php" class="nav-link <?= ($current_page == 'laporan.php') ? 'active' : ''; ?>">
                        <i class="nav-icon fas fa-file-alt"></i>
                        <p>Laporan</p>
                    </a>
                </li>

                <li class="nav-item">
                    <a href="user.php" class="nav-link <?= ($current_page == 'user.php') ? 'active' : ''; ?>">
                        <i class="nav-icon fas fa-user"></i>
                        <p>Manajemen User</p>
                    </a>
                </li>

                <li class="nav-item">
                    <a href="pengaturan.php" class="nav-link <?= ($current_page == 'pengaturan.php') ? 'active' : ''; ?>">
                        <i class="nav-icon fas fa-cog"></i>
                        <p>Pengaturan</p>
                    </a>
                </li>

                <li class="nav-item">
                    <a href="logout.php" class="nav-link" onclick="return confirm('Yakin ingin logout?')">
                        <i class="nav-icon fas fa-sign-out-alt"></i>
                        <p>Keluar</p>
                    </a>
                </li>

            </ul>
        </nav>

    </div>
</aside>