<div class="sidebar">
    <div class="sidebar-header px-3 py-3 text-white fw-bold border-bottom">
        <i class="bi bi-grid-1x2-fill"></i> Admin Menu
    </div>

    <ul class="list-unstyled px-2 mt-3">

        <!-- Manage Complaint -->
        <li>
            <a class="d-flex justify-content-between align-items-center" data-bs-toggle="collapse" href="#complaintMenu" role="button" aria-expanded="false" aria-controls="complaintMenu">
                <span><i class="bi bi-wrench-adjustable-circle"></i> Manage Complaints</span>
                <i class="bi bi-chevron-down small"></i>
            </a>
            <div class="collapse ps-3" id="complaintMenu">

                <!-- Not Processed -->
                <a href="notprocess-complaint.php" class="d-flex justify-content-between align-items-center">
                    <span><i class="bi bi-hourglass-split"></i> Not Processed</span>
                    <span class="badge bg-warning text-dark">
                        <?php
                        $rt = mysqli_query($bd, "SELECT * FROM tblcomplaints WHERE status IS NULL");
                        echo mysqli_num_rows($rt);
                        ?>
                    </span>
                </a>

                <!-- Pending -->
                <a href="inprocess-complaint.php" class="d-flex justify-content-between align-items-center">
                    <span><i class="bi bi-hourglass-top"></i> Pending</span>
                    <span class="badge bg-info text-dark">
                        <?php 
                        $status="in Process";                   
                        $rt = mysqli_query($bd, "SELECT * FROM tblcomplaints WHERE status='$status'");
                        echo mysqli_num_rows($rt);
                        ?>
                    </span>
                </a>

                <!-- Closed -->
                <a href="closed-complaint.php" class="d-flex justify-content-between align-items-center">
                    <span><i class="bi bi-check-circle"></i> Closed</span>
                    <span class="badge bg-success">
                        <?php 
                        $status="closed";                   
                        $rt = mysqli_query($bd, "SELECT * FROM tblcomplaints WHERE status='$status'");
                        echo mysqli_num_rows($rt);
                        ?>
                    </span>
                </a>
            </div>
        </li>

        <hr class="text-secondary mx-2">

        <!-- Manage Users -->
        <li>
            <a href="manage-users.php"><i class="bi bi-people"></i> Manage Users</a>
        </li>

        <hr class="text-secondary mx-2">

        <!-- Category & Subcategory -->
        <li>
            <a class="d-flex justify-content-between align-items-center" data-bs-toggle="collapse" href="#categoryMenu" role="button" aria-expanded="false" aria-controls="categoryMenu">
                <span><i class="bi bi-tags"></i> Categories</span>
                <i class="bi bi-chevron-down small"></i>
            </a>
            <div class="collapse ps-3" id="categoryMenu">
                <a href="category.php"><i class="bi bi-plus-circle"></i> Add Category</a>
                <a href="subcategory.php"><i class="bi bi-plus-square"></i> Add Sub-Category</a>
            </div>
        </li>

        <hr class="text-secondary mx-2">

        <!-- University -->
        <li>
            <a class="d-flex justify-content-between align-items-center" data-bs-toggle="collapse" href="#eduMenu" role="button" aria-expanded="false" aria-controls="eduMenu">
                <span><i class="bi bi-building"></i> University / College</span>
                <i class="bi bi-chevron-down small"></i>
            </a>
            <div class="collapse ps-3" id="eduMenu">
                <a href="university.php"><i class="bi bi-bank"></i> Add University</a>
                <a href="college.php"><i class="bi bi-bank2"></i> Add College</a>
                <a href="department.php"><i class="bi bi-diagram-3"></i> Add Department</a>
            </div>
        </li>

        <hr class="text-secondary mx-2">

        <!-- Logs -->
        <li><a href="user-logs.php"><i class="bi bi-clock-history"></i> User Login Log</a></li>

        <hr class="text-secondary mx-2">

        <!-- Logout -->
        <li><a href="logout.php" class="text-danger"><i class="bi bi-box-arrow-right"></i> Logout</a></li>
    </ul>
</div>
