<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
	<style type="text/css" media="print">
    @page 
    {
        size: auto;   /* auto is the initial value */
        margin: 0mm;
		margin-top:30px;  /* this affects the margin in the printer settings */
    }
	
	#biodata tr td {
		padding-top:5px;
		}
		
	table { page-break-inside:auto; }
   tr    {  page-break-after:auto }
   thead{
    display: table-header-group;
}
   	
	</style>
         <style type="text/css">
		@media print {
			 body {
			  	table { page-break-inside:auto; }
			   tr    {  page-break-after:auto }
			   thead{
				display: table-header-group;
				}
			
			}
			@page {
			  	table { page-break-inside:auto; }
			   tr    {  page-break-after:auto }
			   thead{
				display: table-header-group;
				}
			
			  }
		}
</style>
<body style="margin-left:30px; margin-right:30px;">
	
    <?php
    include "php_class/class_mysql.php";
	include "php_class/class_absen.php";
				include "php_class/class_dosen.php";	
			$DataDosen = new dataDosen;

	$dataabsen = new dataabsen;
	$dataabsen2 = new dataabsen;
	$dataabsen3 = new dataabsen;
	$dataabsen4 = new dataabsen;
	include "php_class/class_jadwal.php";
	$DataJadwal = new dataJadwal;
	?>
    
    							<?php 
							$tanggalawal = $_POST['tanggalawal'];
							$tanggalawal = substr($tanggalawal, 0, 10);
							$tanggalakhir = $_POST['tanggalakhir'];
							$tanggalakhir = substr($tanggalakhir, 0, 10);
							
							$hari = $_POST['hari'];
							$tahun = $_POST['tahun'];
							$semester = $_POST['semester'];
							$program = $_POST['program'];
							$jurusan = $_POST['jurusan'];
							
								if ($tahun == '' ){
									$tahun = '2016/2017';
								}
								if ($semester == '' ){
									$semester = 'GENAP';
								}					
								if ($hari == '' ){
									$hari = 'SEMUA';
								}
								if ($tanggalawal == '' ){
									$tanggalawal = date('Y-m-d');
								}
								if ($tanggalakhir == '' ){
									$tanggalakhir = date('Y-m-d');
								}					
								
								
							?>

<table width="87%" border="0" style="margin-top:-20px;">
  <tr>
    <td><img src="pict/3.jpg" width="692" height="136"></td>
  </tr>
</table>
          <table width="100%" border="0">
              <tr>
                <td>LAPORAN KEHADIRAN DOSEN</td>
              </tr>
              <tr>
                <td>&nbsp;</td>
              </tr>
		</table>
          <table width="100%" style="border-collapse:collapse;" border="1">
          <thead>
                <tr>
                    <th>No</th>
                    <th>Nama Dosen</th>
                    <th>Mata Kuliah</th>
                    <th>Kelas</th>
                    <th>Hari</th>
                    <th>Waktu</th>
                    <th>Jumlah Kehadiran</th>
                </tr>
            </thead>
            <tbody>
            <?php
            	$JumlahData = $dataabsen->get_data_jadwal_rekap('',$a,'jumlah', $semester, $tahun, $jurusan, $program, $tanggalawal, $tanggalakhir, $hari);
				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++){
						$id = $dataabsen->get_data_jadwal_rekap('id',$a,'', $semester, $tahun, $jurusan, $program, $tanggalawal, $tanggalakhir, $hari);
						$dosen = $dataabsen->get_data_jadwal_rekap('dosen', $a, '', $semester, $tahun, $jurusan, $program, $tanggalawal, $tanggalakhir, $hari);
						$matakuliah = $dataabsen->get_data_jadwal_rekap('matakuliah',$a,'', $semester, $tahun, $jurusan, $program, $tanggalawal, $tanggalakhir, $hari);
						$kelas = $dataabsen->get_data_jadwal_rekap('kelas',$a,'', $semester, $tahun, $jurusan, $program, $tanggalawal, $tanggalakhir, $hari);
						$haris = $dataabsen->get_data_jadwal_rekap('hari',$a,'', $semester, $tahun, $jurusan, $program, $tanggalawal, $tanggalakhir, $hari);
						$waktu = $dataabsen->get_data_jadwal_rekap('waktu',$a,'', $semester, $tahun, $jurusan, $program, $tanggalawal, $tanggalakhir, $hari);
						$jumlah = $dataabsen->get_data_jadwal_rekap('jumlah',$a,'', $semester, $tahun, $jurusan, $program, $tanggalawal, $tanggalakhir, $hari);
						
						echo "<tr id='".$id."' class='odd gradeX'>";
						echo "<td id='".$id."' class='context'>".$a."</td>";
						echo "<td id='".$id."' class='context'>".$dosen."</td>";
						echo "<td id='".$id."' class='context'>".$matakuliah."</td>";
						echo "<td id='".$id."' class='context'>".$kelas."</td>";
						echo "<td id='".$id."' class='context'>".$haris."</td>";
						echo "<td id='".$id."' class='context'>".$waktu."</td>";
						echo "<td id='".$id."' class='context'>".$jumlah."</td>";
						echo "</tr>";
					}
				}
			?>
        	</tbody>
          </table>
