<?php if ($pg == '') : ?>
    <?php include 'home.php'; ?>
<?php elseif ($pg == 'profilku'): ?>
    <?php include 'profilku.php'; ?>
<?php elseif ($pg == 'admin'): ?>
    <?php cek_session_admin(); ?>
    <?php include 'sandik_admin/admin.php'; ?>
<?php elseif ($pg == 'guru'): ?>
    <?php cek_session_admin(); ?>
    <?php include 'sandik_admin/guru.php'; ?>	
<?php elseif ($pg == 'staff'): ?>
    <?php cek_session_admin(); ?>
    <?php include 'sandik_admin/staff.php'; ?>	
	<!-- /pengaturan -->
<?php elseif ($pg == 'pengaturan'): ?>
    <?php cek_session_admin(); ?>
    <?php include 'pengaturan/pengaturan.php'; ?>
<?php elseif ($pg == 'pengumuman'): ?>
    <?php cek_session_admin(); ?>
    <?php include 'pengumuman.php'; ?>
<?php elseif ($pg == 'settapk'): ?>
    <?php cek_session_admin(); ?>
    <?php include 'pengaturan/settapk.php'; ?>		
<?php elseif ($pg == 'settkurikulum'): ?>
    <?php cek_session_admin(); ?>
    <?php include 'sandik_ptm/settkurikulum.php'; ?>	
            <!-- /ujian guru -->
     <?php elseif ($pg == 'banksoal'): ?>
    <?php include 'sandik_bank/banksoal.php'; ?>	
     <?php elseif ($pg == 'buatbank'): ?>
    <?php include 'sandik_bank/buatbank.php'; ?>	
     <?php elseif ($pg == 'editbank'): ?>
    <?php include 'sandik_bank/editbank.php'; ?>
    <?php elseif ($pg == 'editsoal3') : ?>
    <?php include "sandik_bank/editsoal3.php"; ?>	
	<?php elseif ($pg == 'editsoal1') : ?>
    <?php include "sandik_bank/editsoal1.php"; ?>	
	<?php elseif ($pg == 'editsoal2') : ?>
    <?php include "sandik_bank/editsoal2.php"; ?>	
	<?php elseif ($pg == 'editsoal4') : ?>
    <?php include "sandik_bank/editsoal4.php"; ?>	
	<?php elseif ($pg == 'editsoal5') : ?>
    <?php include "sandik_bank/editsoal5.php"; ?>	
	<?php elseif ($pg == 'editsoal6') : ?>
    <?php include "sandik_bank/editsoal6.php"; ?>	
	<?php elseif ($pg == 'editsoal7') : ?>
    <?php include "sandik_bank/editsoal7.php"; ?>
    <?php elseif ($pg == 'jadwal') : ?>
    <?php include "sandik_ujian/jadwal.php"; ?>	
	<?php elseif ($pg == 'filependukung') : ?>
    <?php include 'sandik_file/filependukung.php'; ?>
<?php elseif ($pg == 'dh') : ?>
    <?php include 'server/dh.php'; ?>	
	<?php elseif ($pg == 'ba') : ?>
    <?php include 'server/ba.php'; ?>	

<?php elseif ($pg == 'siswa'): ?>
    <?php include 'sandik_ujian/siswa.php'; ?>
<!-- /status -->
<?php elseif ($pg == 'status') : ?>
     <?php include "status/status_peserta.php"; ?>	
<?php elseif ($pg == 'nilaiakm') : ?>
    <?php include "sandik_ujian/nilai_akm.php"; ?>	
<?php elseif ($pg == 'nilaicbt') : ?>
    <?php include "sandik_ujian/nilai_cbt.php"; ?>		
	<!-- /database -->
<?php elseif ($_GET['pg']=='backupdata'): ?>
    <?php cek_session_admin(); ?>
    <?php include 'pengaturan/backupdata.php'; ?>	
<?php elseif ($_GET['pg']=='restoredata'): ?>
    <?php cek_session_admin(); ?>
    <?php include 'pengaturan/restoredata.php'; ?>	
<?php elseif ($_GET['pg']=='resetdata'): ?>
    <?php cek_session_admin(); ?>
    <?php include 'pengaturan/resetdata.php'; ?>	
	
	<!-- /impor -->
