       <div class="sidebar" id="sidebar">
        <div class="sidebar-header text-center">
            <h5 class="mb-0">Barangay Tual E-Complaint System</h5>
        </div>
        <div class="sidebar-menu">
            <ul class="nav flex-column">
                <li class="nav-item">
                    <a class="nav-link active click_page" data-page="dashboard.php">
                        <i class="fas fa-tachometer-alt"></i> <span>Dashboard</span>
                    </a>
                </li>
                <li class="nav-item">
                    <a class="nav-link click_page" data-page="complaints.php">
                        <i class="fas fa-list"></i> <span>My Complaints</span>
                         <?php

                        $id = $_SESSION['resident_id'];
                         $query = "select count(*) as total_complaint from tbl_transaction where resident_id = '$id' and status = 'Pending'";
                         $query_result = $conn->query($query);
                         $row = $query_result->fetch_assoc();
                         ?>
                   
                        <span class="badge badge-primary"><?= $row['total_complaint'] ?></span>
                    </a>
                </li>
                <li class="nav-item">
                    <a class="nav-link click_page" data-page="org_structure.php">
                        <i class="fas fa-users"></i> <span>About us</span>
                    </a>
                </li>
                <li class="nav-item">
                    <a class="nav-link click_page" data-page="profile.php">
                        <i class="fas fa-cog"></i> <span>Settings</span>
                    </a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="logout.php">
                        <i class="fas fa-sign-out-alt text-danger"></i> <span>Logout</span>
                    </a>
                </li>
                <li class="nav-item mt-4">
                    <a class="nav-link click_page" href="#">
                        <i class="fas fa-question-circle"></i> <span>Help & Support</span>
                    </a>
                </li>
            </ul>
        </div>
    </div>

