<div class="app-menu">
                <ul class="accordion-menu">
                  
                    <li>
                        <a href="index.php"><i class="fa fa-home"></i>Home</a>
                    </li>
                   <?php if($user['level']=='admin'): ?> 
                    <li>
                        <a href="?pg=settapk"><i class="fa fa-cogs"></i>Setting Aplikasi</a>
                    </li>	
					<li>
                        <a href="?pg=pengaturan"><i class="fa fa-tools"></i>Setting Sekolah</a>
                    </li>
					 
                   <?php if($menu['aplikasi']==0){ ?>
                    <li>
                        <a href=""><i class="fa fa-tachometer-alt"></i> Dashboard <span class="badge rounded-pill badge-light float-end"><i class="fa fa-chevron-down"></i></span></a>
                        <ul class="sub-menu">
                           
                            <li>
                                <a href="elearn">E Learn</a>
                            </li>
                            <li>
                                <a href="ptm">P T M</a>
                            </li> 
							 <li>
                                <a href="konseling">Konseling</a>
                            </li> 
                            <li>
                                <a href="erapor">E Rapor</a>
                            </li> 		
                           <li>
                                <a href="binduk">Buku Induk</a>
                            </li> 			
                           <li>
                                <a href="skl">S K L</a>
                            </li>
                           						
                           <li>
                                <a href="pembayaran">Pembayaran</a>
                            </li> 
                          <li>
                                <a href="tabungan">Tabungan</a>
                            </li> 
                       <li>
                                <a href="perpus">Perpustakaan</a>
                            </li> 	
                            <li>
                                <a href="sapras">E Sapras</a>
                            </li> 	
                            <li>
                                <a href="evote">E Vote</a>
                            </li> 	
														
                        </ul>
                    </li>
                  <?php } ?>
                   <li>
                        <a href=""><i class="fas fa-users-cog"></i>Data Users <span class="badge rounded-pill badge-light float-end"><i class="fa fa-chevron-down"></i></span></a>
                        <ul class="sub-menu">
                            <li>
                                <a href="?pg=admin">Akun Admin</a>
                            </li>
                            <li>
                                <a href="?pg=guru">Akun Guru</a>
                            </li>
                            <li>
                                <a href="?pg=staff">Akun Staff</a>
                            </li>                                                        
                        </ul>
                    </li>
					<?php if($menu['aplikasi']==1){ ?>
					  <li>
                                <a href="ujian"><i class="fa fa-tachometer-alt"></i>Menu Ujian</a>
                            </li>
					 <?php } ?>
					 <?php if($menu['aplikasi']==0){ ?>
                   <li>
                        <a href="?pg=impormapel"><i class="fa fa-th"></i>Impor Mata Pelajaran</a>
                    </li>
				 <li>
                        <a href="?pg=imporsiswa"><i class="fa fa-graduation-cap"></i>Impor Data Siswa</a>
                    </li>
					 <li>
                        <a href="?pg=settkurikulum"><i class="fa fa-laptop"></i>Setting Kurikulum</a>
                    </li>
				 <li>
                        <a href="?pg=pengumuman"><i class="fa fa-bell"></i>Informasi</a>
                    </li>
					
				 <li>
                        <a href="?pg=apiwa"><i class="fa fa-paper-plane"></i>Setting API WA</a>
                    </li>
					<li>
                        <a href="?pg=kontakme"><i class="fa fa-phone"></i>Contact Me</a>
                    </li>
					
					<li>
                        <a href="?pg=kirimpesan"><i class="fa fa-envelope"></i>Kirim Pesan</a>
                    </li>
					 <?php } ?>
					  <?php if($menu['aplikasi']==1){ ?>
					    <li>
                        <a href=""><i class="fas fa-sync"></i>Sinkron Tarik Data <span class="badge rounded-pill badge-light float-end"><i class="fa fa-chevron-down"></i></span></a>
                        <ul class="sub-menu">
                            <li>
                                <a href="?pg=settsinkron">URL Server</a>
                            </li>
                            <li>
                                <a href="?pg=sinkron">Tarik Data</a>
                            </li>
                            <li>
                                <a href="?pg=sinkronfile">Tarik File Gambar</a>
                            </li>        
                         						
                        </ul>
                    </li> 
					  <li>
                        <a href="?pg=kirimdata"><i class="fa fa-upload"></i>Kirim Data Ke Pusat</a>
                    </li>
					 <?php } ?>
				 <li>
                        <a href=""><i class="fas fa-database"></i>Maintenance <span class="badge rounded-pill badge-light float-end"><i class="fa fa-chevron-down"></i></span></a>
                        <ul class="sub-menu">
                            <li>
                                <a href="?pg=resetdata">Reset Database</a>
                            </li>
                            <li>
                                <a href="?pg=backupdata">Backup Database</a>
                            </li>
                            <li>
                                <a href="?pg=restoredata">Restore Database</a>
                            </li>                                                        
                        </ul>
                    </li>
					<hr style="margin:0px">
					 <li>
                        <a href="logout"><i class="fa fa-sign-in-alt"></i>Logout</a>
                    </li>
					<hr style="margin:0px">
					<?php elseif($user['level']=='guru'): ?>
					 <?php if($menu['aplikasi']==0){ ?>
					 <li class="sidebar-title">
                        MENU WA GATEWAY
                    </li>
					<li>
                        <a href="?pg=kontakme"><i class="fa fa-phone"></i>Contact Me</a>
                    </li>
					<li>
                        <a href="?pg=kirimpesan"><i class="fa fa-envelope"></i>Kirim Pesan</a>
                    </li>
					 <?php } ?>
						 <?php if($menu['aplikasi']==1){ ?>
					 <li class="sidebar-title">
                        MENU UJIAN
                    </li>
					 <li>
                        <a href="?pg=siswa"><i class="fa fa-graduation-cap"></i>Peserta Ujian</a>
                    </li>
					 <li>
                        <a href=""><i class="fas fa-laptop"></i>Bank Soal <span class="badge rounded-pill badge-light float-end"><i class="fa fa-chevron-down"></i></span></a>
                        <ul class="sub-menu">
                            <li>
                                <a href="?pg=banksoal">Bank Soal</a>
                            </li>
                            <li>
                                <a href="?pg=filependukung">File Pendukung</a>
                            </li>
                                                                             
                        </ul>
                    </li>
					
					 <li>
                        <a href="?pg=jadwal"><i class="fa fa-wifi"></i>Jadwal Ujian</a>
                    </li>
					
					   <?php } ?>
					   <?php if($menu['aplikasi']==0){ ?>
						 <?php if($menu['elearn']==1){ ?>
						  <li class="sidebar-title">
                        MENU E LEARN
                    </li>
					 <li>
                        <a href="?pg=materi"><i class="fa fa-laptop"></i>Materi Belajar</a>
                    </li>
				 <li>
                        <a href="?pg=tugas"><i class="fa fa-th"></i>Tugas Belajar</a>
                    </li>
						 <?php } ?>	
					 <?php } ?>	
					 <?php if($menu['aplikasi']==0){ ?>
					 <?php if($menu['ptm']==1){ ?>
						  <li class="sidebar-title">
                       MENU P T M
                    </li>
					 <li>
                        <a href="?pg=inputabsen"><i class="fa fa-camera"></i>Input Absen</a>
                    </li>
					 <li>
                        <a href=""><i class="fas fa-th-list"></i>K Merdeka <span class="badge rounded-pill badge-light float-end"><i class="fa fa-chevron-down"></i></span></a>
                        <ul class="sub-menu">
					 <?php $query = mysqli_query($koneksi, "select * from jadwal_mapel JOIN kelas ON kelas.id_kelas=jadwal_mapel.kelas  WHERE jadwal_mapel.guru='$user[id_user]' GROUP BY kurikulum"); ?>
					  <?php while ($k = mysqli_fetch_array($query)):	?>
					 <?php if($k['kurikulum']=='Merdeka'){ ?>
					 <li>
                        <a href="?pg=tujuan">Tujuan Pembelajaran</a>
                    </li>
				 <li>
                        <a href="?pg=lingkup">Lingkup Materi</a>
                    </li>
					
					<?php } ?>
					   <?php endwhile; ?>
					</ul>
					</li>
					 <li>
                        <a href="?pg=agenda"><i class="fa fa-calendar"></i>Input Agenda</a>
                    </li>
					 <li>
                        <a href="?pg=nilaiharian"><i class="fa fa-edit"></i>Nilai Harian</a>
                    </li>
					 <?php } ?>
						 <?php } ?>	
						  <?php if($menu['aplikasi']==0){ ?>
					 <?php if($menu['rapor']==1){ ?>
						  <li class="sidebar-title">
                       MENU E RAPOR K-13
                    </li>
					<li>
                        <a href=""><i class="fas fa-rss"></i>Deskripsi K-13 <span class="badge rounded-pill badge-light float-end"><i class="fa fa-chevron-down"></i></span></a>
                        <ul class="sub-menu">
					 <?php $query = mysqli_query($koneksi, "select * from jadwal_mapel JOIN kelas ON kelas.id_kelas=jadwal_mapel.kelas  WHERE jadwal_mapel.guru='$user[id_user]' GROUP BY kurikulum"); ?>
					  <?php while ($k = mysqli_fetch_array($query)):	?>
					 <?php if($k['kurikulum']=='K-13'){ ?>
					  <li>
                        <a href="?pg=deskrip3">Deskripsi Pengetahuan (KI-3)</a>
                    </li>
					 <li>
                        <a href="?pg=deskrip4">Deskripsi Keterampilan (KI-4)</a>
                    </li>
					  <?php } ?>
					<?php endwhile; ?>
					</ul>
					</li>
					<li>
                        <a href=""><i class="fas fa-laptop"></i>Nilai Rapor K-13 <span class="badge rounded-pill badge-light float-end"><i class="fa fa-chevron-down"></i></span></a>
                        <ul class="sub-menu">
					 <?php $query = mysqli_query($koneksi, "select * from jadwal_mapel JOIN kelas ON kelas.id_kelas=jadwal_mapel.kelas  WHERE jadwal_mapel.guru='$user[id_user]' GROUP BY kurikulum"); ?>
					  <?php while ($k = mysqli_fetch_array($query)):	?>
					 <?php if($k['kurikulum']=='K-13'){ ?>
					  <li>
                        <a href="?pg=nr">Nilai Pengetahuan (KI-3)</a>
                    </li>
					 <li>
                        <a href="?pg=nr4">Nilai Keterampilan (KI-4)</a>
                    </li>
					  <?php } ?>
					  <?php $agama = mysqli_num_rows(mysqli_query($koneksi, "SELECT * FROM jadwal_mapel WHERE guru='$_SESSION[id_user]' AND agama='1' ")); ?>
							<?php if($agama > 0 AND $k['model_rapor']==1){ ?>
					   <li>
                        <a href="?pg=sikap1">Nilai Sikap Spiritual (KI-1)</a>
                    </li>
					   <?php } ?>
					   <?php if($agama > 0 AND $k['model_rapor']==2){ ?>
					    <li>
                        <a href="?pg=sikapbaru">Nilai Sikap</a>
                    </li>
					   <?php } ?>
					   <?php $ppkn = mysqli_num_rows(mysqli_query($koneksi, "SELECT * FROM jadwal_mapel WHERE guru='$_SESSION[id_user]' AND ppkn='1' ")); ?>
							<?php if($ppkn > 0 AND $k['model_rapor']==1){ ?>
						<li>
                        <a href="?pg=sikap2">Nilai Sikap Sosial (KI-2)</a>
                    </li>
					   <?php } ?>	
					<?php endwhile; ?>
					 
					</ul>
					</li>
					<li>
					 <a href=""><i class="fas fa-laptop"></i>Nilai Rapor K-Merdeka <span class="badge rounded-pill badge-light float-end"><i class="fa fa-chevron-down"></i></span></a>
                        <ul class="sub-menu">
					 <?php $query = mysqli_query($koneksi, "select * from jadwal_mapel JOIN kelas ON kelas.id_kelas=jadwal_mapel.kelas  WHERE jadwal_mapel.guru='$user[id_user]' GROUP BY kurikulum"); ?>
					  <?php while ($k = mysqli_fetch_array($query)):	?>
					 <?php if($k['kurikulum']=='Merdeka'){ ?>
					<li>
                        <a href="?pg=nilaiformatif">Nilai Formatif</a>
                    </li>
					<li>
                        <a href="?pg=nilaisumatif">Nilai Sumatif Akhir Lingkup Materi</a>
                    </li>
					<li>
                        <a href="?pg=nilaisas">Nilai Sumatif Akhir Semester</a>
                    </li>
					 <?php } ?>
						  <?php endwhile; ?>
					</ul>
					</li>
					<li>
                        <a href=""><i class="fas fa-globe"></i>Ekstrakurikuler <span class="badge rounded-pill badge-light float-end"><i class="fa fa-chevron-down"></i></span></a>
                        <ul class="sub-menu">
					  <?php $eskuler=fetch($koneksi,'m_eskul',['idguru'=>$_SESSION['id_user']]); ?>
				      <?php if($eskuler['idguru']==$user['id_user']){ ?>
					 <li>
                        <a href="?pg=siswa_eskul">Input Siswa</a>
                    </li>
					<li>
                        <a href="?pg=siswa_eskul&ac=nilai">Input Nilai</a>
                    </li>
					 <?php } ?>
					 </ul>
					</li>
					 <?php if($user['jabatan']<>''){ ?>
					<li>
                        <a href=""><i class="fas fa-user-cog"></i>Wali Kelas <?= $user['jabatan'] ?><span class="badge rounded-pill badge-light float-end"><i class="fa fa-chevron-down"></i></span></a>
                        <ul class="sub-menu">
					<li>
                        <a href="?pg=absenrapor&kelas=<?= $user['jabatan'] ?>">Input Absensi</a>
                    </li>
					  <?php $kls = mysqli_fetch_array(mysqli_query($koneksi, "SELECT * FROM kelas WHERE id_kelas='$user[jabatan]' ")); ?>
					 <?php if($kls['model_rapor']==1){ ?>
					<li>
                        <a href="?pg=prestasi&kelas=<?= $user['jabatan'] ?>">Input Prestasi</a>
                    </li>
					<?php } ?>
                         </ul>
					</li>
					<?php } ?>
					 <?php $Q = mysqli_fetch_array(mysqli_query($koneksi, "SELECT * FROM kelas WHERE id_kelas='$user[jabatan]' ")); ?>
					<?php if($user['jabatan']<>'' AND $Q['kurikulum']=='Merdeka'){ ?>
					<li>
                        <a href=""><i class="fas fa-school"></i>Rapor Proyek Kegiatan<span class="badge rounded-pill badge-light float-end"><i class="fa fa-chevron-down"></i></span></a>
                        <ul class="sub-menu">
						<li>
                        <a href="?pg=masterproyek">Master Data Proyek</a>
                    </li>
					<li>
                        <a href="?pg=inputproyek">Input Dimensi Proyek</a>
                    </li>
					<li>
                        <a href="?pg=catatanproses">Input Catatan Proses</a>
                    </li>
						 </ul>
					</li>
					 <?php } ?>	
					 <?php } ?>	
					  <?php } ?>	
					 <hr style="margin:0px">
					 <li>
                        <a href="logout"><i class="fa fa-sign-in-alt"></i>Logout</a>
                    </li>
					<hr style="margin:0px">
					
					<?php elseif($user['level']=='staff'): ?>
					 <?php if($menu['aplikasi']==0){ ?>
					<li class="sidebar-title">
                       MENU UTAMA STAFF
                    </li>
					 </li>
					<li>
                        <a href="?pg=kontakme"><i class="fa fa-phone"></i>Contact Me</a>
                    </li>
					<li>
                        <a href="?pg=kirimpesan"><i class="fa fa-envelope"></i>Kirim Pesan</a>
                    </li>
					 <li>
                        <a href="?pg=bell"><i class="fa fa-bullhorn"></i>Bell Otomatis</a>
                    </li>
					 <li class="sidebar-title">
                       MENU P T M
                    </li>
					<?php if($menu['absen_siswa']==1){ ?>
				 <li>
                        <a href="?pg=rfidsiswa"><i class="fa fa-camera"></i>Registrasi RFID Siswa</a>
                    </li>
				<?php } ?>
				<?php if($menu['absen_guru']==1){ ?>
			 <li>
                        <a href="?pg=rfidpeg"><i class="fa fa-camera"></i>Registrasi RFID Pegawai</a>
                    </li>
				<?php }else{ ?>
				<li>
                        <a href="?pg=inputguru"><i class="fa fa-laptop"></i>Input Absen Pegawai</a>
                    </li>
				<?php } ?>
				  <li>
                        <a href=""><i class="fa fa-tachometer-alt"></i> Data Absen <span class="badge rounded-pill badge-light float-end"><i class="fa fa-chevron-down"></i></span></a>
                        <ul class="sub-menu">
                            <li>
                                <a href="?pg=absenmapel">Absen Mapel</a>
                            </li>
                            <li>
                                <a href="?pg=absenkelas">Absen Kelas</a>
                            </li>
                           	 <li>
                                <a href="?pg=absenpeg">Absen Pegawai</a>
                            </li>		
                        </ul>
                    </li>
					
					
					<li>
                        <a href=""><i class="fa fa-print"></i>Kartu Pelajar <span class="badge rounded-pill badge-light float-end"><i class="fa fa-chevron-down"></i></span></a>
                        <ul class="sub-menu">
                            <li>
                                <a href="?pg=tartib">Tata Tertib</a>
                            </li>
                            <li>
                                <a href="?pg=settingkarpel">Background</a>
                            </li>
                           		<li>
                                <a href="?pg=cetakkarpel">Cetak Karpel</a>
                            </li>
                        </ul>
                    </li>
					 <li class="sidebar-title">
                       MENU TABUNGAN
                    </li>
					 <li>
                        <a href="?pg=penabung"><i class="fa fa-tools"></i>Data Konsumen</a>
                    </li>
				 <li>
                        <a href="?pg=transaksi"><i class="fa fa-laptop"></i>Transaksi</a>
                    </li>
					
				 <li>
                        <a href="?pg=rekap"><i class="fa fa-bars"></i>Rekap Transaksi</a>
                    </li>
					 <li class="sidebar-title">
                       MENU PEMBAYARAN
                    </li>
					  <li>
                        <a href="?pg=master_bayar"><i class="fa fa-tools"></i>Master Pembayaran</a>
                    </li>
				 <li>
                        <a href="?pg=transaksi"><i class="fa fa-laptop"></i>Transaksi</a>
                    </li>
					<li>
                        <a href="?pg=datatransaksi"><i class="fa fa-bars"></i>Data Transaksi</a>
                    </li>
				 <li>
                        <a href="?pg=rekap"><i class="fa fa-th"></i>Rekap Transaksi</a>
                    </li>
					
					 <li class="sidebar-title">
                       MENU PERPUSTAKAAN
                    </li>
					 <li>
                        <a href="?pg=kategoribuku"><i class="fa fa-tools"></i>Kategori Buku</a>
                    </li>
				 <li>
                        <a href="?pg=rakbuku"><i class="fa fa-tty"></i>Rak Buku</a>
                    </li>
					
				 <li>
                        <a href="?pg=buku"><i class="fa fa-bars"></i>Data Buku</a>
                    </li>
				 <li>
                        <a href="?pg=pinjam"><i class="fa fa-folder-open"></i>Peminjam Buku</a>
                    </li>
			 <li>
                        <a href=""><i class="fa fa-print"></i> Cetak Laporan <span class="badge rounded-pill badge-light float-end"><i class="fa fa-chevron-down"></i></span></a>
                        <ul class="sub-menu">
						<li>
                                <a href="sandik_perpus/qrbuku.php" target="_blank">QR Code Buku</a>
                            </li>	
                            <li>
                                <a href="sandik_perpus/databuku.php" target="_blank">Data Buku</a>
                            </li>
                            <li>
                                <a href="sandik_perpus/pinjambulan.php" target="_blank">Peminjam Per Bulan</a>
                            </li>
                           		
                        </ul>
                    </li>
					 <li class="sidebar-title">
                       MENU BUKU INDUK
                    </li>
					 <li>
                        <a href="?pg=siswabinduk"><i class="fa fa-laptop"></i>A. Keterangan Data Siswa</a>
                    </li>
				 <li>
                        <a href="?pg=kesehatan"><i class="fa fa-users-cog"></i>C. Keterangan Kesehatan</a>
                    </li>
				 <li>
                        <a href="?pg=pendidikan"><i class="fa fa-graduation-cap"></i>D. Keterangan Pendidikan</a>
                    </li>
			    <li>
                        <a href="?pg=ortu"><i class="fa fa-th"></i>E. Keterangan Orang Tua</a>
                    </li>
					<li>
                        <a href="?pg=perkembangan"><i class="fa fa-th-list"></i>G. Perkembangan Siswa</a>
                    </li>
				 <li>
                        <a href=""><i class="fa fa-print"></i> Cetak Data <span class="badge rounded-pill badge-light float-end"><i class="fa fa-chevron-down"></i></span></a>
                        <ul class="sub-menu">
                            <li>
                                <a href="sandik_binduk/pemeriksaan.php" target="_blank">Pemeriksaan Buku Induk</a>
                            </li>
                            <li>
                                <a href="sandik_binduk/noinduk.php" target="_blank">No Induk dalam Buku Induk</a>
                            </li>
                           	 <li>
                                <a href="sandik_binduk/petunjuk.php" target="_blank">Petunjuk Pengisian Buku Induk</a>
                            </li>	
                                 <li>
                                <a href="?pg=lembarinduk">Lembar Induk Peserta Didik</a>
                            </li>
                          <li>
                                <a href="?pg=cetaknilai">Nilai Buku Induk Peserta Didik</a>
                            </li>									
                        </ul>
                    </li>	
					 <?php } ?>
					<?php endif; ?>
					
                </ul>
            </div>
        </div>