<?php
			$tanggal1 = date('d');
			$bulan = date('m'); 
			$tahun1 = date('Y');
			
			if ($bulan == '01'){
				$bulans = 'Januari';
			}elseif ($bulan == '02'){ 
				$bulans = 'Februari';
			}elseif ($bulan == '03'){
				$bulans = 'Maret';
			}elseif ($bulan == '04'){
				$bulans = 'April';
			}elseif ($bulan == '05'){
				$bulans	= 'Mei';
			}elseif ($bulan == '06'){
				$bulans = 'Juni';	
			}elseif ($bulan == '07'){
				$bulans = 'Juli';	
			}elseif ($bulan == '08'){
				$bulans = 'Agustus';	
			}elseif ($bulan == '09'){
				$bulans = 'September';	
			}elseif ($bulan == '10'){
				$bulans = 'Oktober';
			}elseif ($bulan == '11'){
				$bulans ==	'November';
			}elseif ($bulan == '12'){
				$bulans = 'Desember';	
			}

?>
<table width="100%" border="0" style="border-collapse:collapse;">
  <tr>
    <td colspan="2">&nbsp;</td>
    <td width="52%"><div align="center">Denpasar, <?php echo $tanggal1." ".$bulans." ".$tahun1?></div></td>
  </tr>
  <tr>
    <td colspan="2">&nbsp;</td>
    <td><div align="center">Universitas Warmadewa</div></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td><div align="center">Fakultas Ekonomi</div></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td><div align="center">an Dekan</div></td>
  </tr>
  <tr>
    <td width="40%"><div align="center"></div></td>
    <td width="8%">&nbsp;</td>
    <td><div align="center">Wakil Dekan I</div></td>
  </tr>
  <tr>
    <td colspan="2">&nbsp;</td>
    <td><div align="center"></div></td>
  </tr>
	<?php 
			$DataDosen1 = new dataDosen;
			$DataDosen2 = new dataDosen;
			$wadek = $DataDosen1->get_pejabat_by_id('nama', '1');
			$nipwadek = $DataDosen2->get_pejabat_by_id('NIP', '1');
	?>
  <tr>
    <td><div align="center"></div></td>
    <td>&nbsp;</td>
    <td><div align="center"><u><?php echo $wadek?></u></div></td>
  </tr>
  <tr>
    <td><div align="center"></div></td>
    <td>&nbsp;</td>
    <td><div align="center">NIK/NIP. <?php echo $nipwadek?></div></td>
  </tr>
</table>
<blockquote>
  <p>&nbsp;</p>
</blockquote>
</body>
</html>