<?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-SKK-ulang.xls");
 
// Add data table
?>
<?php
							include "php_class/class_mysql.php";
	include "php_class/class_skk.php";
	$Dataskk = new DataSkk;
							$jurusan = $_POST['jurusan'];
							$tahun = $_POST['tahun'];
							$Semester1 = $_POST['Semester1'];

									if ($jurusan == "31"){
										$cetakjurusan = "IESP";	
									}elseif ($jurusan == "32"){
										$cetakjurusan = "MANAJEMEN";
									} elseif ($jurusan == "33"){
										$cetakjurusan = "AKUNTANSI";	
									}else{
										$cetakjurusan = 'Semua';
									}			
								
								if ($tahun == ""){
									$tahun = date('y');
									}			
								$cetaktahun = "20".$tahun;

?>


                          <table  border="1">
                             <thead>
                                <tr>
                                    <th>NPM</th>
                                    <th>Nama Mahasiswa</th>
                                    <th>Semester</th>
				    <th>Tahun Akademik</th>
                                    <th>Total</th>
                                </tr>
                            </thead>
                            <tbody>
                            <?php
								$JumlahData = $Dataskk->get_rekap('',$a,'jumlah', $tahun, $jurusan, $Semester1);
                                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{
                                    
									for ($a=1;$a<=$JumlahData;$a++){
										$NPM = $Dataskk->get_rekap('NPM',$a,'', $tahun, $jurusan, $Semester1);
                                        $Nama = $Dataskk->get_rekap('Nama',$a,'', $tahun, $jurusan, $Semester1);
										$Semester = $Dataskk->get_rekap('semester',$a,'', $tahun, $jurusan, $Semester1);
										$Total = $Dataskk->get_rekap('total',$a,'', $tahun, $jurusan, $Semester1);
										$tahunAkademik = $Dataskk->get_rekap('tahunAkademik',$a,'', $tahun, $jurusan, $Semester1);

                                        echo "<tr id='".$kunci."' noTrx = '".$no."' nopendaftaran = '".$NoPendaftaran."' class='odd gradeX'>";
                                        echo "<td>".$NPM."</td>";
                                        echo "<td>".$Nama."</td>";
										echo "<td>".$Semester."</td>";
										echo "<td>".$tahunAkademik."</td>";
										echo "<td>".$Total."</td>";
                                        echo "</tr>";
                                    }
                                }
                            ?>
                            </tbody>
                          </table>
