<?php
error_reporting(0);
// 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-ijin-uas.xls");
 
// Add data table
	include "php_class/class_mysql.php";
	include "php_class/class_surat.php";
	
	$DataSurat = new DataSurat;
	?>
          <table id="example1" class="table table-bordered table-striped table-hover">
             <thead>
                <tr>
                    <th>Nomer Surat</th>
                    <th>Semester Tahun Akademik</th>
                    <th>Mata Kuliah</th>
                    <th>Mahasiswa</th>
                    <th>NPM</th>
                    <th>Semester</th>
                    <th>Sumber Surat</th>
                </tr>
            </thead>
            <tbody>
            <?php
            	$JumlahData = $DataSurat->get_ijinuas_all('',$a,'jumlah');
				if ($JumlahData<=0){
					echo "<tr class='odd gradeX'>";
					echo "<td>No Data</td>";
					echo "<td></td>";
					echo "<td></td>";
					echo "</tr>";	
				}else{
					for ($a=1;$a<=$JumlahData;$a++){
						$id = $DataSurat->get_ijinuas_all('id',$a,'');
						$npm = $DataSurat->get_ijinuas_all('npm',$a,'');
						$matakuliah = $DataSurat->get_ijinuas_all('matakuliah',$a,'');
						$nama = $DataSurat->get_ijinuas_all('nama',$a,'');
						$nomer = $DataSurat->get_ijinuas_all('nomer',$a,'');
						$smt = $DataSurat->get_ijinuas_all('smt',$a,'');
						$npm = $DataSurat->get_ijinuas_all('npm',$a,'');
						$smt = $DataSurat->get_ijinuas_all('smt',$a,'');
						$surat = $DataSurat->get_ijinuas_all('surat',$a,'');
						$perihal = $DataSurat->get_ijinuas_all('perihal',$a,'');

						echo "<tr>";
						echo "<td>".$nomer."</td>";
						echo "<td>".$perihal."</td>";
						echo "<td>".$matakuliah."</td>";
						echo "<td>".$nama."</td>";
						echo "<td>".$npm."</td>";
						echo "<td>".$smt."</td>";
						echo "<td>".$surat."</td>";
						echo "</tr>";
					}
				}
			?>
        	</tbody>
          </table>
