<!-- Main Sidebar Container -->
<aside class="main-sidebar sidebar-dark-primary elevation-4">
  <!-- Brand Logo -->
  <a href="#" class="brand-link">
    <img src="<?= base_url('assets/') ?>/images/logo-ar.jpeg" alt="AsetLogo" class="brand-image img-circle elevation-3" style="opacity: .8">
    <span class="brand-text font-weight-light">Serdadu 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 -->

        <?php
        if ($id_level == '1') { ?>
          <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_aset'); ?>" class="nav-link <?php if ($this->uri->segment(2) == "master_aset") {
                                                                                    echo "active";
                                                                                  } ?>">
                  <i class="far fa-circle nav-icon"></i>
                  <p>Master Aset</p>
                </a>
              </li>
              <li class="nav-item">
                <a href="<?= site_url('master/master_ruangan'); ?>" class="nav-link <?php if ($this->uri->segment(2) == "master_ruangan") {
                                                                                      echo "active";
                                                                                    } ?>">
                  <i class="far fa-circle nav-icon"></i>
                  <p>Master Ruangan</p>
                </a>
              </li>
              <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>Master Pegawai</p>
                </a>
              </li>
              <li class="nav-item">
                <a href="#" class="nav-link">
                  <i class="far fa-circle nav-icon"></i>
                  <p>Master Organisasi
                    <span class="right badge badge-danger">next</span>
                  </p>
                </a>
              </li>
            </ul>
          </li>
        <?php } ?>
        <li class="nav-item has-treeview <?php if ($this->uri->segment(1) == "pendataan_aset") {
                                            echo "menu-open";
                                          } ?>">
          <a href="#" class="nav-link <?php if ($this->uri->segment(1) == "pendataan_aset") {
                                        echo "active";
                                      } ?>">
            <i class="nav-icon fas fa-edit"></i>
            <p>
              Pendataan Aset
              <i class="right fas fa-angle-left"></i>
            </p>
          </a>
          <ul class="nav nav-treeview">
            <li class="nav-item">
              <a href="<?= site_url('pendataan_aset/tanah'); ?>" class="nav-link <?php if ($this->uri->segment(2) == "tanah") {
                                                                                    echo "active";
                                                                                  } ?>">
                <i class="far fa-circle nav-icon"></i>
                <p>Tanah</p>
              </a>
            </li>

            <li class="nav-item">
              <a href="<?= site_url('pendataan_aset/peralatan_mesin'); ?>" class="nav-link <?php if ($this->uri->segment(2) == "peralatan_mesin") {
                                                                                              echo "active";
                                                                                            } ?>">
                <i class="far fa-circle nav-icon"></i>
                <p>Peralatan dan Mesin</p>
              </a>
            </li>

            <li class="nav-item">
              <a href="<?= site_url('pendataan_aset/gedung_bangunan'); ?>" class="nav-link <?php if ($this->uri->segment(2) == "gedung_bangunan") {
                                                                                              echo "active";
                                                                                            } ?>">
                <i class="far fa-circle nav-icon"></i>
                <p>Gedung dan Bangunan</p>
              </a>
            </li>

            <li class="nav-item">
              <a href="<?= site_url('pendataan_aset/jalan_irigasi_jaringan'); ?>" class="nav-link <?php if ($this->uri->segment(2) == "jalan_irigasi_jaringan") {
                                                                                                    echo "active";
                                                                                                  } ?>">
                <i class="far fa-circle nav-icon"></i>
                <p>Jalan, Irigasi dan Jaringan</p>
              </a>
            </li>

            <li class="nav-item has-treeview <?php if ($this->uri->segment(2) == "aset_tetap_lainnya") {
                                                echo "menu-open";
                                              } ?>">
              <a href="#" class="nav-link <?php if ($this->uri->segment(2) == "aset_tetap_lainnya") {
                                            echo "active";
                                          } ?>">
                <i class="far fa-circle nav-icon"></i>
                <p>Aset Tetap Lainnya
                  <i class="right fas fa-angle-left"></i>
                </p>
              </a>
              <ul class="nav nav-treeview">
                <li class="nav-item">
                  <a href="<?= site_url('pendataan_aset/aset_tetap_lainnya/perpustakaan'); ?>" class="nav-link <?php if ($this->uri->segment(3) == "perpustakaan") {
                                                                                                                  echo "active";
                                                                                                                } ?>">
                    <i class="far fa-dot-circle nav-icon"></i>
                    <p>Bahan Perpustakaan</p>
                  </a>
                </li>
                <li class="nav-item">
                  <a href="<?= site_url('pendataan_aset/aset_tetap_lainnya/kesenian'); ?>" class="nav-link <?php if ($this->uri->segment(3) == "kesenian") {
                                                                                                              echo "active";
                                                                                                            } ?>">
                    <i class="far fa-dot-circle nav-icon"></i>
                    <p>Kesenian/Kebudayaan</p>
                  </a>
                </li>
                <li class="nav-item">
                  <a href="<?= site_url('pendataan_aset/aset_tetap_lainnya/hewan'); ?>" class="nav-link <?php if ($this->uri->segment(3) == "hewan") {
                                                                                                          echo "active";
                                                                                                        } ?>">
                    <i class="far fa-dot-circle nav-icon"></i>
                    <p>Hewan dan Tumbuhan</p>
                  </a>
                </li>
              </ul>
            </li>

            <li class="nav-item">
              <a href="<?= '#' //site_url('pendataan_aset/kontruksi_dalam_pengerjaan'); 
                        ?>" class="nav-link <?php if ($this->uri->segment(2) == "kontruksi_dalam_pengerjaan") {
                                              echo "active";
                                            } ?>">
                <i class="far fa-circle nav-icon"></i>
                <p>Kontruksi Dalam Pengerjaan
                  <span class="right badge badge-danger">next</span>
                </p>
              </a>
            </li>

            <li class="nav-item">
              <a href="<?= '#' //site_url('pendataan_aset/aset_tak_berwujud'); 
                        ?>" class="nav-link <?php if ($this->uri->segment(2) == "aset_tak_berwujud") {
                                              echo "active";
                                            } ?>">
                <i class="far fa-circle nav-icon"></i>
                <p>Aset Tak Berwujud
                  <span class="right badge badge-danger">next</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>