<?php
$currentPath = $_SERVER['PHP_SELF'];
?>

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

    <a href="/admin/index.php" class="brand-link text-center">
        <span class="brand-text font-weight-light"
              style="color:#C9A24D; font-family:'Playfair Display', serif;">
            Exclusive Concierge
        </span>
    </a>

    <div class="sidebar">

        <nav class="mt-3">
            <ul class="nav nav-pills nav-sidebar flex-column nav-flat"
                data-widget="treeview"
                role="menu">

                <!-- Dashboard -->
                <li class="nav-item">
                    <a href="/admin/index.php"
                       class="nav-link <?= strpos($currentPath, '/admin/index.php') !== false ? 'active' : '' ?>">
                        <i class="nav-icon fas fa-tachometer-alt"></i>
                        <p>Dashboard</p>
                    </a>
                </li>

                <!-- Bookings -->
                <li class="nav-item">
                    <a href="/admin/bookings/"
                       class="nav-link <?= strpos($currentPath, '/admin/bookings/') !== false ? 'active' : '' ?>">
                        <i class="nav-icon fas fa-clipboard-list"></i>
                        <p>Bookings</p>
                    </a>
                </li>
                
                <!-- PAYMENTS -->
                <li class="nav-item">
                    <a href="/admin/payments/"
                    class="nav-link <?php echo strpos($currentPath, '/admin/payments/') !== false ? 'active' : ''; ?>">
                    <i class="nav-icon fas fa-credit-card"></i>
                    <p>Payments</p>
                    </a>
                </li>

                <!-- Customers -->
                <li class="nav-item">
                    <a href="/admin/customers/"
                       class="nav-link <?= strpos($currentPath, '/admin/customers/') !== false ? 'active' : '' ?>">
                        <i class="nav-icon fas fa-users"></i>
                        <p>Customers</p>
                    </a>
                </li>

                <!-- Drivers -->
                <li class="nav-item">
                    <a href="/admin/drivers/"
                       class="nav-link <?= strpos($currentPath, '/admin/drivers/') !== false ? 'active' : '' ?>">
                        <i class="nav-icon fas fa-car"></i>
                        <p>Drivers</p>
                    </a>
                </li>

                <!-- Fleet -->
                <li class="nav-item">
                    <a href="/admin/fleet/"
                       class="nav-link <?= strpos($currentPath, '/admin/fleet/') !== false ? 'active' : '' ?>">
                        <i class="nav-icon fas fa-shuttle-van"></i>
                        <p>Fleet Management</p>
                    </a>
                </li>

                <!-- CONFIGURATION -->
                <li class="nav-header" style="color:#C9A24D;">CONFIGURATION</li>

                <!-- Services -->
                <li class="nav-item">
                    <a href="/admin/pricing/services.php"
                       class="nav-link <?= strpos($currentPath, '/admin/pricing/') !== false ? 'active' : '' ?>">
                        <i class="nav-icon fas fa-tags"></i>
                        <p>Services & Pricing</p>
                    </a>
                </li>

                <!-- Driver Payouts -->
                <li class="nav-item">
                    <a href="/admin/drivers/payouts.php"
                       class="nav-link <?= strpos($currentPath, 'payouts.php') !== false ? 'active' : '' ?>">
                        <i class="nav-icon fas fa-wallet"></i>
                        <p>Driver Payouts</p>
                    </a>
                </li>

                <!-- Reports -->
                <li class="nav-item">
                    <a href="/admin/reports/"
                       class="nav-link <?= strpos($currentPath, '/admin/reports/') !== false ? 'active' : '' ?>">
                        <i class="nav-icon fas fa-chart-line"></i>
                        <p>Reports</p>
                    </a>
                </li>

                <!-- SYSTEM -->
                <li class="nav-header" style="color:#C9A24D;">SYSTEM</li>

                <li class="nav-item">
                    <a href="/admin/api_monitor/"
                       class="nav-link <?= strpos($currentPath, '/admin/api_monitor/') !== false ? 'active' : '' ?>">
                        <i class="nav-icon fas fa-network-wired"></i>
                        <p>API Monitoring</p>
                    </a>
                </li>

                <li class="nav-item">
                    <a href="/admin/settings/"
                       class="nav-link <?= strpos($currentPath, '/admin/settings/') !== false ? 'active' : '' ?>">
                        <i class="nav-icon fas fa-cogs"></i>
                        <p>System Settings</p>
                    </a>
                </li>

                <!-- Logout -->
                <li class="nav-item mt-3">
                    <a href="/admin/logout.php" class="nav-link text-danger">
                        <i class="nav-icon fas fa-sign-out-alt"></i>
                        <p>Logout</p>
                    </a>
                </li>

            </ul>
        </nav>

    </div>
</aside>