<?php elseif ($pg == 'imporsiswa'): ?>
    <?php cek_session_admin(); ?>
    <?php include 'sandik_master/import.php'; ?>	
<?php elseif ($pg == 'impormapel'): ?>
    <?php cek_session_admin(); ?>
    <?php include 'sandik_master/impormapel.php'; ?>	
	
	<!-- /siswa -->
<?php elseif ($pg == 'siswa'): ?>
    <?php cek_session_admin(); ?>
    <?php include 'sandik_siswa/siswa.php'; ?>	
<?php elseif ($pg == 'ppdb'): ?>
    <?php cek_session_admin(); ?>
    <?php include 'sandik_siswa/siswappdb.php'; ?>	
<?php elseif ($pg == 'rombel'): ?>
    <?php cek_session_admin(); ?>
    <?php include 'sandik_siswa/drop1.php'; ?>		
	
	<!-- /absensiswa -->
	<?php elseif ($pg == 'inputabsen'): ?>
    <?php include 'sandik_ptm/m_absen/absen.php'; ?>	
	
	<!-- /agenda -->
	<?php elseif ($pg == 'agenda'): ?>
    <?php include 'sandik_agenda/agenda.php'; ?>	
	<?php elseif ($pg == 'jurnal'): ?>
    <?php include 'sandik_agenda/jurnal.php'; ?>	
	
	
	
	<!-- /nilaiharian -->
	<?php elseif ($pg == 'nilaiharian'): ?>
    <?php include 'sandik_ptm/m_nilai/nilaiharian.php'; ?>	
	
		<!-- /Merdeka -->
	<?php elseif ($pg == 'tujuan'): ?>
    <?php include 'sandik_ptm/m_proto/tujuan.php'; ?>	
	<?php elseif ($pg == 'lingkup'): ?>
    <?php include 'sandik_ptm/m_proto/lingkup.php'; ?>	
	
	
	<!-- /server -->
	<?php elseif ($pg == 'settsinkron') : ?>
    <?php cek_session_admin(); ?>
    <?php include 'server/settsinkron.php'; ?>		
<?php elseif ($pg == 'kirimdata') : ?>
    <?php include "server/kirimdata.php"; ?>	
<?php elseif ($pg == 'sinkron') : ?>
    <?php include "server/sinkronisasi.php"; ?>	
<?php elseif ($pg == 'sinkronfile') : ?>
    <?php include 'server/sinkronfile.php'; ?>		
	
	<!-- /Rapor K13 -->
	<?php elseif ($pg == 'deskrip3') : ?>
    <?php include 'sandik_rapor/deskrip3.php'; ?>
	<?php elseif ($pg == 'deskrip4') : ?>
    <?php include 'sandik_rapor/deskrip4.php'; ?>
	<?php elseif ($pg == 'sikap1') : ?>
    <?php include 'sandik_rapor/sikap_spi.php'; ?>
	<?php elseif ($pg == 'sikap2') : ?>
    <?php include 'sandik_rapor/sikap_sos.php'; ?>
	<?php elseif ($pg == 'nr') : ?>
    <?php include 'sandik_rapor/nr.php'; ?>
	<?php elseif ($pg == 'nr4') : ?>
    <?php include 'sandik_rapor/nr4.php'; ?>
	<?php elseif ($pg == 'sikapbaru') : ?>
    <?php include 'sandik_rapor/sikapbaru.php'; ?>
	<?php elseif ($pg == 'hapus_nilai3') : ?>
     <?php 
	 $mapel=$_GET['idmap'];
	$kelas=$_GET['kelas'];
	$ki=$_GET['ki'];
	$smt=$_GET['smt'];
	$tahun=$_GET['tahun'];
	$exec =  delete($koneksi, 'nilai_rapor', ['mapel' => $mapel, 'kelas' => $kelas,'ki'=>$ki,'smt'=>$smt,'tahun'=>$tahun]);
	if($exec){
	echo "
	  <script type='text/javascript'>
		setTimeout(function () { 	
			swal({
				title: 'Sukses',
				text:  'Nilai Berhasil dihapus',
				type: 'success',
				timer: 1000,
				showConfirmButton: true
			});		
		},10);	
		window.setTimeout(function(){ 
			window.location.replace('?pg=nr');
		} ,1000);	
	  </script>";
	}	
	
