<!doctype html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <link rel="stylesheet" href="<?= base_url() ?>assets/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="<?= base_url() ?>assets/datatables/dataTables.bootstrap5.min.css">
    <link rel="stylesheet" href="<?= base_url() ?>assets/fontawesome/css/all.css">
    <link rel="stylesheet" href="<?= base_url() ?>assets/select2/css/select2.min.css">
    <link rel="stylesheet" href="<?= base_url() ?>assets/select2/bootstrap-5-theme/select2-bootstrap-5-theme.min.css">
    <link rel="stylesheet" href="<?= base_url() ?>assets/css/style.css">
    <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.11.5/css/jquery.dataTables.css">

    <link rel="shortcut icon" href="<?= base_url() ?>assets/images/logo.png" type="image/x-icon">

    <title>Aplikasi Catering - Admin</title>
</head>

<body>

    <nav class="navbar navbar-expand-lg navbar-dark bg-custom">
        <div class="container">
            <span class="navbar-brand">Aplikasi Catering</span>
            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
                <span class="navbar-toggler-icon"></span>
            </button>
            <div class="collapse navbar-collapse" id="navbarNav">
                <ul class="navbar-nav">
                    
                    <?php if ($this->session->userdata('login')) : ?>
                    
                        <li class="nav-item">
                            <a class="nav-link <?= $this->uri->segment(1) == '' || $this->uri->segment(1) == 'home' ? 'active' : '' ?>" href="<?= base_url('home') ?>">Home</a>
                        </li>

                        <li class="nav-item">
                            <a class="nav-link <?= $this->uri->segment(1) == 'pembeli' ? 'active' : '' ?>" href="<?= base_url('pembeli') ?>">Pembeli</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link <?= $this->uri->segment(1) == 'produk' ? 'active' : '' ?>" href="<?= base_url('produk') ?>">Produk</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link <?= $this->uri->segment(1) == 'menu' ? 'active' : '' ?>" href="<?= base_url('menu') ?>">Menu</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link <?= $this->uri->segment(1) == 'laporan' ? 'active' : '' ?>" href="<?= base_url('laporan') ?>">Laporan</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link <?= $this->uri->segment(1) == 'ulasan' ? 'active' : '' ?>" href="<?= base_url('ulasan') ?>">Ulasan</a>
                        </li>

                    <?php endif; ?>
                </ul>
                <ul class="navbar-nav ms-auto">
                    <?php if ($this->session->userdata('login')) : ?>
                        <li class="nav-item dropdown">
                            <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
                                <i class="fas fa-user me-1"></i> <?= $this->session->userdata('nama_lengkap') ?>
                            </a>
                            <ul class="dropdown-menu" aria-labelledby="navbarDropdown">
                                <li><a class="dropdown-item" href="<?= base_url('auth/password') ?>">Ubah Password</a></li>
                                <li>
                                    <hr class="dropdown-divider">
                                </li>
                                <li><a class="dropdown-item" href="<?= base_url('auth/logout') ?>">Logout</a></li>
                            </ul>
                        </li>
                    <?php else : ?>
                        <li class="nav-item">
                            <a class="nav-link <?= $this->uri->segment(1) == 'auth' ? 'active' : '' ?>" href="<?= base_url('auth') ?>">Login</a>
                        </li>
                    <?php endif; ?>
                </ul>
            </div>
        </div>
    </nav>