<?php
$current_page = basename($_SERVER['PHP_SELF']);
?>
<div class="col-md-3 col-lg-2 d-md-block sidebar collapse">
    <div class="position-sticky pt-3">
        <ul class="nav flex-column">
            <li class="nav-item">
                <a class="nav-link <?php echo $current_page === 'dashboard.php' ? 'active' : ''; ?> px-3 py-2" href="dashboard.php">
                    <i class="bi bi-speedometer2 me-2"></i>
                    لوحة التحكم
                </a>
            </li>
            <li class="nav-item">
                <a class="nav-link <?php echo $current_page === 'subscribers.php' ? 'active' : ''; ?> px-3 py-2" href="subscribers.php">
                    <i class="bi bi-people me-2"></i>
                    المشتركون
                </a>
            </li>

            <li class="nav-item">
                <a class="nav-link <?php echo $current_page === 'delete_subscriber.php' ? 'active' : ''; ?> px-3 py-2" href="delete_subscriber.php">
                    <i class="bi bi-person-x me-2"></i>
                    حذف المشتركين
                </a>
            </li>
            <li class="nav-item">
                <a class="nav-link <?php echo $current_page === 'subscriber_debts.php' ? 'active' : ''; ?> px-3 py-2" href="subscriber_debts.php">
                    <i class="bi bi-cash-coin me-2"></i>
                    ديون المشتركين
                </a>
            </li>
            <li class="nav-item">
                <a class="nav-link <?php echo $current_page === 'consumption.php' ? 'active' : ''; ?> px-3 py-2" href="consumption.php">
                    <i class="bi bi-droplet me-2"></i>
                    الاستهلاك
                </a>
            </li>
            <li class="nav-item">
                <a class="nav-link <?php echo $current_page === 'bulk_readings.php' ? 'active' : ''; ?> px-3 py-2" href="bulk_readings.php">
                    <i class="bi bi-table me-2"></i>
                    قراءات جماعية
                </a>
            </li>

            <li class="nav-item">
                <a class="nav-link <?php echo $current_page === 'correct_readings.php' ? 'active' : ''; ?> px-3 py-2" href="correct_readings.php">
                    <i class="bi bi-pencil-square me-2"></i>
                    تصحيح القراءات
                </a>
            </li>
            <li class="nav-item">
                <a class="nav-link <?php echo $current_page === 'invoices.php' ? 'active' : ''; ?> px-3 py-2" href="invoices.php">
                    <i class="bi bi-receipt me-2"></i>
                    الفواتير
                </a>
            </li>
            <li class="nav-item dropdown">
                <a class="nav-link dropdown-toggle" href="#" id="financialDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
                    <i class="fas fa-money-bill"></i>
                    المالية
                </a>
                <ul class="dropdown-menu" aria-labelledby="financialDropdown">
                    <li><a class="dropdown-item" href="cash_fund.php">الصندوق المالي</a></li>
                    <li><a class="dropdown-item" href="bank_account.php">الحساب البنكي</a></li>
                    <li><a class="dropdown-item" href="financial_entry.php">تسجيل معاملة مالية</a></li>
                    <li><a class="dropdown-item" href="financial_report.php">التقرير المالي</a></li>
                </ul>
            </li>
            <li class="nav-item">
                <a class="nav-link <?php echo $current_page === 'reports.php' ? 'active' : ''; ?> px-3 py-2" href="reports.php">
                    <i class="bi bi-graph-up me-2"></i>
                    التقارير
                </a>
            </li>
            <li class="nav-item">
                <a class="nav-link <?php echo $current_page === 'users.php' ? 'active' : ''; ?> px-3 py-2" href="users.php">
                    <i class="bi bi-people-fill me-2"></i>
                    المستخدمون
                </a>
            </li>
         
          
            <li class="nav-item">
                <a class="nav-link <?php echo $current_page === 'settings.php' ? 'active' : ''; ?> px-3 py-2" href="settings.php">
                    <i class="bi bi-gear me-2"></i>
                    الإعدادات
                </a>
            </li>
            <li class="nav-item">
                <a class="nav-link px-3 py-2" href="logout.php">
                    <i class="bi bi-box-arrow-right me-2"></i>
                    تسجيل الخروج
                </a>
            </li>
        </ul>
    </div>
</div>

<style>
.sidebar {
    min-height: 100vh;
    background: beige;
    color: blue;
    font-weight: bolder;
    float: right;
}
.sidebar a {
    color: blue;
    text-decoration: none;
    
}
.sidebar a:hover {
    background: yellow;
}
.sidebar .active {
    background: greenyellow;
    color: black;
}

.sidebar li {
    float: left;
}

</style>
