<?php
	include "php_class/class_mysql.php";
	include "php_class/class_mahasiswa.php";
	include "php_class/class_proposal.php";
	$DataMahasiswa = new DataMahasiswa;
	$DataProposal = new DataProposal;
	$npm = $_POST['index'];
	$JumlahData = $DataProposal->get_proposal_by_NPM('', $a, 'jumlah', $npm);
	$idMhs = $DataProposal->get_proposal_by_NPM('idMhs', 1, '', $npm);
	$namaMhs = $DataProposal->get_proposal_by_NPM('namaMhs', 1, '', $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);
	
	

	if ($JumlahData > 0) {
		$status	= 'ada';	
	}else {
		$status = 'tidak';
	}
	
		$bulan = date('m');
	$Tahun2 = date('Y');
		
		if ($bulan == 01){
			$bulanR = 'I';	
		}else if ($bulan == 02) {
			$bulanR = 'II';	
		}else if ($bulan == 03) {
			$bulanR = 'III';	
		}else if ($bulan == 04) {
			$bulanR = 'IV';	
		}else if ($bulan == 05) {
			$bulanR = 'V';	
		}else if ($bulan == 06) {
			$bulanR = 'VI';	
		}else if ($bulan == 07) {
			$bulanR = 'VII';	
		}else if ($bulan == 08) {
			$bulanR = 'VIII'; 
		}else if ($bulan == 09) {
			$bulanR = 'IX';
		}else if ($bulan == 10) {
			$bulanR == 'X';	
		}else if ($bulan == 11) {
			$bulanR = 'XI';	
		}else if ($bulan == 12) {
			$bulanR = 'XII';	
		}	
		
		$noudg = " /UW-FE/PD-10/".$bulanR."/".$Tahun2;

		$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($status=='tidak'){
		echo '404';
	}else{
		echo $idMhs.":".$namaMhs.":".$judul.":".$idPendamping1.":".$namaPendamping1.":".$idPendamping2.":".$namaPendamping2.":".$idPendamping3.":".$namaPendamping3.":".$idMhs.":".$Jurusan.":".$namakelas.":".$nipPendamping1.":".$nipPendamping2;
	}
?>