<?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=tabel-peserta-sempek.xls");
 
// Add data table
?>
<?php
	include "config/session.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_semesterpendek.php";

	$datasp = new DataSemesterPendek;
	$DataTransaksi = new DataTransaksi;
	$datagrup = new DataGrup;
	$DataMahasiswa = new DataMahasiswa;
	$DataTemplate = new DataTemplate;

								$tahun = $_POST["tahun"];
								$program = $_POST['program'];
								$semester = $_POST['semester'];

								?>				
                          <table border="1">
                             <thead>
                                <tr>
                                    <th>No</th>
                                    <th>Sandi Mata Kuliah</th>
                                    <th>Mata Kuliah</th>
                                    <th>Peserta</th>
                                    <th>Keterangan</th>
                                </tr>
                            </thead>
                            <tbody>
                            
                            <?php
                                $JumlahData = $datasp->get_matkul_sempek('', $a, 'jumlah', $program, $tahun, $semester);
                                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 "</tr>";	
                                }else{
                                        $TotalAkhir = 0;
                                    for ($a=1;$a<=$JumlahData;$a++){
                                        $idmatakuliah = $datasp->get_matkul_sempek('idmatakuliah', $a, '', $program, $tahun, $semester);
										$kode = $datasp->get_matkul_sempek('kode', $a, '', $program, $tahun, $semester);
                                        $matakuliah = $datasp->get_matkul_sempek('matakuliah', $a, '', $program, $tahun, $semester);
										$peserta = $datasp->get_matkul_sempek('peserta', $a, '', $program, $tahun, $semester);
                                        
                                        echo "<tr class='odd gradeX'>";
                                        echo "<td>".$a."</td>";
										echo "<td>".$kode."</td>";
                                        echo "<td>".$matakuliah."</td>";
										echo "<td>".$peserta."</td>";
										echo "<td class='center'></td>";
                                        echo "</tr>";
                                    }
                                }
                            ?>
                            </tbody>
                          </table>
