<?php
$uri = service('uri');
$segment1 = $uri->getSegment(1);
$segment2 = $uri->getSegment(2);
$active_activities = ($segment2 == 'activities');
$active_biodata = ($segment2 == 'biodata');
$active_education = ($segment2 == 'education');
?>
<nav class="admin-navbar">
    <div class="container admin-container">
        <div class="admin-brand">ADMIN PANEL</div>
        <ul class="admin-nav-links">
            <li>
                <a class="nav-link <?= $active_activities ? 'active' : '' ?>" href="<?= base_url('admin/activities') ?>">Data Aktivitas</a>
            </li>
            <li>
                <a class="nav-link <?= $active_biodata ? 'active' : '' ?>" href="<?= base_url('admin/biodata') ?>">Data Biodata</a>
            </li>
            <li>
                <a class="nav-link <?= $active_education ? 'active' : '' ?>" href="<?= base_url('admin/education') ?>">Data Pendidikan</a>
            </li>
        </ul>
        <a href="<?= base_url('logout') ?>" class="admin-logout-btn">Logout</a>
    </div>
</nav>