<?php
	include "php_class/class_mysql.php";
	include "php_class/class_mahasiswa.php";
	include "php_class/class_transaksi.php";
	$DataMahasiswa = new DataMahasiswa;
	$DataTransaksi = new DataTransaksi;
	$npm = $_POST['index'];
	$program = $_POST['program'];
	$tahun = $_POST['tahun'];
	$semester = $_POST['semester'];
	$idgrup = $_POST['grup'];
	$Nama = $DataMahasiswa->get_mahasiswa_single_by_NPM('Nama', $npm);
	$Alamat = $DataMahasiswa->get_mahasiswa_single_by_NPM('Alamat', $npm);
	$Telp = $DataMahasiswa->get_mahasiswa_single_by_NPM('NoTelp', $npm);
	$id = $DataMahasiswa->get_mahasiswa_single_by_NPM('id', $npm);
	
	
	$JumlahData = $DataTransaksi->get_trx_for_cek('jumlah',$npm,$program, $tahun, $semester, $idgrup);
	
	if ($JumlahData > 0) {
		$status	= 'ada';	
	}else {
		$status = 'tidak';
	}
	
	$kdJurusan =  substr($npm, 2, 2);

	$Kelas =  substr($npm, 4, 3);
	
	if ($Kelas == $program) {
		$statusKelas = "ya";	
	} else {
		$statusKelas = "tidak";
	}
	
	if ($Kelas == '121') {
		$namakelas = 'REGULER';	
	}else {
		$namakelas = 'NON REGULER';	
	}
	
	if ($kdJurusan == "31"){
		$Jurusan = "IESP";	
	}elseif ($kdJurusan == "32"){
		$Jurusan = "MANAJEMEN";
	} elseif ($kdJurusan == "33"){
		$Jurusan = "AKUNTANSI";	
	}

	$DataMahasiswa->cek_result = "off";
	if($Nama==''){
		echo '404';
	}else{
		echo $Nama.":".$Jurusan.":".$Alamat."-".$Telp.":".$id.":".$npm.":".$status.":".$statusKelas.":".$namakelas;
	}
?>