?>	
<?php elseif ($pg == 'hapus_nilai4') : ?>
     <?php 
	 $mapel=$_GET['idmap'];
	$kelas=$_GET['kelas'];
	$ki=$_GET['ki'];
	$smt=$_GET['smt'];
	$tahun=$_GET['tahun'];
	$exec =  delete($koneksi, 'nilai_rapor', ['mapel' => $mapel, 'kelas' => $kelas,'ki'=>$ki,'smt'=>$smt,'tahun'=>$tahun]);
	if($exec){
	echo "
	  <script type='text/javascript'>
		setTimeout(function () { 	
			swal({
				title: 'Sukses',
				text:  'Nilai Berhasil dihapus',
				type: 'success',
				timer: 1000,
				showConfirmButton: true
			});		
		},10);	
		window.setTimeout(function(){ 
			window.location.replace('?pg=nr4');
		} ,1000);	
	  </script>";
	}	
	
?>	
	<?php elseif ($pg == 'absenrapor') : ?>
    <?php include 'sandik_rapor/absen.php'; ?>
		<?php elseif ($pg == 'prestasi') : ?>
    <?php include 'sandik_rapor/prestasi.php'; ?>
	
	<?php elseif ($pg == 'siswa_eskul') : ?>
    <?php include 'sandik_rapor/siswa_eskul.php'; ?>
	
	<?php elseif ($pg == 'nilaiformatif') : ?>
    <?php include 'sandik_ikm/formatif.php'; ?>	
<?php elseif ($pg == 'nilaisumatif') : ?>
    <?php include 'sandik_ikm/sumatif.php'; ?>	
	
	<?php elseif ($pg == 'nilaisas') : ?>
    <?php include 'sandik_ikm/sas.php'; ?>
	<?php elseif ($pg == 'sikapbaru') : ?>
    <?php include 'sandik_ikm/sikapbaru.php'; ?>
	
	<?php elseif ($pg == 'masterproyek') : ?>
	<?php include 'sandik_proyek/proyek.php'; ?>	
<?php elseif ($pg == 'inputproyek') : ?>
	<?php include 'sandik_proyek/inputproyek.php'; ?>		
<?php elseif ($pg == 'raporproyek') : ?>
	<?php include 'sandik_proyek/cetakraporproyek.php'; ?>	
<?php elseif ($pg == 'catatanproses') : ?>
	<?php include 'sandik_proyek/catatanproses.php'; ?>
	
	<?php elseif ($pg == 'hapus_formatif') : ?>

     <?php 
	 $mapel=$_GET['mapel'];
	$kelas=$_GET['kelas'];
	$exec =  delete($koneksi, 'nilai_formatif', ['mapel' => $mapel, 'kelas' => $kelas]);
	if($exec){
	echo "
	  <script type='text/javascript'>	
		window.setTimeout(function(){ 
			window.location.replace('?pg=nilaiformatif');
		} ,1000);	
	  </script>";
		}
	
?>	
<?php elseif ($pg == 'hapus_sumatif') : ?>
     <?php 
	 $mapel=$_GET['mapel'];
	$kelas=$_GET['kelas'];
	$exec =  delete($koneksi, 'nilai_sumatif', ['mapel' => $mapel, 'kelas' => $kelas, 'khp'=>'SAM']);
	if($exec){
	echo "
	  <script type='text/javascript'>	
		window.setTimeout(function(){ 
			window.location.replace('?pg=nilaisumatif');
		} ,1000);	
	  </script>";
		}
	
?>	
<?php elseif ($pg == 'hapus_sas') : ?>
     <?php 
	 $mapel=$_GET['mapel'];
	$kelas=$_GET['kelas'];
	$exec =  delete($koneksi, 'nilai_sumatif', ['mapel' => $mapel, 'kelas' => $kelas, 'khp'=>'SAS']);
	if($exec){
	echo "
	  <script type='text/javascript'>	
		window.setTimeout(function(){ 
			window.location.replace('?pg=nilaisas');
		} ,1000);	
	  </script>";
		}
	
