<!-- ======= Sidebar ======= -->
<aside id="sidebar" class="sidebar">
    <ul class="sidebar-nav" id="sidebar-nav">
        <li class="nav-item">
            <a class="nav-link collapsed" href="<?php echo base_url('beranda') ?>">
                <i class="bi bi-grid"></i>
                <span>Beranda</span>
            </a>
        </li>
        <?php
        if ($this->session->userdata('level')=='Administrator') {
            ?>
        <li class="nav-item">
            <a class="nav-link <?php if ($this->uri->segment(1)<>'master') echo 'collapsed' ?>" data-bs-target="#master-nav" data-bs-toggle="collapse" href="#">
                <i class="bi bi-menu-button-wide"></i><span>Master</span><i class="bi bi-chevron-down ms-auto"></i>
            </a>
            <ul id="master-nav" class="nav-content collapse <?php if ($this->uri->segment(1)=='master') echo 'show' ?>" data-bs-parent="#sidebar-nav">
                <li>
                    <a href="<?php echo base_url('master/kategori') ?>" class="<?php if ($this->uri->segment(1)=='master' && $this->uri->segment(2)=='kategori') echo 'active' ?>">
                        <i class="bi bi-circle"></i><span>Kategori Barang</span>
                    </a>
                </li>
                <li>
                    <a href="<?php echo base_url('master/barang') ?>" class="<?php if ($this->uri->segment(1)=='master' && $this->uri->segment(2)=='barang') echo 'active' ?>">
                        <i class="bi bi-circle"></i><span>Barang</span>
                    </a>
                </li>
                <li>
                    <a href="<?php echo base_url('master/suplier') ?>" class="<?php if ($this->uri->segment(1)=='master' && $this->uri->segment(2)=='suplier') echo 'active' ?>">
                        <i class="bi bi-circle"></i><span>Suplier</span>
                    </a>
                </li>
                <li>
                    <a href="<?php echo base_url('master/rak') ?>" class="<?php if ($this->uri->segment(1)=='master' && $this->uri->segment(2)=='rak') echo 'active' ?>">
                        <i class="bi bi-circle"></i><span>Rak</span>
                    </a>
                </li>
                <li>
                    <a href="<?php echo base_url('master/member') ?>" class="<?php if ($this->uri->segment(1)=='master' && $this->uri->segment(2)=='member') echo 'active' ?>">
                        <i class="bi bi-circle"></i><span>Member</span>
                    </a>
                </li>
                <li>
                    <a href="<?php echo base_url('master/nontunai') ?>" class="<?php if ($this->uri->segment(1)=='master' && $this->uri->segment(2)=='nontunai') echo 'active' ?>">
                        <i class="bi bi-circle"></i><span>Pembayaran Non Tunai</span>
                    </a>
                </li>
                <li>
                    <a href="<?php echo base_url('master/pegawai') ?>" class="<?php if ($this->uri->segment(1)=='master' && $this->uri->segment(2)=='pegawai') echo 'active' ?>">
                        <i class="bi bi-circle"></i><span>Pegawai</span>
                    </a>
                </li>
                <li>
                    <a href="<?php echo base_url('master/label') ?>" class="<?php if ($this->uri->segment(1)=='master' && $this->uri->segment(2)=='label') echo 'active' ?>">
                        <i class="bi bi-circle"></i><span>Cetak Label Barang</span>
                    </a>
                </li>
            </ul>
        </li>
            <?php
        }
        ?>
        <li class="nav-item">
            <a class="nav-link <?php if ($this->uri->segment(1)<>'transaksi') echo 'collapsed' ?>" data-bs-target="#transaksi-nav" data-bs-toggle="collapse" href="#">
                <i class="bi bi-bag"></i><span>Transaksi</span><i class="bi bi-chevron-down ms-auto"></i>
            </a>
            <ul id="transaksi-nav" class="nav-content collapse <?php if ($this->uri->segment(1)=='transaksi') echo 'show' ?>" data-bs-parent="#sidebar-nav">
                <li>
                    <a href="<?php echo base_url('transaksi/penjualan') ?>" class="<?php if ($this->uri->segment(1)=='transaksi' && $this->uri->segment(2)=='penjualan') echo 'active' ?>">
                        <i class="bi bi-circle"></i><span>Penjualan</span>
                    </a>
                </li>
                <li>
                    <a href="<?php echo base_url('transaksi/hapusjual') ?>" class="<?php if ($this->uri->segment(1)=='transaksi' && $this->uri->segment(2)=='hapusjual') echo 'active' ?>">
                        <i class="bi bi-circle"></i><span>Hapus Transaksi Penjualan</span>
                    </a>
                </li>
                <li>
                    <a href="<?php echo base_url('transaksi/returjual') ?>" class="<?php if ($this->uri->segment(1)=='transaksi' && $this->uri->segment(2)=='returjual') echo 'active' ?>">
                        <i class="bi bi-circle"></i><span>Retur Penjualan</span>
                    </a>
                </li>
                <!--<li>
                    <a href="<?php echo base_url('transaksi/pembelian') ?>" class="<?php if ($this->uri->segment(1)=='transaksi' && $this->uri->segment(2)=='pembelian') echo 'active' ?>">
                        <i class="bi bi-circle"></i><span>Pembelian</span>
                    </a>
                </li>-->
                <li>
                    <a href="<?php echo base_url('transaksi/permintaan') ?>" class="<?php if ($this->uri->segment(1)=='transaksi' && $this->uri->segment(2)=='permintaan') echo 'active' ?>">
                        <i class="bi bi-circle"></i><span>Permintaan Barang</span>
                    </a>
                </li>
                <li>
                    <a href="<?php echo base_url('transaksi/masuk') ?>" class="<?php if ($this->uri->segment(1)=='transaksi' && $this->uri->segment(2)=='masuk') echo 'active' ?>">
                        <i class="bi bi-circle"></i><span>Barang Masuk</span>
                    </a>
                </li>
                <li>
                    <a href="<?php echo base_url('transaksi/returbeli') ?>" class="<?php if ($this->uri->segment(1)=='transaksi' && $this->uri->segment(2)=='returbeli') echo 'active' ?>">
                        <i class="bi bi-circle"></i><span>Retur Pembelian</span>
                    </a>
                </li>
                <li>
                    <a href="<?php echo base_url('transaksi/mutasi') ?>" class="<?php if ($this->uri->segment(1)=='transaksi' && $this->uri->segment(2)=='mutasi') echo 'active' ?>">
                        <i class="bi bi-circle"></i><span>Mutasi Barang</span>
                    </a>
                </li>
                <li>
                    <a href="<?php echo base_url('transaksi/setoran') ?>" class="<?php if ($this->uri->segment(1)=='transaksi' && $this->uri->segment(2)=='setoran') echo 'active' ?>">
                        <i class="bi bi-circle"></i><span>Setoran Kasir</span>
                    </a>
                </li>
            </ul>
        </li>
        <li class="nav-item">
            <a class="nav-link <?php if ($this->uri->segment(1)<>'stok') echo 'collapsed' ?>" data-bs-target="#stok-nav" data-bs-toggle="collapse" href="#">
                <i class="bi bi-layout-text-window-reverse"></i><span>Manajemen Stok</span><i class="bi bi-chevron-down ms-auto"></i>
            </a>
            <ul id="stok-nav" class="nav-content collapse <?php if ($this->uri->segment(1)=='stok') echo 'show' ?>" data-bs-parent="#sidebar-nav">
                <li>
                    <a href="<?php echo base_url('stok/opname') ?>" class="<?php if ($this->uri->segment(1)=='stok' && $this->uri->segment(2)=='opname') echo 'active' ?>">
                        <i class="bi bi-circle"></i><span>Stok Opname</span>
                    </a>
                </li>
                <li>
                    <a href="<?php echo base_url('stok/kartu') ?>" class="<?php if ($this->uri->segment(1)=='stok' && $this->uri->segment(2)=='kartu') echo 'active' ?>">
                        <i class="bi bi-circle"></i><span>Kartu Stok</span>
                    </a>
                </li>
            </ul>
        </li>
        <li class="nav-item">
            <a class="nav-link <?php if ($this->uri->segment(1)<>'laporan') echo 'collapsed' ?>" data-bs-target="#laporan-nav" data-bs-toggle="collapse" href="#">                
                <i class="bi bi-book"></i><span>Laporan</span><i class="bi bi-chevron-down ms-auto"></i>
            </a>
            <ul id="laporan-nav" class="nav-content collapse <?php if ($this->uri->segment(1)=='laporan') echo 'show' ?>" data-bs-parent="#sidebar-nav">
                <li>
                    <a href="<?php echo base_url('laporan/setoran') ?>" class="<?php if ($this->uri->segment(1)=='laporan' && $this->uri->segment(2)=='setoran') echo 'active' ?>">
                        <i class="bi bi-circle"></i><span>Setoran Kasir</span>
                    </a>
                </li>
                <li>
                    <a href="<?php echo base_url('laporan/masuk') ?>" class="<?php if ($this->uri->segment(1)=='laporan' && $this->uri->segment(2)=='masuk') echo 'active' ?>">
                        <i class="bi bi-circle"></i><span>Barang Masuk</span>
                    </a>
                </li>
                <li>
                    <a href="<?php echo base_url('laporan/jual') ?>" class="<?php if ($this->uri->segment(1)=='laporan' && $this->uri->segment(2)=='jual') echo 'active' ?>">
                        <i class="bi bi-circle"></i><span>Penjualan</span>
                    </a>
                </li>
                <li>
                    <a href="<?php echo base_url('laporan/stokopname') ?>" class="<?php if ($this->uri->segment(1)=='laporan' && $this->uri->segment(2)=='stokopname') echo 'active' ?>">
                        <i class="bi bi-circle"></i><span>Stok Opname</span>
                    </a>
                </li>
                <li>
                    <a href="<?php echo base_url('laporan/rekapjual') ?>" class="<?php if ($this->uri->segment(1)=='laporan' && $this->uri->segment(2)=='rekapjual') echo 'active' ?>">
                        <i class="bi bi-circle"></i><span>Rekap Penjualan</span>
                    </a>
                </li>
                <li>
                    <a href="<?php echo base_url('laporan/rekapjualbarang') ?>" class="<?php if ($this->uri->segment(1)=='laporan' && $this->uri->segment(2)=='rekapjualbarang') echo 'active' ?>">
                        <i class="bi bi-circle"></i><span>Rekap Penjualan Barang</span>
                    </a>
                </li>
                <li>
                    <a href="<?php echo base_url('laporan/rekapmember') ?>" class="<?php if ($this->uri->segment(1)=='laporan' && $this->uri->segment(2)=='rekapmember') echo 'active' ?>">
                        <i class="bi bi-circle"></i><span>Rekap Belanja Member</span>
                    </a>
                </li>
            </ul>
        </li>
        <li class="nav-item">
            <a class="nav-link <?php if ($this->uri->segment(1)<>'pengaturan') echo 'collapsed' ?>" data-bs-target="#pengaturan-nav" data-bs-toggle="collapse" href="#">                
                <i class="bi bi-wrench"></i><span>Pengaturan</span><i class="bi bi-chevron-down ms-auto"></i>
            </a>
            <ul id="pengaturan-nav" class="nav-content collapse <?php if ($this->uri->segment(1)=='pengaturan') echo 'show' ?>" data-bs-parent="#sidebar-nav">
                <li>
                    <a href="<?php echo base_url('pengaturan/umum') ?>" class="<?php if ($this->uri->segment(1)=='pengaturan' && $this->uri->segment(2)=='umum') echo 'active' ?>">
                        <i class="bi bi-circle"></i><span>Umum</span>
                    </a>
                </li>
            </ul>
        </li>
    </ul>
</aside>
<!-- End Sidebar-->
