<?php 
session_start();
	if($_SESSION['level']!="superadmin"){
		header("location:../index.html");
	}

include("header.php"); // memanggil file header.php
include("koneksi.php"); // memanggil file koneksi.php untuk koneksi ke database
?>
<script type="text/javascript" src="chartjs/Chart.js"></script>
	<div class="container">
		<div class="content">
			<h2>Statistik Peminatan - Berdasar Pilihan 1</h2>
			
			<div style="width: 800px;margin: 0px auto;">
		<canvas id="myChart"></canvas>
	</div>
			<script>
		var ctx = document.getElementById("myChart").getContext('2d');
		var myChart = new Chart(ctx, {
			type: 'bar',
			data: {
				labels: ["AKL", "OTP", "BDP", "PHT", "UPW", "MM"],
				datasets: [{
					label: '',
					data: [
					<?php 
					$akl = mysqli_query($koneksi,"select * from peminatan_online where pil1='Akuntansi Keuangan & Lembaga' and status='berhasil'");
					echo mysqli_num_rows($akl);
					?>, 
					<?php 
					$otp = mysqli_query($koneksi,"select * from peminatan_online where pil1='Otomatisasi & Tatakelola Perkantoran' and status='berhasil'");
					echo mysqli_num_rows($otp);
					?>, 
					<?php 
					$bdp = mysqli_query($koneksi,"select * from peminatan_online where pil1='Bisnis Daring & Pemasaran' and status='berhasil'");
					echo mysqli_num_rows($bdp);
					?>, 
					<?php 
					$pht = mysqli_query($koneksi,"select * from peminatan_online where pil1='Perhotelan' and status='berhasil'");
					echo mysqli_num_rows($pht);
					?>,
					<?php 
					$upw = mysqli_query($koneksi,"select * from peminatan_online where pil1='Usaha Perjalanan Wisata' and status='berhasil'");
					echo mysqli_num_rows($upw);
					?>,
					<?php 
					$mm = mysqli_query($koneksi,"select * from peminatan_online where pil1='Multimedia' and status='berhasil'");
					echo mysqli_num_rows($mm);
					?>
					],
					backgroundColor: [
					'rgba(255, 99, 132, 0.2)',
					'rgba(54, 162, 235, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(99, 255, 158, 0.2)',
					'rgba(255, 99, 250, 0.2)'
					],
					borderColor: [
					'rgba(255,99,132,1)',
					'rgba(54, 162, 235, 1)',
					'rgba(255, 206, 86, 1)',
					'rgba(75, 192, 192, 1)',
					'rgba(99, 255, 158, 1)',
					'rgba(255, 99, 250, 1)'
					],
					borderWidth: 1
				}]
			},
			options: {
				scales: {
					yAxes: [{
						ticks: {
							beginAtZero:true
						}
					}]
				}
			}
		});
	</script>
	
	<h2>Statistik Peminatan - Berdasar Pilihan 2</h2>
			
			<div style="width: 800px;margin: 0px auto;">
		<canvas id="myChart1"></canvas>
	</div>
			<script>
		var ctx = document.getElementById("myChart1").getContext('2d');
		var myChart1 = new Chart(ctx, {
			type: 'bar',
			data: {
				labels: ["AKL", "OTP", "BDP", "PHT", "UPW", "MM"],
				datasets: [{
					label: '',
					data: [
					<?php 
					$akl = mysqli_query($koneksi,"select * from peminatan_online where pil2='Akuntansi Keuangan & Lembaga' and status='berhasil'");
					echo mysqli_num_rows($akl);
					?>, 
					<?php 
					$otp = mysqli_query($koneksi,"select * from peminatan_online where pil2='Otomatisasi & Tatakelola Perkantoran' and status='berhasil'");
					echo mysqli_num_rows($otp);
					?>, 
					<?php 
					$bdp = mysqli_query($koneksi,"select * from peminatan_online where pil2='Bisnis Daring & Pemasaran' and status='berhasil'");
					echo mysqli_num_rows($bdp);
					?>, 
					<?php 
					$pht = mysqli_query($koneksi,"select * from peminatan_online where pil2='Perhotelan' and status='berhasil'");
					echo mysqli_num_rows($pht);
					?>,
					<?php 
					$upw = mysqli_query($koneksi,"select * from peminatan_online where pil2='Usaha Perjalanan Wisata' and status='berhasil'");
					echo mysqli_num_rows($upw);
					?>,
					<?php 
					$mm = mysqli_query($koneksi,"select * from peminatan_online where pil2='Multimedia' and status='berhasil'");
					echo mysqli_num_rows($mm);
					?>
					],
					backgroundColor: [
					'rgba(255, 99, 132, 0.2)',
					'rgba(54, 162, 235, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(99, 255, 158, 0.2)',
					'rgba(255, 99, 250, 0.2)'
					],
					borderColor: [
					'rgba(255,99,132,1)',
					'rgba(54, 162, 235, 1)',
					'rgba(255, 206, 86, 1)',
					'rgba(75, 192, 192, 1)',
					'rgba(99, 255, 158, 1)',
					'rgba(255, 99, 250, 1)'
					],
					borderWidth: 1
				}]
			},
			options: {
				scales: {
					yAxes: [{
						ticks: {
							beginAtZero:true
						}
					}]
				}
			}
		});
	</script>
	
		<p>