?>	
<?php elseif ($pg == 'kirimpesan') : ?>
    <?php include "gateway/kirimpesan.php"; ?>	
<?php elseif ($pg == 'kontakme') : ?>
    <?php include 'gateway/kontakme.php'; ?>	
	<?php elseif ($pg == 'apiwa') : ?>
    <?php include 'pengaturan/apiwa.php'; ?>
	<?php elseif ($pg == 'wamasal') : ?>
    <?php include 'gateway/wamasal.php'; ?>
	<?php elseif ($pg == 'wabot') : ?>
    <?php include 'gateway/wabot.php'; ?>
		<!-- /staff -->
	<?php elseif ($pg == 'guruabsen') : ?>
    <?php include 'sandik_ptm/guruabsen.php'; ?>
<?php elseif ($pg == 'inputguru') : ?>
    <?php include 'sandik_ptm/absenguru.php'; ?>	
<?php elseif ($pg == 'rfidsiswa'): ?>
    <?php include 'sandik_ptm/rfidsiswa.php'; ?>	
	<?php elseif ($pg == 'rfidpeg'): ?>
    <?php include 'sandik_ptm/rfidpeg.php'; ?>		
	<?php elseif ($pg == 'tambahkartu') : ?>
    <?php include 'sandik_ptm/tambah.php'; ?>
<?php elseif ($pg == 'tambahkartupeg') : ?>
    <?php include 'sandik_ptm/tambahpeg.php'; ?>
 <!-- /pembayaran -->
<?php elseif ($pg == 'master_bayar') : ?>
	<?php include 'sandik_bayar/master_bayar.php'; ?>
<?php elseif ($pg == 'transaksi') : ?>
	<?php include 'sandik_bayar/transaksi.php'; ?>
<?php elseif ($pg == 'datatrx') : ?>
	<?php include 'sandik_bayar/datatrx.php'; ?>
<?php elseif ($pg == 'cetaktrx') : ?>
	<?php include 'sandik_bayar/cetaktrx.php'; ?>
<?php elseif ($pg == 'datatransaksi') : ?>
	<?php include 'sandik_bayar/datatransaksi.php'; ?>
<?php elseif ($pg == 'detailtransaksi') : ?>
	<?php include 'sandik_bayar/detailtransaksi.php'; ?>
<?php elseif ($pg == 'cetakdetailtrx') : ?>
	<?php include 'sandik_bayar/cetakdetailtrx.php'; ?>
<?php elseif ($pg == 'rekap') : ?>
	<?php include 'sandik_bayar/rekap.php'; ?>	
	<!-- /arsip -->
<?php elseif ($pg == 'lemari') : ?>
    <?php include 'sandik_arsip/lemari.php'; ?>
<?php elseif ($pg == 'map') : ?>
    <?php include 'sandik_arsip/map.php'; ?>
<?php elseif ($pg == 'dokumen') : ?>
    <?php include 'sandik_arsip/dokumen.php'; ?>
<?php elseif ($pg == 'arsipguru') : ?>
    <?php include 'sandik_arsip/arsipguru.php'; ?>
<?php elseif ($pg == 'arsipalumni') : ?>
    <?php include 'sandik_arsip/arsipalumni.php'; ?>	
<?php elseif ($pg == 'surat_masuk') : ?>
    <?php include 'sandik_arsip/surat_masuk.php'; ?>
<?php elseif ($pg == 'surat_keluar') : ?>
    <?php include 'sandik_arsip/surat_keluar.php'; ?>	
	
		<!-- /tabungan -->
	<?php elseif ($pg == 'penabung') : ?>
	<?php include 'sandik_tabungan/penabung.php'; ?>	
<?php elseif ($pg == 'tabungan') : ?>
	<?php include 'sandik_tabungan/tabungan.php'; ?>	
<?php elseif ($pg == 'setoran') : ?>
	<?php include 'sandik_tabungan/setoran.php'; ?>	
<?php elseif ($pg == 'detail') : ?>
	<?php include 'sandik_tabungan/detail.php'; ?>	
<?php elseif ($pg == 'penarikan') : ?>
	<?php include 'sandik_tabungan/penarikan.php'; ?>	
<?php elseif ($pg == 'cetaktabungan') : ?>
	<?php include 'sandik_tabungan/cetaktabungan.php'; ?>	
