<?php
function currenturl($url, $echo)
{
  if (current_url() == base_url('kepalasekolah/' . $url)) {
    echo $echo;
  }
}
?>
<aside class="main-sidebar sidebar-white-primary elevation-4">
  <!-- Brand Logo -->
  <?php $site = $this->db->get('site')->result(); ?>
  <a href="<?php echo base_url('kepalasekolah') ?>" class="brand-link text-center">
    <img src="<?php echo base_url('files/site/' . $site[0]->logo) ?>" alt="Logo" style="opacity: .8; width: 50px"><br>
    <span class="text-sm"><?php echo $site[0]->title ?></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">

        <!-- HOME -->
        <li class="nav-item">
          <a href="<?php echo base_url('kepalasekolah') ?>" class="nav-link">
            <i class="nav-icon fas fa-home"></i>
            <p>
              Beranda
            </p>
          </a>
        </li>
        <!-- REPORT -->
        <li class="nav-item has-treeview <?php currenturl('laporan', 'menu-open');
                                          currenturl('laporan', 'menu-open'); ?>">
          <a href="#" class="nav-link <?php currenturl('request', 'active');
           currenturl('jadwalreport', 'active'); ?>">
            <i class="nav-icon fas fa-file-pdf"></i>
            <p>
              Laporan
            </p>
          </a>
          <ul class="nav nav-treeview">
            <li class="nav-item <?php currenturl('laporan', 'active') ?>">
              <a href="<?php echo base_url('admin/jadwalreport') ?>" class="nav-link <?php currenturl('laporan', 'active') ?>">
                <i class="nav-icon far fa-circle"></i>
                <p>
                  Laporan Jadwal
                </p>
              </a>
            </li>
            <li class="nav-item <?php currenturl('laporan', 'active') ?>">
              <a href="<?php echo base_url('inventaris/laporaninventaris') ?>" class="nav-link <?php currenturl('laporan inv', 'active') ?>">
                <i class="nav-icon far fa-circle"></i>
                <p>
                  Laporan inventaris Rusak
                </p>
              </a>
            </li>
            <li class="nav-item <?php currenturl('laporan', 'active') ?>">
              <a href="<?php echo base_url('inventaris/laporanpinjam') ?>" class="nav-link <?php currenturl('laporan inv', 'active') ?>">
                <i class="nav-icon far fa-circle"></i>
                <p>
                  Laporan Peminjaman Inventaris
                </p>
              </a>
            </li>
          </ul>
        </li>
        <!-- SETTING -->
        <li class="nav-item has-treeview <?php currenturl('myprofile/' . $this->session->userdata('id_user'), 'menu-open'); ?>">

          <ul class="nav nav-treeview">
            <li class="nav-item <?php currenturl('myprofile/' . $this->session->userdata('id_user'), 'active'); ?>">

            </li>
            <li class="nav-item <?php currenturl('sitesetting', 'active'); ?>">\
            
            </li>
          </ul>
        </li>
      </ul>
    </nav>
    <!-- /.sidebar-menu -->
  </div>
  <!-- /.sidebar -->
</aside>