</br>		
			<h2>Statistik Peminatan - Berdasar Jenis Kelamin</h2>
			<h3></h3>
			<div style="width: 800px;margin: 0px auto;">
		<canvas id="myChart2"></canvas>
	</div>
			<script>
		var ctx = document.getElementById("myChart2").getContext('2d');
		var myChart2 = new Chart(ctx, {
			type: 'pie',
			data: {
				labels: ["Laki-Laki", "Perempuan"],
				datasets: [{
					label: '',
					data: [
					<?php 
					$laki = mysqli_query($koneksi,"select * from peminatan_online where jk='laki-laki' and status='berhasil'");
					echo mysqli_num_rows($laki);
					?>, 
					<?php 
					$perempuan = mysqli_query($koneksi,"select * from peminatan_online where jk='perempuan' and status='berhasil'");
					echo mysqli_num_rows($perempuan);
					?>
					],
					backgroundColor: [
					'rgba(54, 162, 235, 0.2)',
					'rgba(255, 99, 132, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)'
					],
					borderColor: [
					'rgba(54, 162, 235, 1)',
					'rgba(255,99,132,1)',
					'rgba(255, 206, 86, 1)',
					'rgba(75, 192, 192, 1)'
					],
					borderWidth: 1
				}]
			},
			options: {
				scales: {
					yAxes: [{
						ticks: {
							beginAtZero:true
						}
					}]
				}
			}
		});
	</script>
	
	<p>
