<?php
	include "php_class/class_mysql.php";
	include "php_class/class_mahasiswa.php";
	include "php_class/class_transaksi.php";
	include "php_class/class_proposal.php";
	
	$DataMahasiswa = new DataMahasiswa;
	$DataTransaksi = new DataTransaksi;
	$DataProposal = new DataProposal;
	$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 = $DataProposal->get_proposal_by_NPM('', $a, 'jumlah', $npm);
	$judul = $DataProposal->get_proposal_by_NPM('judul', 1, '', $npm);
	$idPendamping1 = $DataProposal->get_proposal_by_NPM('idPendamping1', 1, '', $npm);
	$namaPendamping1 = $DataProposal->get_proposal_by_NPM('namaPendamping1', 1, '', $npm);
	$idPendamping2 = $DataProposal->get_proposal_by_NPM('idPendamping2', 1, '', $npm);
	$namaPendamping2 = $DataProposal->get_proposal_by_NPM('namaPendamping2', 1, '', $npm);
	$idPendamping3 = $DataProposal->get_proposal_by_NPM('idPendamping3', 1, '', $npm);
	$namaPendamping3 = $DataProposal->get_proposal_by_NPM('namaPendamping3', 1, '', $npm);
	$nipPendamping1 = $DataProposal->get_proposal_by_NPM('nipPendamping1', 1, '', $npm);
	$nipPendamping2 = $DataProposal->get_proposal_by_NPM('nipPendamping2', 1, '', $npm);
	$nipPendamping3 = $DataProposal->get_proposal_by_NPM('nipPendamping3', 1, '', $npm);
	$tanggalProposal = $DataProposal->get_proposal_by_NPM('tanggalProposal', 1, '', $npm);
	
	
	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.":".$judul.":".$idPendamping1.":".$namaPendamping1.":".$idPendamping2.":".$namaPendamping2.":".$idPendamping3.":".$namaPendamping3.":".$nipPendamping1.":".$nipPendamping2.":".$nipPendamping3.":".$tanggalProposal;
	}
?>