<!-- // created by : KuduSinau_Hendrik_081275532220 (TERIMAKASIH UNTUK MENDAPATKAN KEBERKAHAN, DENGAN TIDAK MERUBAH NAMA HAK CIPTA, PLAGIAT, DAN TIDAK MEMPERJUALBELIKAN APLIKASI INI, SEMOGA KITA SEMUA MENDAPAT MANFAAT DAN KEBERKAHAN DARI APLIKASI INI)
// created by : KuduSinau_Hendrik_081275532220 (UNTUK MASUKAN DAN SARAN SERTA PENGEMBANGAN BISA MENGHUBUNGI NOMOR) -->
<div class="mobile-menu-area">
    <div class="container">
        <div class="row">
            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                <div class="mobile-menu">
                    <nav id="dropdown">
                        <?php if ($nmUser['kd_level'] == 1) { ?>
                            <ul class="mobile-menu-nav">
                                <li><a data-toggle="collapse" data-target="#Charts" href="#"> Home <span class="admin-project-icon adminpro-icon adminpro-down-arrow"></span></a>
                                    <ul class="collapse dropdown-header-top">
                                        <li><a href="<?= base_url('admin'); ?>" class="dropdown-item"> Dashboard</a></li>
                                        <li><a href="<?= base_url('admin/data_lembaga'); ?>" class="dropdown-item"> Data Lembaga</a></li>
                                    </ul>
                                </li>
                                <li><a data-toggle="collapse" data-target="#demo" href="#"> Data Referensi <span class="admin-project-icon adminpro-icon adminpro-down-arrow"></span></a>
                                    <ul id="demo" class="collapse dropdown-header-top">
                                        <li><a href="<?= base_url('admin/data_tahun'); ?>" class="dropdown-item">Tahun</a></li>
                                        <li><a href="<?= base_url('admin/data_jurusan'); ?>" class="dropdown-item">Nama Jurusan</a></li>
                                        <li><a href="<?= base_url('admin/data_nama_mapel'); ?>" class="dropdown-item">Nama Bidang Study</a></li>
                                        <li><a href="<?= base_url('admin/data_sikap'); ?>" class="dropdown-item">Nama Sikap</a></li>
                                        <li><a href="<?= base_url('admin/data_kdp'); ?>" class="dropdown-item">KD Pengetahuan</a></li>
                                        <li><a href="<?= base_url('admin/data_kdk'); ?>" class="dropdown-item">KD Keterampilan</a></li>
                                        <li><a href="<?= base_url('admin/data_nama_eskul'); ?>" class="dropdown-item">Nama Eskul</a></li>
                                    </ul>
                                </li>
                                <li><a data-toggle="collapse" data-target="#others" href="#"> Data Utama <span class="admin-project-icon adminpro-icon adminpro-down-arrow"></span></a>
                                    <ul id="others" class="collapse dropdown-header-top">
                                        <li><a href="<?= base_url('admin/data_guru'); ?>" class="dropdown-item">Teachers</a></li>
                                        <li><a href="<?= base_url('admin/tapel'); ?>" class="dropdown-item">Tahun Pelajaran</a></li>
                                        <li><a href="<?= base_url('admin/tgl'); ?>" class="dropdown-item">Tanggal Rapor</a></li>
                                        <li><a href="<?= base_url('admin/data_siswa'); ?>" class="dropdown-item">Students</a></li>
                                        <li><a href="<?= base_url('admin/data_mapel'); ?>" class="dropdown-item">Bidang Study</a></li>
                                        <li><a href="<?= base_url('admin/data_kelas'); ?>" class="dropdown-item">Kelas</a></li>
                                        <li><a href="<?= base_url('admin/data_eskul'); ?>" class="dropdown-item">Ekstrakurikuler</a></li>
                                        <li><a href="<?= base_url('admin/indikator_ssp'); ?>" class="dropdown-item">Indikator Spiritual</a></li>
                                        <li><a href="<?= base_url('admin/indikator_sso'); ?>" class="dropdown-item">Indikator Sosial</a></li>
                                        <?php
                                        $kdUser = $nmUser['kd_user'];
                                        $cekTapel = $this->db->get_where('t_tapel', array('kd_lembaga' => $kdUser))->num_rows();
                                        $tapelA = $this->db->query("SELECT kd_smstr FROM t_tapel WHERE sts_tapel = 1 AND kd_lembaga = '$kdUser'")->row_array();
                                        $this->db->select_sum('sts_tapel', 'jumlah');
                                        $this->db->from('t_tapel');
                                        $this->db->where('kd_lembaga', $kdUser);
                                        $jlhsts = $this->db->get()->row_array();
                                        if (is_null($jlhsts)) {
                                            $jumlahsts = 0;
                                        } else {
                                            $jumlahsts =  round($jlhsts['jumlah']);
                                        }
                                        if (is_null($tapelA)) {
                                            $smstr = 0;
                                        } else {
                                            $smstr = $tapelA['kd_smstr'];
                                        }
                                        if ($cekTapel > 0) {
                                            if ($jumlahsts > 0) {
                                                if ($smstr == 'Genap') { ?>
                                                    <li><a href="<?= base_url('admin/bobot_ijazah'); ?>" class="dropdown-item"> Bobot Nilai Ijazah</a></li>
                                        <?php }
                                            }
                                        } ?>
                                    </ul>
                                </li>
                                <li><a data-toggle="collapse" data-target="#Miscellaneousmob" href="#"> Setting Data <span class="admin-project-icon adminpro-icon adminpro-down-arrow"></span></a>
                                    <ul id="Miscellaneousmob" class="collapse dropdown-header-top">
                                        <li><a href="<?= base_url('admin/guru_mapel'); ?>" class="dropdown-item">Guru Bidang Study</a></li>
                                        <li><a href="<?= base_url('admin/walas'); ?>" class="dropdown-item">Wali Kelas</a></li>
                                        <li><a href="<?= base_url('admin/siswa_rombel'); ?>" class="dropdown-item">Rombel Siswa</a></li>
                                    </ul>
                                </li>
                                <li><a data-toggle="collapse" data-target="#Chartsmob" href="#"> Data Users <span class="admin-project-icon adminpro-icon adminpro-down-arrow"></span></a>
                                    <ul id="Chartsmob" class="collapse dropdown-header-top">
                                        <li><a href="<?= base_url('admin/user_admin'); ?>" class="dropdown-item">Data Admin</a></li>
                                        <li><a href="<?= base_url('admin/user_guru'); ?>" class="dropdown-item">Teachers</a></li>
                                        <li><a href="<?= base_url('admin/user_siswa'); ?>" class="dropdown-item">Students</a></li>
                                    </ul>
                                </li>
                                <li><a data-toggle="collapse" data-target="#Tablesmob" href="#"> Back Up <span class="admin-project-icon adminpro-icon adminpro-down-arrow"></span></a>
                                    <ul id="Tablesmob" class="collapse dropdown-header-top">
                                        <li><a href="<?= base_url('admin/back_up'); ?>">Back Up</a>
                                        </li>
                                    </ul>
                                </li>
                            </ul>
                        <?php } elseif ($nmUser['kd_level'] == 4) { ?>
                            <ul class="mobile-menu-nav">
                                <li><a data-toggle="collapse" data-target="#Charts" href="#"> Home <span class="admin-project-icon adminpro-icon adminpro-down-arrow"></span></a>
                                    <ul class="collapse dropdown-header-top">
                                        <li><a href="<?= base_url('guru'); ?>" class="dropdown-item">Dashboard</a></li>
                                        <li><a href="<?= base_url('guru/profil_user'); ?>" class="dropdown-item">Data Teachers</a></li>
                                    </ul>
                                </li>
                                <li><a data-toggle="collapse" data-target="#demo" href="#"> Seting KKM <span class="admin-project-icon adminpro-icon adminpro-down-arrow"></span></a>
                                    <ul id="demo" class="collapse dropdown-header-top">
                                        <li><a href="<?= base_url('guru/kkm_kelas'); ?>" class="dropdown-item">KKM Kelas</a></li>
                                    </ul>
                                </li>
                                <li><a data-toggle="collapse" data-target="#others" href="#"> Input Nilai <span class="admin-project-icon adminpro-icon adminpro-down-arrow"></span></a>
                                    <ul id="others" class="collapse dropdown-header-top">
                                        <li><a href="<?= base_url('guru/nilai_p'); ?>" class="dropdown-item">Nilai Pengetahuan</a></li>
                                        <li><a href="<?= base_url('guru/nilai_k'); ?>" class="dropdown-item">Nilai Keterampilan</a></li>
                                    </ul>
                                </li>
                                <li><a data-toggle="collapse" data-target="#Miscellaneousmob" href="#"> Print Nilai <span class="admin-project-icon adminpro-icon adminpro-down-arrow"></span></a>
                                    <ul id="Miscellaneousmob" class="collapse dropdown-header-top">
                                        <li><a href="<?= base_url('guru/lihat_p'); ?>" class="dropdown-item">Pengetahuan</a></li>
                                        <li><a href="<?= base_url('guru/lihat_k'); ?>" class="dropdown-item">Keterampilan</a></li>
                                    </ul>
                                </li>
                            </ul>
                        <?php } elseif ($nmUser['kd_level'] == 3) { ?>
                            <ul class="mobile-menu-nav">
                                <li><a data-toggle="collapse" data-target="#Charts" href="#"> Home <span class="admin-project-icon adminpro-icon adminpro-down-arrow"></span></a>
                                    <ul class="collapse dropdown-header-top">
                                        <li><a href="<?= base_url('walas'); ?>" class="dropdown-item">Dashboard</a></li>
                                        <li><a href="<?= base_url('guru/profil_user'); ?>" class="dropdown-item">Data Teachers</a></li>
                                    </ul>
                                </li>
                                <li><a data-toggle="collapse" data-target="#demo" href="#"> Seting KKM <span class="admin-project-icon adminpro-icon adminpro-down-arrow"></span></a>
                                    <ul id="demo" class="collapse dropdown-header-top">
                                        <li><a href="<?= base_url('guru/kkm_kelas'); ?>" class="dropdown-item">KKM Kelas</a></li>
                                    </ul>
                                </li>
                                <li><a data-toggle="collapse" data-target="#others" href="#"> Input Nilai <span class="admin-project-icon adminpro-icon adminpro-down-arrow"></span></a>
                                    <ul id="others" class="collapse dropdown-header-top">
                                        <li><a href="<?= base_url('guru/nilai_p'); ?>" class="dropdown-item">Nilai Pengetahuan</a></li>
                                        <li><a href="<?= base_url('guru/nilai_k'); ?>" class="dropdown-item">Nilai Keterampilan</a></li>
                                    </ul>
                                </li>
                                <li><a data-toggle="collapse" data-target="#Miscellaneousmob" href="#"> Print Nilai <span class="admin-project-icon adminpro-icon adminpro-down-arrow"></span></a>
                                    <ul id="Miscellaneousmob" class="collapse dropdown-header-top">
                                        <li><a href="<?= base_url('guru/lihat_p'); ?>" class="dropdown-item">Pengetahuan</a></li>
                                        <li><a href="<?= base_url('guru/lihat_k'); ?>" class="dropdown-item">Keterampilan</a></li>
                                    </ul>
                                </li>
                                <li><a data-toggle="collapse" data-target="#Miscellaneousmob" href="#"> Nilai Sikap <span class="admin-project-icon adminpro-icon adminpro-down-arrow"></span></a>
                                    <ul id="Miscellaneousmob" class="collapse dropdown-header-top">
                                        <li><a href="<?= base_url('walas/nilai_sso'); ?>" class="dropdown-item">Sikap Sosial</a></li>
                                        <li><a href="<?= base_url('walas/nilai_ssp'); ?>" class="dropdown-item">Sikap Spiritual</a></li>
                                    </ul>
                                </li>
                                <li><a data-toggle="collapse" data-target="#Miscellaneousmob" href="#"> Print Nilai <span class="admin-project-icon adminpro-icon adminpro-down-arrow"></span></a>
                                    <ul id="Miscellaneousmob" class="collapse dropdown-header-top">
                                        <li><a href="<?= base_url('guru/lihat_p'); ?>" class="dropdown-item">Pengetahuan</a></li>
                                        <li><a href="<?= base_url('guru/lihat_k'); ?>" class="dropdown-item">Keterampilan</a></li>
                                    </ul>
                                </li>
                                <li><a data-toggle="collapse" data-target="#Miscellaneousmob" href="#"> Nilai Ekstrakurikuler <span class="admin-project-icon adminpro-icon adminpro-down-arrow"></span></a>
                                    <ul id="Miscellaneousmob" class="collapse dropdown-header-top">
                                        <li><a href="<?= base_url('walas/nilai_eskul'); ?>" class="dropdown-item">Input Ekstrakurikuler</a></li>
                                    </ul>
                                </li>
                                <li><a data-toggle="collapse" data-target="#Miscellaneousmob" href="#"> Nilai Prestasi <span class="admin-project-icon adminpro-icon adminpro-down-arrow"></span></a>
                                    <ul id="Miscellaneousmob" class="collapse dropdown-header-top">
                                        <li><a href="<?= base_url('walas/nilai_prestasi'); ?>" class="dropdown-item">Input Prestasi</a></li>
                                    </ul>
                                </li>
                                <li><a data-toggle="collapse" data-target="#Miscellaneousmob" href="#"> Nilai Absensi <span class="admin-project-icon adminpro-icon adminpro-down-arrow"></span></a>
                                    <ul id="Miscellaneousmob" class="collapse dropdown-header-top">
                                        <li><a href="<?= base_url('walas/nilai_absensi'); ?>" class="dropdown-item">Input Absensi</a></li>
                                    </ul>
                                </li>
                                <li><a data-toggle="collapse" data-target="#Miscellaneousmob" href="#"> Catatan Wali Kelas <span class="admin-project-icon adminpro-icon adminpro-down-arrow"></span></a>
                                    <ul id="Miscellaneousmob" class="collapse dropdown-header-top">
                                        <li><a href="<?= base_url('walas/nilai_catatan'); ?>" class="dropdown-item">Input Catatan</a></li>
                                    </ul>
                                </li>
                                <?php foreach ($nmTapel as $tp) :
                                    if ($tp['sts_tapel'] == 1) {
                                        if ($tp['kd_smstr'] == 'Genap') { ?>
                                            <li><a data-toggle="collapse" data-target="#Miscellaneousmob" href="#"> Naik Kelas/Lulus <span class="admin-project-icon adminpro-icon adminpro-down-arrow"></span></a>
                                                <ul id="Miscellaneousmob" class="collapse dropdown-header-top">
                                                    <li><a href="<?= base_url('walas/naik_kelas'); ?>" class="dropdown-item">Input Naik Kelas</a></li>
                                                </ul>
                                            </li>
                                            <?php
                                            $this->db->select();
                                            $this->db->from('t_walas');
                                            $this->db->join('t_kelas', 't_walas.kd_kelas = t_kelas.id_kelas');
                                            $this->db->where('t_walas.kd_teachers', $nmUser['kd_teachers']);
                                            $walas = $this->db->get()->row_array();
                                            $kelas6 = $this->db->get_where('t_kelas', array('kd_lembaga' => $nmUser['kd_user'], 'angka_kelas' => 6))->row_array();
                                            $kelas9 = $this->db->get_where('t_kelas', array('kd_lembaga' => $nmUser['kd_user'], 'angka_kelas' => 9))->row_array();
                                            $kelas12 = $this->db->get_where('t_kelas', array('kd_lembaga' => $nmUser['kd_user'], 'angka_kelas' => 12))->row_array();
                                            if (($kelas9['nm_kelas'] == 'IX' && $walas['nm_kelas'] == 'IX') || ($kelas6['nm_kelas'] == 'IV' && $walas['nm_kelas'] == 'IV') || ($kelas12['nm_kelas'] == 'XII' && $walas['nm_kelas'] == 'XII')) {
                                            ?>
                                                <li><a data-toggle="collapse" data-target="#Miscellaneousmob" href="#"> Data Kelulusan <span class="admin-project-icon adminpro-icon adminpro-down-arrow"></span></a>
                                                    <ul id="Miscellaneousmob" class="collapse dropdown-header-top">
                                                        <li><a href="<?= base_url('walas/nomor_um'); ?>" class="dropdown-item">Nomor Ujian Madrasah</a></li>
                                                        <li><a href="<?= base_url('walas/nomor_ijazah'); ?>" class="dropdown-item">Nomor Ijazah</a></li>
                                                    </ul>
                                                </li>
                                <?php }
                                        }
                                    }
                                endforeach;
                                ?>
                                <li><a data-toggle="collapse" data-target="#Miscellaneousmob" href="#"> Print Nilai <span class="admin-project-icon adminpro-icon adminpro-down-arrow"></span></a>
                                    <ul id="Miscellaneousmob" class="collapse dropdown-header-top">
                                        <li><a href="<?= base_url('walas/cetak_rapor'); ?>" class="dropdown-item">Print</a></li>
                                        <li><a href="<?= base_url('walas/cetak_legger'); ?>" class="dropdown-item">Legger</a></li>
                                    </ul>
                                </li>
                            </ul>
                        <?php } elseif ($nmUser['kd_level'] == 5) { ?>
                            <ul class="mobile-menu-nav">
                                <li><a data-toggle="collapse" data-target="#Charts" href="#"> Home <span class="admin-project-icon adminpro-icon adminpro-down-arrow"></span></a>
                                    <ul class="collapse dropdown-header-top">
                                        <li><a href="<?= base_url('siswa'); ?>" class="dropdown-item">Dashboard</a></li>
                                        <li><a href="<?= base_url('siswa/profil_user'); ?>" class="dropdown-item">Data Students</a></li>
                                    </ul>
                                </li>
                                <li><a data-toggle="collapse" data-target="#demo" href="#"> Cetak Rapor <span class="admin-project-icon adminpro-icon adminpro-down-arrow"></span></a>
                                    <ul id="demo" class="collapse dropdown-header-top">
                                        <li><a href="<?= base_url('siswa/cetak_rapor'); ?>" class="dropdown-item">Print</a></li>
                                    </ul>
                                </li>
                            </ul>
                        <?php } elseif ($nmUser['kd_level'] == 2) { ?>
                            <ul class="mobile-menu-nav">
                                <li><a data-toggle="collapse" data-target="#Charts" href="#"> Home <span class="admin-project-icon adminpro-icon adminpro-down-arrow"></span></a>
                                    <ul class="collapse dropdown-header-top">
                                        <li><a href="<?= base_url('kamad'); ?>" class="dropdown-item">Dashboard</a></li>
                                        <li><a href="<?= base_url('guru/profil_user'); ?>" class="dropdown-item">Data Kamad</a></li>
                                    </ul>
                                </li>
                                <li><a data-toggle="collapse" data-target="#demo" href="#"> Seting KKM <span class="admin-project-icon adminpro-icon adminpro-down-arrow"></span></a>
                                    <ul id="demo" class="collapse dropdown-header-top">
                                        <li><a href="<?= base_url('guru/kkm_kelas'); ?>" class="dropdown-item">KKM Kelas</a></li>
                                    </ul>
                                </li>
                                <li><a data-toggle="collapse" data-target="#others" href="#"> Input Nilai <span class="admin-project-icon adminpro-icon adminpro-down-arrow"></span></a>
                                    <ul id="others" class="collapse dropdown-header-top">
                                        <li><a href="<?= base_url('guru/nilai_p'); ?>" class="dropdown-item">Nilai Pengetahuan</a></li>
                                        <li><a href="<?= base_url('guru/nilai_k'); ?>" class="dropdown-item">Nilai Keterampilan</a></li>
                                    </ul>
                                </li>
                                <li><a data-toggle="collapse" data-target="#Miscellaneousmob" href="#"> Print Nilai <span class="admin-project-icon adminpro-icon adminpro-down-arrow"></span></a>
                                    <ul id="Miscellaneousmob" class="collapse dropdown-header-top">
                                        <li><a href="<?= base_url('guru/lihat_p'); ?>" class="dropdown-item">Pengetahuan</a></li>
                                        <li><a href="<?= base_url('guru/lihat_k'); ?>" class="dropdown-item">Keterampilan</a></li>
                                    </ul>
                                </li>
                                <li><a data-toggle="collapse" data-target="#demo" href="#"> Cetak Rapor <span class="admin-project-icon adminpro-icon adminpro-down-arrow"></span></a>
                                    <ul id="demo" class="collapse dropdown-header-top">
                                        <li><a href="<?= base_url('kamad/cetak_rapor'); ?>" class="dropdown-item">Print</a></li>
                                        <li><a href="<?= base_url('kamad/cetak_legger'); ?>" class="dropdown-item">Legger</a></li>
                                    </ul>
                                </li>
                                <li><a data-toggle="collapse" data-target="#others" href="#"> Kelulusan <span class="admin-project-icon adminpro-icon adminpro-down-arrow"></span></a>
                                    <ul id="others" class="collapse dropdown-header-top">
                                        <li><a href="<?= base_url('kamad/data_lulus'); ?>" class="dropdown-item">Data Lulus</a></li>
                                    </ul>
                                </li>
                                <li><a data-toggle="collapse" data-target="#others" href="#"> Alumni <span class="admin-project-icon adminpro-icon adminpro-down-arrow"></span></a>
                                    <ul id="others" class="collapse dropdown-header-top">
                                        <li><a href="<?= base_url('kamad/data_alumni'); ?>" class="dropdown-item">Data Alumni</a></li>
                                    </ul>
                                </li>
                            </ul>
                        <?php } elseif ($nmUser['kd_level'] == 0) { ?>
                            <ul class="mobile-menu-nav">
                                <li><a data-toggle="collapse" data-target="#Charts" href="#"> Home <span class="admin-project-icon adminpro-icon adminpro-down-arrow"></span></a>
                                    <ul class="collapse dropdown-header-top">
                                        <li><a href="<?= base_url('superadmin'); ?>" class="dropdown-item">Dashboard</a></li>
                                        <li><a href="<?= base_url('superadmin/back_upSuper'); ?>" class="dropdown-item">Back Up</a></li>
                                    </ul>
                                </li>
                            </ul>
                        <?php } ?>
                    </nav>
                </div>
            </div>
        </div>
    </div>
</div>