</br>		
				
	<h2>Statistik Peminatan - Berdasar Asal SMP NEGERI</h2>
			<h3></h3>
			<div style="width: 1200px;height: 800px;margin: 0px auto;">
		<canvas id="myChart4"></canvas>
	</div>
			<script>
		var ctx = document.getElementById("myChart4").getContext('2d');
		var myChart4 = new Chart(ctx, {
			type: 'pie',
			data: {
				labels: ["SMP NEGERI 1 BARAT", 
"SMP NEGERI 1 BENDO", 
"SMP NEGERI 1 KARANGREJO", 
"SMP NEGERI 1 KARAS", 
"SMP NEGERI 1 KARTOHARJO", 
"SMP NEGERI 1 KAWEDANAN", 
"SMP NEGERI 1 LEMBEYAN", 
"SMP NEGERI 1 MAGETAN", 
"SMP NEGERI 1 MAOSPATI", 
"SMP NEGERI 1 NGARIBOYO",
"SMP NEGERI 1 NGUNTORONADI",
"SMP NEGERI 1 PANEKAN", 
"SMP NEGERI 1 PARANG", 
"SMP NEGERI 1 PLAOSAN", 
"SMP NEGERI 1 PONCOL", 
"SMP NEGERI 1 SIDOREJO", 
"SMP NEGERI 1 SUKOMORO", 
"SMP NEGERI 1 TAKERAN", 
"SMP NEGERI 2 BARAT", 
"SMP NEGERI 2 BENDO", 
"SMP NEGERI 2 KARANGREJO", 
"SMP NEGERI 2 KAWEDANAN", 
"SMP NEGERI 2 LEMBEYAN", 
"SMP NEGERI 2 MAGETAN", 
"SMP NEGERI 2 MAOSPATI", 
"SMP NEGERI 2 NGARIBOYO", 
"SMP NEGERI 2 PANEKAN", 
"SMP NEGERI 2 PARANG", 
"SMP NEGERI 2 PLAOSAN", 
"SMP NEGERI 2 PONCOL", 
"SMP NEGERI 2 SUKOMORO",
"SMP NEGERI 3 KAWEDANAN", 
"SMP NEGERI 3 MAGETAN", 
"SMP NEGERI 3 MAOSPATI", 
"SMP NEGERI 3 PARANG", 
"SMP NEGERI 3 PLAOSAN", 
"SMP NEGERI 4 MAGETAN"],
				datasets: [{
					label: '',
					data: [
					
					<?php $smpnegeri1barat = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='SMP NEGERI 1 BARAT' and status='berhasil'");  echo mysqli_num_rows($smpnegeri1barat);?>,
<?php $smpnegeri1bendo = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='SMP NEGERI 1 BENDO' and status='berhasil'");  echo mysqli_num_rows($smpnegeri1bendo);?>,
<?php $smpnegeri1karangrejo = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='SMP NEGERI 1 KARANGREJO' and status='berhasil'");  echo mysqli_num_rows($smpnegeri1karangrejo);?>,
<?php $smpnegeri1karas = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='SMP NEGERI 1 KARAS' and status='berhasil'");  echo mysqli_num_rows($smpnegeri1karas);?>,
<?php $smpnegeri1kartoharjo = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='SMP NEGERI 1 KARTOHARJO' and status='berhasil'");  echo mysqli_num_rows($smpnegeri1kartoharjo);?>,
<?php $smpnegeri1kawedanan = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='SMP NEGERI 1 KAWEDANAN' and status='berhasil'");  echo mysqli_num_rows($smpnegeri1kawedanan);?>,
<?php $smpnegeri1lembeyan = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='SMP NEGERI 1 LEMBEYAN' and status='berhasil'");  echo mysqli_num_rows($smpnegeri1lembeyan);?>,
<?php $smpnegeri1magetan = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='SMP NEGERI 1 MAGETAN' and status='berhasil'");  echo mysqli_num_rows($smpnegeri1magetan);?>,
<?php $smpnegeri1maospati = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='SMP NEGERI 1 MAOSPATI' and status='berhasil'");  echo mysqli_num_rows($smpnegeri1maospati);?>,
<?php $smpnegeri1ngariboyo = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='SMP NEGERI 1 NGARIBOYO' and status='berhasil'");  echo mysqli_num_rows($smpnegeri1ngariboyo);?>,
<?php $smpnegeri1nguntoronadi = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='SMP NEGERI 1 NGUNTORONADI' and status='berhasil'");  echo mysqli_num_rows($smpnegeri1nguntoronadi);?>,
<?php $smpnegeri1panekan = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='SMP NEGERI 1 PANEKAN' and status='berhasil'");  echo mysqli_num_rows($smpnegeri1panekan);?>,
<?php $smpnegeri1parang = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='SMP NEGERI 1 PARANG' and status='berhasil'");  echo mysqli_num_rows($smpnegeri1parang);?>,
<?php $smpnegeri1plaosan = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='SMP NEGERI 1 PLAOSAN' and status='berhasil'");  echo mysqli_num_rows($smpnegeri1plaosan);?>,
<?php $smpnegeri1poncol = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='SMP NEGERI 1 PONCOL' and status='berhasil'");  echo mysqli_num_rows($smpnegeri1poncol);?>,
<?php $smpnegeri1sidorejo = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='SMP NEGERI 1 SIDOREJO' and status='berhasil'");  echo mysqli_num_rows($smpnegeri1sidorejo);?>,
<?php $smpnegeri1sukomoro = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='SMP NEGERI 1 SUKOMORO' and status='berhasil'");  echo mysqli_num_rows($smpnegeri1sukomoro);?>,
<?php $smpnegeri1takeran = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='SMP NEGERI 1 TAKERAN' and status='berhasil'");  echo mysqli_num_rows($smpnegeri1takeran);?>,
<?php $smpnegeri2barat = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='SMP NEGERI 2 BARAT' and status='berhasil'");  echo mysqli_num_rows($smpnegeri2barat);?>,
<?php $smpnegeri2bendo = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='SMP NEGERI 2 BENDO' and status='berhasil'");  echo mysqli_num_rows($smpnegeri2bendo);?>,
<?php $smpnegeri2karangrejo = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='SMP NEGERI 2 KARANGREJO' and status='berhasil'");  echo mysqli_num_rows($smpnegeri2karangrejo);?>,
<?php $smpnegeri2kawedanan = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='SMP NEGERI 2 KAWEDANAN' and status='berhasil'");  echo mysqli_num_rows($smpnegeri2kawedanan);?>,
<?php $smpnegeri2lembeyan = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='SMP NEGERI 2 LEMBEYAN' and status='berhasil'");  echo mysqli_num_rows($smpnegeri2lembeyan);?>,
<?php $smpnegeri2magetan = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='SMP NEGERI 2 MAGETAN' and status='berhasil'");  echo mysqli_num_rows($smpnegeri2magetan);?>,
<?php $smpnegeri2maospati = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='SMP NEGERI 2 MAOSPATI' and status='berhasil'");  echo mysqli_num_rows($smpnegeri2maospati);?>,
<?php $smpnegeri2ngariboyo = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='SMP NEGERI 2 NGARIBOYO' and status='berhasil'");  echo mysqli_num_rows($smpnegeri2ngariboyo);?>,
<?php $smpnegeri2panekan = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='SMP NEGERI 2 PANEKAN' and status='berhasil'");  echo mysqli_num_rows($smpnegeri2panekan);?>,
<?php $smpnegeri2parang = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='SMP NEGERI 2 PARANG' and status='berhasil'");  echo mysqli_num_rows($smpnegeri2parang);?>,
<?php $smpnegeri2plaosan = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='SMP NEGERI 2 PLAOSAN' and status='berhasil'");  echo mysqli_num_rows($smpnegeri2plaosan);?>,
<?php $smpnegeri2poncol = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='SMP NEGERI 2 PONCOL' and status='berhasil'");  echo mysqli_num_rows($smpnegeri2poncol);?>,
<?php $smpnegeri2sukomoro = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='SMP NEGERI 2 SUKOMORO' and status='berhasil'");  echo mysqli_num_rows($smpnegeri2sukomoro);?>,
<?php $smpnegeri3kawedanan = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='SMP NEGERI 3 KAWEDANAN' and status='berhasil'");  echo mysqli_num_rows($smpnegeri3kawedanan);?>,
<?php $smpnegeri3magetan = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='SMP NEGERI 3 MAGETAN' and status='berhasil'");  echo mysqli_num_rows($smpnegeri3magetan);?>,
<?php $smpnegeri3maospati = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='SMP NEGERI 3 MAOSPATI' and status='berhasil'");  echo mysqli_num_rows($smpnegeri3maospati);?>,
<?php $smpnegeri3parang = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='SMP NEGERI 3 PARANG' and status='berhasil'");  echo mysqli_num_rows($smpnegeri3parang);?>,
<?php $smpnegeri3plaosan = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='SMP NEGERI 3 PLAOSAN' and status='berhasil'");  echo mysqli_num_rows($smpnegeri3plaosan);?>,
<?php $smpnegeri4magetan = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='SMP NEGERI 4 MAGETAN' and status='berhasil'");  echo mysqli_num_rows($smpnegeri4magetan);?>,

					],
					backgroundColor: [
					'rgba(54, 162, 235, 0.2)',
					'rgba(255, 99, 132, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(54, 162, 235, 0.2)',
					'rgba(255, 99, 132, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(54, 162, 235, 0.2)',
					'rgba(255, 99, 132, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(54, 162, 235, 0.2)',
					'rgba(255, 99, 132, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(54, 162, 235, 0.2)',
					'rgba(255, 99, 132, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(54, 162, 235, 0.2)',
					'rgba(255, 99, 132, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(54, 162, 235, 0.2)',
					'rgba(255, 99, 132, 0.2)'


					
					

					],
					borderColor: [
					'rgba(54, 162, 235, 0.2)',
					'rgba(255, 99, 132, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(54, 162, 235, 0.2)',
					'rgba(255, 99, 132, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(54, 162, 235, 0.2)',
					'rgba(255, 99, 132, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(54, 162, 235, 0.2)',
					'rgba(255, 99, 132, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(54, 162, 235, 0.2)',
					'rgba(255, 99, 132, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(54, 162, 235, 0.2)',
					'rgba(255, 99, 132, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(54, 162, 235, 0.2)',
					'rgba(255, 99, 132, 0.2)'

					],
					borderWidth: 1
				}]
			},
			options: {
				scales: {
					yAxes: [{
						ticks: {
							beginAtZero:true
						}
					}]
				}
			}
		});
	</script>
	
	<h2>Statistik Peminatan - Berdasar Asal SMP SWASTA</h2>
			<h3></h3>
			<div style="width: 1200px;height: 800px;margin: 0px auto;">
		<canvas id="myChart5"></canvas>
	</div>
			<script>
		var ctx = document.getElementById("myChart5").getContext('2d');
		var myChart5 = new Chart(ctx, {
			type: 'pie',
			data: {
				labels: ["SMP NEGERI SATU ATAP PONCOL ASLI", 
"SMP BAKTI", 
"SMP IBS Tahfidzul Quran Al-Qolam", 
"SMP ISLAM EXCELLENT HIDAYATUL UMMAH", 
"SMP ISLAMIC INTERNATIONAL SCHOOL PSM", 
"SMP IT AL IKHLAS", 
"SMP IT BAITUL QURAN AL JAHRA", 
"SMP KATHOLIK GARUDA PARANG", 
"SMP KATOLIK PANCASILA MAGETAN", 
"SMP KROWE", 
"SMP MAARIF DARUS SHOLIKHIN", 
"SMP MUHAMMADIYAH 1 MAGETAN", 
"SMP MUHAMMADIYAH PANEKAN", 
"SMP NAHDLATUL ULAMA UNGGULAN MAGETAN", 
"SMP PANCA BHAKTI 5 MAGETAN", 
"SMP PERSATUAN MAOSPATI", 
"SMP PSM TAJI", 
"SMPIT AL USWAH MAGETAN", 
"SMPK EMMANUEL KAWEDANAN"],
				datasets: [{
					label: '',
					data: [
					
					<?php $smpnegerisatuatapponcolasli = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='SMP NEGERI SATU ATAP PONCOL ASLI' and status='berhasil'");  echo mysqli_num_rows($smpnegerisatuatapponcolasli);?>,
<?php $smpbakti = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='SMP BAKTI' and status='berhasil'");  echo mysqli_num_rows($smpbakti);?>,
<?php $smpibstahfidzulquranal = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='SMP IBS Tahfidzul Quran Al-Qolam' and status='berhasil'");  echo mysqli_num_rows($smpibstahfidzulquranal);?>,
<?php $smpislamexcellenthidayatulummah = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='SMP ISLAM EXCELLENT HIDAYATUL UMMAH' and status='berhasil'");  echo mysqli_num_rows($smpislamexcellenthidayatulummah);?>,
<?php $smpislamicinternationalschoolpsm = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='SMP ISLAMIC INTERNATIONAL SCHOOL PSM' and status='berhasil'");  echo mysqli_num_rows($smpislamicinternationalschoolpsm);?>,
<?php $smpitalikhlas = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='SMP IT AL IKHLAS' and status='berhasil'");  echo mysqli_num_rows($smpitalikhlas);?>,
<?php $smpitbaitulquranaljahra = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='SMP IT BAITUL QURAN AL JAHRA' and status='berhasil'");  echo mysqli_num_rows($smpitbaitulquranaljahra);?>,
<?php $smpkatholikgarudaparang = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='SMP KATHOLIK GARUDA PARANG' and status='berhasil'");  echo mysqli_num_rows($smpkatholikgarudaparang);?>,
<?php $smpkatolikpancasilamagetan = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='SMP KATOLIK PANCASILA MAGETAN' and status='berhasil'");  echo mysqli_num_rows($smpkatolikpancasilamagetan);?>,
<?php $smpkrowe = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='SMP KROWE' and status='berhasil'");  echo mysqli_num_rows($smpkrowe);?>,
<?php $smpmaarifdarussholikhin = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='SMP MAARIF DARUS SHOLIKHIN' and status='berhasil'");  echo mysqli_num_rows($smpmaarifdarussholikhin);?>,
<?php $smpmuhammadiyah1magetan = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='SMP MUHAMMADIYAH 1 MAGETAN' and status='berhasil'");  echo mysqli_num_rows($smpmuhammadiyah1magetan);?>,
<?php $smpmuhammadiyahpanekan = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='SMP MUHAMMADIYAH PANEKAN' and status='berhasil'");  echo mysqli_num_rows($smpmuhammadiyahpanekan);?>,
<?php $smpnahdlatululamaunggulanmagetan = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='SMP NAHDLATUL ULAMA UNGGULAN MAGETAN' and status='berhasil'");  echo mysqli_num_rows($smpnahdlatululamaunggulanmagetan);?>,
<?php $smppancabhakti5magetan = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='SMP PANCA BHAKTI 5 MAGETAN' and status='berhasil'");  echo mysqli_num_rows($smppancabhakti5magetan);?>,
<?php $smppersatuanmaospati = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='SMP PERSATUAN MAOSPATI' and status='berhasil'");  echo mysqli_num_rows($smppersatuanmaospati);?>,
<?php $smppsmtaji = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='SMP PSM TAJI' and status='berhasil'");  echo mysqli_num_rows($smppsmtaji);?>,
<?php $smpitaluswahmagetan = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='SMPIT AL USWAH MAGETAN' and status='berhasil'");  echo mysqli_num_rows($smpitaluswahmagetan);?>,
<?php $smpkemmanuelkawedanan = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='SMPK EMMANUEL KAWEDANAN' and status='berhasil'");  echo mysqli_num_rows($smpkemmanuelkawedanan);?>,

					],
					backgroundColor: [
					'rgba(54, 162, 235, 0.2)',
					'rgba(255, 99, 132, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(54, 162, 235, 0.2)',
					'rgba(255, 99, 132, 0.2)',
					'rgba(255, 99, 132, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(255, 99, 132, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(54, 162, 235, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(255, 99, 132, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(255, 99, 132, 0.2)',
					'rgba(255, 99, 132, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(54, 162, 235, 0.2)',
					'rgba(255, 99, 132, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(54, 162, 235, 0.2)',
					'rgba(255, 99, 132, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)'

					],
					borderColor: [
					'rgba(54, 162, 235, 0.2)',
					'rgba(255, 99, 132, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(54, 162, 235, 0.2)',
					'rgba(255, 99, 132, 0.2)',
					'rgba(255, 99, 132, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(255, 99, 132, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(54, 162, 235, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(255, 99, 132, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(255, 99, 132, 0.2)',
					'rgba(255, 99, 132, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(54, 162, 235, 0.2)',
					'rgba(255, 99, 132, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(54, 162, 235, 0.2)',
					'rgba(255, 99, 132, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)'
					],
					borderWidth: 1
				}]
			},
			options: {
				scales: {
					yAxes: [{
						ticks: {
							beginAtZero:true
						}
					}]
				}
			}
		});
	</script>
	
	<h2>Statistik Peminatan - Berdasar Asal MTS</h2>
			<h3></h3>
			<div style="width: 1200px;height: 800px;margin: 0px auto;">
		<canvas id="myChart6"></canvas>
	</div>
			<script>
		var ctx = document.getElementById("myChart6").getContext('2d');
		var myChart6 = new Chart(ctx, {
			type: 'pie',
			data: {
				labels: ["MTS NEGERI 1 MAGETAN", 
"MTS NEGERI 2 MAGETAN", 
"MTS NEGERI 3 MAGETAN", 
"MTS NEGERI 4 MAGETAN", 
"MTS NEGERI 5 MAGETAN", 
"MTS NEGERI 6 MAGETAN", 
"MTS NEGERI 7 MAGETAN", 
"MTS NEGERI 8 MAGETAN", 
"MTS NEGERI 9 MAGETAN", 
"MTS NEGERI 10 MAGETAN", 
"MTS AL ABROR TEGALARUM", 
"MTS AL FATAH PUTRI TEMBORO", 
"MTS AL FATAH TEMBORO", 
"MTS AL HIDAYAT GINUK", 
"MTS AL IKHLASH PLAOSAN", 
"MTS AL ISLAM GENILANGIT", 
"MTS AL ISLAM PLUMPUNG", 
"MTs AR ROHMAN TEGALREJO", 
"MTS DARUL ULUM PONCOL", 
"MTS HASANUDDIN", 
"MTS HIDAYATUL MUBTADIIN", 
"MTS MAARIF MOJOPURNO", 
"MTS MMA GONGGANG", 
"MTS MUROATUDDIN", 
"MTS MUTTAQIEN PSM TAKERAN", 
"MTS NURUL FALAH", 
"MTS NURUSH SHOLIHIN", 
"MTS PLUMPUNG", 
"MTS PSM DARUSSALAM LEMBEYAN", 
"MTS PSM NITIKAN", 
"MTS PSM SAYUTAN", 
"MTS PSM TANJUNGSEPREH (TIDAK UN)", 
"MTS ROUDLOTUL ULUM", 
"MTS ROUDLOTUT THOLIBIN", 
"MTS SINGO WALISONGO", 
"MTS SUKOMORO", 
"MTSS BANI ALI MURSYAD PSM BANARAN"],
				datasets: [{
					label: '',
					data: [
					
					<?php $mtsnegeri1magetan = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='MTS NEGERI 1 MAGETAN' and status='berhasil'");  echo mysqli_num_rows($mtsnegeri1magetan);?>,
<?php $mtsnegeri2magetan = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='MTS NEGERI 2 MAGETAN' and status='berhasil'");  echo mysqli_num_rows($mtsnegeri2magetan);?>,
<?php $mtsnegeri3magetan = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='MTS NEGERI 3 MAGETAN' and status='berhasil'");  echo mysqli_num_rows($mtsnegeri3magetan);?>,
<?php $mtsnegeri4magetan = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='MTS NEGERI 4 MAGETAN' and status='berhasil'");  echo mysqli_num_rows($mtsnegeri4magetan);?>,
<?php $mtsnegeri5magetan = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='MTS NEGERI 5 MAGETAN' and status='berhasil'");  echo mysqli_num_rows($mtsnegeri5magetan);?>,
<?php $mtsnegeri6magetan = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='MTS NEGERI 6 MAGETAN' and status='berhasil'");  echo mysqli_num_rows($mtsnegeri6magetan);?>,
<?php $mtsnegeri7magetan = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='MTS NEGERI 7 MAGETAN' and status='berhasil'");  echo mysqli_num_rows($mtsnegeri7magetan);?>,
<?php $mtsnegeri8magetan = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='MTS NEGERI 8 MAGETAN' and status='berhasil'");  echo mysqli_num_rows($mtsnegeri8magetan);?>,
<?php $mtsnegeri9magetan = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='MTS NEGERI 9 MAGETAN' and status='berhasil'");  echo mysqli_num_rows($mtsnegeri9magetan);?>,
<?php $mtsnegeri10magetan = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='MTS NEGERI 10 MAGETAN' and status='berhasil'");  echo mysqli_num_rows($mtsnegeri10magetan);?>,
<?php $mtsalabrortegalarum = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='MTS AL ABROR TEGALARUM' and status='berhasil'");  echo mysqli_num_rows($mtsalabrortegalarum);?>,
<?php $mtsalfatahputritemboro = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='MTS AL FATAH PUTRI TEMBORO' and status='berhasil'");  echo mysqli_num_rows($mtsalfatahputritemboro);?>,
<?php $mtsalfatahtemboro = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='MTS AL FATAH TEMBORO' and status='berhasil'");  echo mysqli_num_rows($mtsalfatahtemboro);?>,
<?php $mtsalhidayatginuk = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='MTS AL HIDAYAT GINUK' and status='berhasil'");  echo mysqli_num_rows($mtsalhidayatginuk);?>,
<?php $mtsalikhlashplaosan = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='MTS AL IKHLASH PLAOSAN' and status='berhasil'");  echo mysqli_num_rows($mtsalikhlashplaosan);?>,
<?php $mtsalislamgenilangit = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='MTS AL ISLAM GENILANGIT' and status='berhasil'");  echo mysqli_num_rows($mtsalislamgenilangit);?>,
<?php $mtsalislamplumpung = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='MTS AL ISLAM PLUMPUNG' and status='berhasil'");  echo mysqli_num_rows($mtsalislamplumpung);?>,
<?php $mtsarrohmantegalrejo = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='MTs AR ROHMAN TEGALREJO' and status='berhasil'");  echo mysqli_num_rows($mtsarrohmantegalrejo);?>,
<?php $mtsdarululumponcol = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='MTS DARUL ULUM PONCOL' and status='berhasil'");  echo mysqli_num_rows($mtsdarululumponcol);?>,
<?php $mtshasanuddin = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='MTS HASANUDDIN' and status='berhasil'");  echo mysqli_num_rows($mtshasanuddin);?>,
<?php $mtshidayatulmubtadiin = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='MTS HIDAYATUL MUBTADIIN' and status='berhasil'");  echo mysqli_num_rows($mtshidayatulmubtadiin);?>,
<?php $mtsmaarifmojopurno = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='MTS MAARIF MOJOPURNO' and status='berhasil'");  echo mysqli_num_rows($mtsmaarifmojopurno);?>,
<?php $mtsmmagonggang = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='MTS MMA GONGGANG' and status='berhasil'");  echo mysqli_num_rows($mtsmmagonggang);?>,
<?php $mtsmuroatuddin = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='MTS MUROATUDDIN' and status='berhasil'");  echo mysqli_num_rows($mtsmuroatuddin);?>,
<?php $mtsmuttaqienpsmtakeran = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='MTS MUTTAQIEN PSM TAKERAN' and status='berhasil'");  echo mysqli_num_rows($mtsmuttaqienpsmtakeran);?>,
<?php $mtsnurulfalah = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='MTS NURUL FALAH' and status='berhasil'");  echo mysqli_num_rows($mtsnurulfalah);?>,
<?php $mtsnurushsholihin = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='MTS NURUSH SHOLIHIN' and status='berhasil'");  echo mysqli_num_rows($mtsnurushsholihin);?>,
<?php $mtsplumpung = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='MTS PLUMPUNG' and status='berhasil'");  echo mysqli_num_rows($mtsplumpung);?>,
<?php $mtspsmdarussalamlembeyan = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='MTS PSM DARUSSALAM LEMBEYAN' and status='berhasil'");  echo mysqli_num_rows($mtspsmdarussalamlembeyan);?>,
<?php $mtspsmnitikan = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='MTS PSM NITIKAN' and status='berhasil'");  echo mysqli_num_rows($mtspsmnitikan);?>,
<?php $mtspsmsayutan = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='MTS PSM SAYUTAN' and status='berhasil'");  echo mysqli_num_rows($mtspsmsayutan);?>,
<?php $mtspsmtanjungsepreh = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='MTS PSM TANJUNGSEPREH' and status='berhasil'");  echo mysqli_num_rows($mtspsmtanjungsepreh);?>,
<?php $mtsroudlotululum = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='MTS ROUDLOTUL ULUM' and status='berhasil'");  echo mysqli_num_rows($mtsroudlotululum);?>,
<?php $mtsroudlotuttholibin = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='MTS ROUDLOTUT THOLIBIN' and status='berhasil'");  echo mysqli_num_rows($mtsroudlotuttholibin);?>,
<?php $mtssingowalisongo = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='MTS SINGO WALISONGO' and status='berhasil'");  echo mysqli_num_rows($mtssingowalisongo);?>,
<?php $mtssukomoro = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='MTS SUKOMORO' and status='berhasil'");  echo mysqli_num_rows($mtssukomoro);?>,
<?php $mtssbanialimursyadpsmbanaran = mysqli_query($koneksi,"select * from peminatan_online where asal_smp='MTSS BANI ALI MURSYAD PSM BANARAN' and status='berhasil'");  echo mysqli_num_rows($mtssbanialimursyadpsmbanaran);?>,

					],
					backgroundColor: ['rgba(54, 162, 235, 0.2)',
					'rgba(255, 99, 132, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(54, 162, 235, 0.2)',
					'rgba(255, 99, 132, 0.2)',
					'rgba(255, 99, 132, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(255, 99, 132, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(54, 162, 235, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(255, 99, 132, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(255, 99, 132, 0.2)',
					'rgba(255, 99, 132, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(54, 162, 235, 0.2)',
					'rgba(255, 99, 132, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(54, 162, 235, 0.2)',
					'rgba(255, 99, 132, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)'
					],
					borderColor: ['rgba(54, 162, 235, 0.2)',
					'rgba(255, 99, 132, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(54, 162, 235, 0.2)',
					'rgba(255, 99, 132, 0.2)',
					'rgba(255, 99, 132, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(255, 99, 132, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(54, 162, 235, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(255, 99, 132, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(255, 99, 132, 0.2)',
					'rgba(255, 99, 132, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(54, 162, 235, 0.2)',
					'rgba(255, 99, 132, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(54, 162, 235, 0.2)',
					'rgba(255, 99, 132, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)',
					'rgba(255, 206, 86, 0.2)',
					'rgba(75, 192, 192, 0.2)'					],
					borderWidth: 1
				}]
			},
			options: {
				scales: {
					yAxes: [{
						ticks: {
							beginAtZero:true
						}
					}]
				}
			}
		});
	</script>
	
	<p>
</br>		
			
		</div> <!-- /.table-responsive -->
		</div> <!-- /.content -->
	</div> <!-- /.container -->
				
				
				<a href="data.php" data-toggle="tooltip" title="Lihat Data Siswa" class="btn btn-info" role="button"><span class="glyphicon glyphicon-list"></span> Lihat Data Siswa</a>
				<!-- <a href="tambahsss.php" data-toggle="tooltip" title="Tambah Data Siswa" class="btn btn-success" role="button"><span class="glyphicon glyphicon-user"></span> Tambah Data</a> -->
			</div> <!-- /.jumbotron -->
		</div> <!-- /.content -->
	</div>
	<!-- End container -->
<?php 
include("footer.php"); // memanggil file footer.php
?>