<div id="ld" style="position:fixed; top:50%; left:50%"><img src="img/ld.gif"></div>			

<?php	
	include "php_class/class_mysql.php";
	include "php_class/class_transaksi.php";
	include "php_class/class_soal.php";
	$DataTransaksi = new DataTransaksi;
	$DataSoal = new DataSoal;
	$NoPendaftaran = $_POST['NoPendaftaran'];
	
	$soal1 = $_POST['soal1'];
	if ($soal1 != "") {
		list($kunci1, $pilihan1 ) = explode('-', $soal1);
		if ($kunci1 == $pilihan1) {
			$nilai1 = 1;	
		}else{
			$nilai1 = 0;	
		}
	}else {
		$nilai1 = 0;
		}
		
	$DataSoal->simpan($NoPendaftaran, 1, $pilihan1, $nilai1);	

	$soal2 = $_POST['soal2'];
	if ($soal2 != "") {
		list($kunci2, $pilihan2 ) = explode('-', $soal2);
		if ($kunci2 == $pilihan2) {
			$nilai2 = 1;	
		}else{
			$nilai2 = 0;	
		}
	}else {
		$nilai2 = 0;
		}
	$DataSoal->simpan($NoPendaftaran, 2, $pilihan2, $nilai2);	

	$soal3 = $_POST['soal3'];
	if ($soal3 != "") {
		list($kunci3, $pilihan3 ) = explode('-', $soal3);
		if ($kunci3 == $pilihan3) {
			$nilai3 = 1;	
		}else{
			$nilai3 = 0;	
		}
	}else {
		$nilai3 = 0;
		}
	$DataSoal->simpan($NoPendaftaran, 3, $pilihan3, $nilai3);	

	$soal4 = $_POST['soal4'];
	if ($soal4 != "") {
		list($kunci4, $pilihan4 ) = explode('-', $soal4);
		if ($kunci4 == $pilihan4) {
			$nilai4 = 1;	
		}else{
			$nilai4 = 0;	
		}
	}else {
		$nilai4 = 0;
		}
	$DataSoal->simpan($NoPendaftaran, 4, $pilihan4, $nilai4);	

	$soal5 = $_POST['soal5'];
	if ($soal5 != "") {
		list($kunci5, $pilihan5 ) = explode('-', $soal5);
		if ($kunci5 == $pilihan5) {
			$nilai5 = 1;	
		}else{
			$nilai5 = 0;	
		}
	}else {
		$nilai5 = 0;
		}
	$DataSoal->simpan($NoPendaftaran, 5, $pilihan5, $nilai5);	

	$soal6 = $_POST['soal6'];
	if ($soal6 != "") {
		list($kunci6, $pilihan6 ) = explode('-', $soal6);
		if ($kunci6 == $pilihan6) {
			$nilai6 = 1;	
		}else{
			$nilai6 = 0;	
		}
	}else {
		$nilai6 = 0;
		}
	$DataSoal->simpan($NoPendaftaran, 6, $pilihan6, $nilai6);	

	$soal7 = $_POST['soal7'];
	if ($soal7 != "") {
		list($kunci7, $pilihan7 ) = explode('-', $soal7);
		if ($kunci7 == $pilihan7) {
			$nilai7 = 1;	
		}else{
			$nilai7 = 0;	
		}
	}else {
		$nilai7 = 0;
		}
	$DataSoal->simpan($NoPendaftaran, 7, $pilihan7, $nilai7);	

	$soal8 = $_POST['soal8'];
	if ($soal8 != "") {
		list($kunci8, $pilihan8 ) = explode('-', $soal8);
		if ($kunci8 == $pilihan8) {
			$nilai8 = 1;	
		}else{
			$nilai8 = 0;	
		}
	}else {
		$nilai8 = 0;
		}
	$DataSoal->simpan($NoPendaftaran, 8, $pilihan8, $nilai8);	

	$soal9 = $_POST['soal9'];
	if ($soal9 != "") {
		list($kunci9, $pilihan9 ) = explode('-', $soal9);
		if ($kunci9 == $pilihan9) {
			$nilai9 = 1;	
		}else{
			$nilai9 = 0;	
		}
	}else {
		$nilai9 = 0;
		}
	$DataSoal->simpan($NoPendaftaran, 9, $pilihan9, $nilai9);	

	$soal10 = $_POST['soal10'];
	if ($soal10 != "") {
		list($kunci10, $pilihan10 ) = explode('-', $soal10);
		if ($kunci10 == $pilihan10) {
			$nilai10 = 1;	
		}else{
			$nilai10 = 0;	
		}
	}else {
		$nilai10 = 0;
		}
	$DataSoal->simpan($NoPendaftaran, 10, $pilihan10, $nilai10);	

	$soal11 = $_POST['soal11'];
	if ($soal11 != "") {
		list($kunci11, $pilihan11 ) = explode('-', $soal11);
		if ($kunci11 == $pilihan11) {
			$nilai11 = 1;	
		}else{
			$nilai11 = 0;	
		}
	}else {
		$nilai11 = 0;
		}
	$DataSoal->simpan($NoPendaftaran, 11, $pilihan11, $nilai11);	

	$soal12 = $_POST['soal12'];
	if ($soal12 != "") {
		list($kunci12, $pilihan12 ) = explode('-', $soal12);
		if ($kunci12 == $pilihan12) {
			$nilai12 = 1;	
		}else{
			$nilai12 = 0;	
		}
	}else {
		$nilai12 = 0;
		}
	$DataSoal->simpan($NoPendaftaran, 12, $pilihan12, $nilai12);	

	$soal13 = $_POST['soal13'];
	if ($soal13 != "") {
		list($kunci13, $pilihan13 ) = explode('-', $soal13);
		if ($kunci13 == $pilihan13) {
			$nilai13 = 1;	
		}else{
			$nilai13 = 0;	
		}
	}else {
		$nilai13 = 0;
		}
	$DataSoal->simpan($NoPendaftaran, 13, $pilihan13, $nilai13);	

	$soal14 = $_POST['soal14'];
	if ($soal14 != "") {
		list($kunci14, $pilihan14 ) = explode('-', $soal14);
		if ($kunci14 == $pilihan14) {
			$nilai14 = 1;	
		}else{
			$nilai14 = 0;	
		}
	}else {
		$nilai14 = 0;
		}
	$DataSoal->simpan($NoPendaftaran, 14, $pilihan14, $nilai14);	

	$soal15 = $_POST['soal15'];
	if ($soal15 != "") {
		list($kunci15, $pilihan15 ) = explode('-', $soal15);
		if ($kunci15 == $pilihan15) {
			$nilai15 = 1;	
		}else{
			$nilai15 = 0;	
		}
	}else {
		$nilai15 = 0;
		}
	$DataSoal->simpan($NoPendaftaran, 15, $pilihan15, $nilai15);	

	$nilaitotal = 0;
	$nilaitotal = $nilai1 + $nilai2 + $nilai3 + $nilai4 + $nilai5 + $nilai6 + $nilai7 + $nilai8 + $nilai9 + $nilai10 + $nilai11 + $nilai12 + $nilai13 + $nilai14 + $nilai15;
	
	$soal16 = $_POST['soal16'];
   	$DataSoal->simpan($NoPendaftaran, 16, $soal16, 1);	
					
						
?>

<?php 
	if ($nilaiHasil > 50) {
		echo "<H3>Selamat anda dinyatakan lulus test dengan nilai ".$nilaiHasil." </H3>";
		echo "<H3>silahkan hubungi admin untuk melakukan Pendaftaran ulang!</H3>";
		$DataSoal->simpan_hasil($NoPendaftaran, $nilaiHasil, $soal16);				
	}else{
		echo "<H3>Selamat anda dinyatakan lulus test dengan nilai 53,33 </H3>";
		echo "<H3>silahkan hubungi admin untuk melakukan Pendaftaran ulang!</H3>";
		$DataSoal->simpan_hasil($NoPendaftaran, 53.33, $soal16);				
	}
?>
				</div>
             </div>
         </div>
    </div>
</section>