<?php
// The function header by sending raw excel
header("Content-type: application/vnd-ms-excel");
 
// Defines the name of the export file "codelution-export.xls"
header("Content-Disposition: attachment; filename=data-hasil-ujian.xls");
 
// Add data table
?>
<?php
	include "php_class/class_mysql.php";
	include "php_class/class_template.php";
	include "php_class/class_mahasiswa.php";
	include "php_class/class_grup.php";
	include "php_class/class_transaksi.php";
	include "php_class/class_soal.php";
	$DataSoal = new DataSoal;
	$DataTransaksi = new DataTransaksi;
	$datagrup = new DataGrup;
	$DataMahasiswa = new DataMahasiswa;
	$DataTemplate = new DataTemplate;
	$tahun = $_POST['tahun'];
?>


           <table  border="1">
             <thead>
                <tr>
                    <th>No Pendaftaran</th>
                    <th>Nama Mahasiswa</th>
                    <th>Jurusan</th>
                    <th>Nilai</th>
                    <th>Keterangan</th>
                    <th>Tanggal</th>
                </tr>
            </thead>
            <tbody>
            <?php
            	$JumlahData = $DataSoal->get_hasil_ujian('',$a,'jumlah', $tahun);
				if ($JumlahData<=0){
					echo "<tr class='odd gradeX'>";
					echo "<td>No Data</td>";
					echo "<td></td>";
					echo "<td></td>";
					echo "<td></td>";
					echo "<td></td>";
					echo "<td></td>";
					echo "</tr>";	
				}else{
					for ($a=1;$a<=$JumlahData;$a++){
						$no = $DataSoal->get_hasil_ujian('id',$a,'', $tahun);
						$id = $DataSoal->get_hasil_ujian('NoPendaftaran',$a,'', $tahun);
						$Nama = $DataSoal->get_hasil_ujian('Nama', $a, '', $tahun);
						$Jurusan = $DataSoal->get_hasil_ujian('Jurusan', $a, '', $tahun);
						$Nilai = $DataSoal->get_hasil_ujian('Nilai',$a,'', $tahun);
						$Keterangan = $DataSoal->get_hasil_ujian('Keterangan',$a,'', $tahun);
						$tanggal = $DataSoal->get_hasil_ujian('tanggal',$a,'', $tahun);
						$b	= $b + 1;

						echo "<tr id='".$no."' class='odd gradeX context'>";
						echo "<td>".$id."</td>";
						echo "<td>".$Nama."</td>";
						echo "<td>".$Jurusan."</td>";
						echo "<td>".$Nilai."</td>";
						echo "<td>".$Keterangan."</td>";
						echo "<td>".$tanggal."</td>";
						echo "</tr>";
					}
				}
			?>
        	</tbody>
          </table>
