
<!-- Main Sidebar Container -->
<aside class="main-sidebar sidebar-dark-primary elevation-4">
  <!-- Brand Logo -->
  <a href="#" class="brand-link">
    <img src="<?= base_url('assets/template/backend/') ?>dist/img/logo_sitanala.png" alt="AsetLogo" class="brand-image img-circle elevation-3" style="opacity: .8">
    <span class="brand-text font-weight-light">ADK Sakti V.1.0</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">
        <!-- Add icons to the links using the .nav-icon class
               with font-awesome or any other icon font library -->

          <li class="nav-item has-treeview <?php if ($this->uri->segment(1) == "master") {
                                              echo "menu-open";
                                            } ?>">
            <a href="#" class="nav-link <?php if ($this->uri->segment(1) == "master") {
                                          echo "active";
                                        } ?>">
              <i class="nav-icon fas fa-bars"></i>
              <p>
                Data Master
                <i class="right fas fa-angle-left"></i>
              </p>
            </a>
            <ul class="nav nav-treeview">
              <li class="nav-item">
                <a href="<?= site_url('master/master_pegawai'); ?>" class="nav-link <?php if ($this->uri->segment(2) == "master_pegawai") {
                                                                                      echo "active";
                                                                                    } ?>">
                  <i class="far fa-circle nav-icon"></i>
                  <p>Pegawai</p>
                </a>
              </li>
              <li class="nav-item">
                <a href="<?= site_url('master/master_unit'); ?>" class="nav-link <?php if ($this->uri->segment(2) == "master_unit") {
                                                                                      echo "active";
                                                                                    } ?>">
                  <i class="far fa-circle nav-icon"></i>
                  <p>Unit Kerja
                    
                  </p>
                </a>
              </li>
            </ul>
          </li>
          <li class="nav-item has-treeview <?php if ($this->uri->segment(1) == "rkakl") {
                                              echo "menu-open";
                                            } ?>">
            <a href="#" class="nav-link <?php if ($this->uri->segment(1) == "rkakl") {
                                          echo "active";
                                        } ?>">
              <i class="nav-icon fas fa-edit"></i>
              <p>
                RKAKL
                <i class="right fas fa-angle-left"></i>
              </p>
            </a>
            <ul class="nav nav-treeview">
              <li class="nav-item">
                <a href="<?=site_url('rkakl/rkakl_kegiatan')?>" class="nav-link <?php if ($this->uri->segment(2) == "rkakl_kegiatan") {
                                                                                      echo "active";
                                                                                    } ?>">
                  <i class="far fa-circle nav-icon"></i>
                  <p>Kegiatan</p>
                </a>
              </li>
            </ul>
          </li>
          <li class="nav-item has-treeview <?php if ($this->uri->segment(1) == "komitmen") {
                                              echo "menu-open";
                                            } ?>">
            <a href="#" class="nav-link <?php if ($this->uri->segment(1) == "komitmen") {
                                          echo "active";
                                        } ?>">
              <i class="nav-icon fas fa-edit"></i>
              <p>
                Interkoneksi Komitmen
                <i class="right fas fa-angle-left"></i>
              </p>
            </a>
            <ul class="nav nav-treeview">
              <li class="nav-item">
                <a href="<?=site_url('komitmen/header')?>" class="nav-link <?php if ($this->uri->segment(2) == "header") {
                                                                                                echo "active";
                                                                                              } ?>">
                  <i class="far fa-circle nav-icon"></i>
                  <p>Penerimaan</p>
                </a>
              </li>
            </ul>
          </li>
          <li class="nav-item has-treeview <?php if ($this->uri->segment(1) == "persediaan") {
                                              echo "menu-open";
                                            } ?>">
            <a href="#" class="nav-link <?php if ($this->uri->segment(1) == "persediaan") {
                                          echo "active";
                                        } ?>">
              <i class="nav-icon fas fa-edit"></i>
              <p>
                Interkoneksi Persediaan
                <i class="right fas fa-angle-left"></i>
              </p>
            </a>
            <ul class="nav nav-treeview">
              <li class="nav-item">
                <a href="#" class="nav-link <?php if ($this->uri->segment(2) == "pembelian") {
                                                                                                echo "active";
                                                                                              } ?>">
                  <i class="far fa-circle nav-icon"></i>
                  <p>M02. Pembelian</p>
                </a>
              </li>
              <li class="nav-item">
                <a href="#" class="nav-link <?php if ($this->uri->segment(2) == "perolehan_lainnya") {
                                                                                      echo "active";
                                                                                    } ?>">
                  <i class="far fa-circle nav-icon"></i>
                  <p>M06. Perolehan Lainnya</p>
                </a>
              </li>
              <?php //} ?>
              <li class="nav-item">
                <a href="#" class="nav-link <?php if ($this->uri->segment(2) == "pemakaian") {
                                                                                                echo "active";
                                                                                              } ?>">
                  <i class="far fa-circle nav-icon"></i>
                  <p>K01. Pemakaian <!--<span class="right badge badge-danger">on proses</span>--></p>
                </a>
              </li>
            </ul>
          </li>
        <?php
        if ($id_level == '1') { ?>
          <li class="nav-item has-treeview <?php if ($this->uri->segment(1) == "setting") {
                                              echo "menu-open";
                                            } ?>">
            <a href="#" class="nav-link <?php if ($this->uri->segment(1) == "setting") {
                                          echo "active";
                                        } ?>">
              <i class="nav-icon fas fa-cogs"></i>
              <p>
                Setting
                <i class="right fas fa-angle-left"></i>
              </p>
            </a>
            <ul class="nav nav-treeview">
              <li class="nav-item">
                <a href="<?= site_url('setting/user/user'); ?>" class="nav-link <?php if ($this->uri->segment(2) == "user") {
                                                                                  echo "active";
                                                                                } ?>">
                  <i class="fas fa-user-circle nav-icon"></i>
                  <p>User</p>
                </a>
              </li>
              <li class="nav-item">
                <a href="#" class="nav-link">
                  <i class="fas fa-user-cog nav-icon"></i>
                  <p>Role User</p>
                </a>
              </li>

              <li class="nav-item">
                <a href="#" class="nav-link">
                  <i class="fas fa-database nav-icon"></i>
                  <p>Referensi</p>
                </a>
              </li>
            </ul>
          </li>
        <?php } ?>
        <div class="user-panel d-flex"></div>
        <li class="nav-item">
          <a href="<?= base_url('login/logout'); ?>" class="nav-link">
            <i class="nav-icon fas fa-sign-out-alt"></i>
            <p>
              Logout
            </p>
          </a>
        </li>
      </ul>
    </nav>
    <!-- /.sidebar-menu -->
  </div>
  <!-- sweetalert2 -->
  <div class="flash-data" data-flashdata="<?= $this->session->flashdata('flash'); ?>"></div>
  <?php if ($this->session->flashdata('flash')) : ?>
  <?php endif; ?>

  <div class="flash-data-gagal" data-flashdata="<?= $this->session->flashdata('gagal'); ?>"></div>
  <?php if ($this->session->flashdata('gagal')) : ?>
  <?php endif; ?>

  <!-- /.sidebar -->
</aside>