<!-- Main Sidebar Container -->
<aside class="main-sidebar sidebar-dark-primary elevation-4" id="sidebar">
  <!-- Brand Logo -->
  <a href="dashboard.php" class="brand-link">
    <img src="../assets/images/app_logo.png" alt="Logo" class="brand-image img-circle elevation-3" style="opacity: .8">
    <span class="brand-text font-weight-light">OPS System</span>
  </a>

  <!-- Sidebar -->
  <div class="sidebar">
    <!-- Sidebar Menu -->
    <nav class="mt-2">
      <ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false">
        
        <!-- Dashboard -->
        <li class="nav-item">
          <a href="dashboard.php" class="nav-link <?= basename($_SERVER['PHP_SELF']) == 'dashboard.php' ? 'active' : '' ?>">
            <i class="nav-icon fas fa-chart-bar"></i>
            <p>Dashboard</p>
          </a>
        </li>

        <!-- Client Sites -->
        <li class="nav-item">
          <a href="manage_sites.php" class="nav-link <?= basename($_SERVER['PHP_SELF']) == 'manage_sites.php' ? 'active' : '' ?>">
            <i class="nav-icon fas fa-building"></i>
            <p>Client Sites</p>
          </a>
        </li>

        <!-- Manage Users -->
        <li class="nav-item">
          <a href="manage_users.php" class="nav-link <?= basename($_SERVER['PHP_SELF']) == 'manage_users.php' ? 'active' : '' ?>">
            <i class="nav-icon fas fa-users-cog"></i>
            <p>Manage Users</p>
          </a>
        </li>

        <!-- Command Center -->
        <li class="nav-item">
          <a href="command_center.php" class="nav-link <?= basename($_SERVER['PHP_SELF']) == 'command_center.php' ? 'active' : '' ?>">
            <i class="nav-icon fas fa-map-marker-alt"></i>
            <p>Command Center</p>
          </a>
        </li>

        <li class="nav-item">
          <a href="controller_deployment.php" class="nav-link <?= basename($_SERVER['PHP_SELF']) == 'controller_deployment.php' ? 'active' : '' ?>">
            <i class="nav-icon fas fa-building"></i>
            <p>Controller Management</p>
          </a>
        </li>
        
        <!-- Manage Attendance -->
        <li class="nav-item <?= in_array(basename($_SERVER['PHP_SELF']), ['view_attendance.php','edit_attendance.php','view_attendance_calendar.php']) ? 'menu-open' : '' ?>">
          <a href="#" class="nav-link <?= in_array(basename($_SERVER['PHP_SELF']), ['view_attendance.php','edit_attendance.php','view_attendance_calendar.php']) ? 'active' : '' ?>">
            <i class="nav-icon fas fa-clock"></i>
            <p>
              Manage Attendance
              <i class="right fas fa-angle-left"></i>
            </p>
          </a>
          <ul class="nav nav-treeview">
            <li class="nav-item">
              <a href="view_attendance.php" class="nav-link <?= basename($_SERVER['PHP_SELF']) == 'view_attendance.php' ? 'active' : '' ?>">
                <i class="far fa-circle nav-icon"></i>
                <p>Attendance Record</p>
              </a>
            </li>
            <li class="nav-item">
              <a href="view_attendance_calendar.php" class="nav-link <?= basename($_SERVER['PHP_SELF']) == 'view_attendance_calendar.php' ? 'active' : '' ?>">
                <i class="far fa-circle nav-icon"></i>
                <p>View Calendar</p>
              </a>
            </li>
          </ul>
        </li>

        <!-- Leave Management -->
        <li class="nav-item <?= in_array(basename($_SERVER['PHP_SELF']), ['manage_leave.php','view_leave_requests.php','view_officer_leave_balance.php']) ? 'menu-open' : '' ?>">
          <a href="#" class="nav-link <?= in_array(basename($_SERVER['PHP_SELF']), ['manage_leave.php','view_leave_requests.php','view_officer_leave_balance.php']) ? 'active' : '' ?>">
            <i class="nav-icon fas fa-briefcase"></i>
            <p>
              Leave Management
              <i class="right fas fa-angle-left"></i>
            </p>
          </a>
          <ul class="nav nav-treeview">
            <li class="nav-item">
              <a href="manage_leave.php" class="nav-link <?= basename($_SERVER['PHP_SELF']) == 'manage_leave.php' ? 'active' : '' ?>">
                <i class="far fa-circle nav-icon"></i>
                <p>Manage Leave</p>
              </a>
            </li>
            <li class="nav-item">
              <a href="view_leave_requests.php" class="nav-link <?= basename($_SERVER['PHP_SELF']) == 'view_leave_requests.php' ? 'active' : '' ?>">
                <i class="far fa-circle nav-icon"></i>
                <p>Leave Requests</p>
              </a>
            </li>
            <li class="nav-item">
              <a href="view_officer_leave_balance.php" class="nav-link <?= basename($_SERVER['PHP_SELF']) == 'view_officer_leave_balance.php' ? 'active' : '' ?>">
                <i class="far fa-circle nav-icon"></i>
                <p>Leave Balance</p>
              </a>
            </li>
          </ul>
        </li>

        <!-- Employment Terms -->
        <li class="nav-item">
          <a href="employment_terms.php" class="nav-link <?= basename($_SERVER['PHP_SELF']) == 'employment_terms.php' ? 'active' : '' ?>">
            <i class="nav-icon fas fa-file-contract"></i>
            <p>Employment Terms</p>
          </a>
        </li>

        <!-- Payslips -->
        <li class="nav-item">
          <a href="upload_payslips.php" class="nav-link <?= basename($_SERVER['PHP_SELF']) == 'upload_payslips.php' ? 'active' : '' ?>">
            <i class="nav-icon fas fa-file-invoice-dollar"></i>
            <p>Upload Payslips</p>
          </a>
        </li>

        <!-- Incident Reports -->
        <li class="nav-item">
          <a href="incident_reports.php" class="nav-link <?= basename($_SERVER['PHP_SELF']) == 'incident_reports.php' ? 'active' : '' ?>">
            <i class="nav-icon fas fa-exclamation-circle"></i>
            <p>Incidents</p>
          </a>
        </li>

        <!-- Logout -->
        <li class="nav-item">
          
<li class="nav-item">
  <a href="occurrence_summary.php" class="nav-link">
    <i class="nav-icon fas fa-clipboard-list"></i>
    <p>Occurrence Summary</p>
  </a>
</li>

  <a href="../auth/logout.php" class="nav-link">
            <i class="nav-icon fas fa-sign-out-alt"></i>
            <p>Logout</p>
          </a>
        </li>

      </ul>
    </nav>
    <!-- /.sidebar-menu -->
  </div>
  <!-- /.sidebar -->
</aside>