<?php elseif ($pg == 'settingtabungan') : ?>
	<?php include 'sandik_tabungan/setting_tabungan.php'; ?>	
	<!-- /ptm absen -->	
<?php elseif ($pg == 'absenmapel'): ?>
    <?php include 'sandik_absen/absenmapel.php'; ?>	
<?php elseif ($pg == 'absenkelas'): ?>
    <?php include 'sandik_absen/absenkelas.php'; ?>		
<?php elseif ($pg == 'absenpeg'): ?>
    <?php include 'sandik_absen/absenpegawai.php'; ?>	
	
	<!-- /elearn -->
<?php elseif ($pg == 'tugas') : ?>
    <?php include 'sandik_learn/tugas/tugas.php'; ?>
<?php elseif ($pg == 'materi') : ?>
    <?php include 'sandik_learn/materi/materi.php'; ?>
<?php elseif ($pg == 'inputmateri') : ?>
    <?php include 'sandik_learn/inputmateri.php'; ?>	
<?php elseif ($pg == 'inputtugas') : ?>
    <?php include 'sandik_learn/inputtugas.php'; ?>		
	
<?php elseif ($pg == 'quizbank') : ?>
    <?php include 'sandik_learn/quiz/quizbank.php'; ?>
<?php elseif ($pg == 'editquiz1') : ?>
    <?php include 'sandik_learn/quiz/editquiz1.php'; ?>	
<?php elseif ($pg == 'inputquiz1') : ?>
    <?php include 'sandik_learn/quiz/inputquiz1.php'; ?>	

	<?php elseif ($pg == 'bell') : ?>
    <?php include 'sandik_ptm/bell.php'; ?>
	<?php elseif ($pg == 'kategoribuku'): ?>
    <?php include 'sandik_perpus/kategori.php'; ?>	
 <?php elseif ($pg == 'buku'): ?>
    <?php include 'sandik_perpus/buku.php'; ?>	
	 <?php elseif ($pg == 'rakbuku'): ?>
    <?php include 'sandik_perpus/rakbuku.php'; ?>	
	 <?php elseif ($pg == 'pinjam'): ?>
    <?php include 'sandik_perpus/pinjam.php'; ?>	
	<?php elseif ($pg == 'settingkarpel'): ?>
    <?php include 'sandik_karpel/setting.php'; ?>	
<?php elseif ($pg == 'cetakkarpel'): ?>
    <?php include 'sandik_karpel/cetakkarpel.php'; ?>
	<?php elseif ($pg == 'tartib'): ?>
    <?php include 'sandik_karpel/tartib.php'; ?>
	<?php elseif ($pg == 'siswabinduk') : ?>
    <?php include 'sandik_binduk/datasiswa.php'; ?>
<?php elseif ($pg == 'kesehatan') : ?>
    <?php include 'sandik_binduk/kesehatan.php'; ?>
<?php elseif ($pg == 'pendidikan') : ?>
    <?php include 'sandik_binduk/pendidikan.php'; ?>	
<?php elseif ($pg == 'perkembangan') : ?>
    <?php include 'sandik_binduk/perkembangan.php'; ?>		
<?php elseif ($pg == 'ortu') : ?>
    <?php include 'sandik_binduk/orangtua.php'; ?>
<?php elseif ($pg == 'lembarinduk') : ?>
    <?php include 'sandik_binduk/lembarinduk.php'; ?>
	<?php elseif ($pg == 'cetaknilai') : ?>
    <?php include 'sandik_binduk/cetaknilai.php'; ?>
	
<?php else : ?>
    <div class='error-page'>
        <h2 class='headline text-yellow'> 404</h2>
        <div class='error-content'>
            <br />
            <h3><i class='fa fa-warning text-yellow'></i> Upss! Halaman tidak ditemukan.</h3>
            <p>
                Halaman yang anda inginkan saat ini tidak tersedia.<br />
                Silahkan kembali ke <a href='?'><strong>dashboard</strong></a> dan coba lagi.<br />
                Hubungi petugas <strong><i>Developer</i></strong> jika ini adalah sebuah masalah.
            </p>
        </div>
    </div>
<?php endif ?>
