<?php 
require_once "../config/app.php";

// Get current file name
$current = basename($_SERVER['PHP_SELF']);
$base = "/pages/";
?>

<div id="sidebar" class="sidebar">

<div class="text-center py-3">
    <img src="<?= APP_LOGO ?>" style="max-width:150px;">
</div>

<a href="<?= $base ?>dashboard.php" 
class="<?= ($current=='dashboard.php') ? 'active' : '' ?>" 
onclick="closeSidebar()">
<i class="fa fa-home me-2"></i> Dashboard
</a>

<a href="<?= $base ?>customers.php" 
class="<?= ($current=='customers.php') ? 'active' : '' ?>" 
onclick="closeSidebar()">
<i class="fa fa-users me-2"></i> Customers
</a>

<a href="<?= $base ?>renewals.php" 
class="<?= ($current=='renewals.php') ? 'active' : '' ?>" 
onclick="closeSidebar()">
<i class="fa fa-refresh me-2"></i> Renewals
</a>

<a href="<?= $base ?>services.php" 
class="<?= ($current=='services.php') ? 'active' : '' ?>" 
onclick="closeSidebar()">
<i class="fa fa-cogs me-2"></i> Services
</a>

<a href="<?= $base ?>invoices.php" 
class="<?= ($current=='invoices.php') ? 'active' : '' ?>" 
onclick="closeSidebar()">
<i class="fa fa-file me-2"></i> Invoices
</a>

<a href="<?= $base ?>expenses.php" 
class="<?= ($current=='expenses.php') ? 'active' : '' ?>" 
onclick="closeSidebar()">
<i class="fa fa-wallet me-2"></i> Expenses
</a>

<div class="menu-title">Reports</div>

<a href="<?= $base ?>profit_report.php" 
class="<?= ($current=='profit_report.php') ? 'active' : '' ?>">
<i class="fa fa-chart-bar me-2"></i> Monthly Report
</a>

<a href="<?= $base ?>service_profit.php" 
class="<?= ($current=='service_profit.php') ? 'active' : '' ?>">
<i class="fa fa-cogs me-2"></i> Service Profit
</a>

<a href="<?= $base ?>service_profit_paid.php" 
class="<?= ($current=='service_profit_paid.php') ? 'active' : '' ?>">
<i class="fa fa-money-bill me-2"></i> Paid Profit
</a>

<a href="../actions/backup.php" class="btn btn-danger">
   <i class="fas fa-download me-2"></i> Download Backup
</a>

<a href="#" class="text-danger" data-bs-toggle="modal" data-bs-target="#logoutModal">
<i class="fa fa-sign-out-alt me-2"></i> Logout
</a>



</div>
