<!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 */
		margin-bottom:25px;
    }
	
	#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">
	td {
		padding-left:5px;
	}
    </style>
<body style="margin-left:50px; margin-right:50px; font-size:12px">
<?php 
	include "php_class/class_mysql.php";
	include "php_class/class_jadwal.php";
	include "php_class/class_dosen.php";	
	$DataDosen = new dataDosen;
	$DataDosen1 = new dataDosen;
	$DataDosen2 = new dataDosen;
	$DataJadwal = new dataJadwal;
	$DataJadwal2 = new dataJadwal;
	$DataJadwal3 = new dataJadwal;

	$semester = $_POST['semester'];;
	$tahun = $_POST['tahun'];
	$status = $_POST['status'];
	$jurusan = $_POST['jurusan'];
?>

<table width="100%" border="0">
  <tr>
    <td>FORM B DOSEN LUAR</td>
  </tr>
  <tr>
    <td>UNIVERSITAS WARMADEWA</td>
  </tr>
  <tr>
    <td>FAKULTAS EKONOMI</td>
  </tr>
</table>
<table width="100%" border="1" style="border-collapse:collapse; margin-top:30px">
  <tr>
    <td>NO</td>
    <td>DOSEN PENGAJAR</td>
    <td>GOL</td>
    <td>INSTANSI</td>
    <td>MATA KULIAH</td>
    <td>SMT</td>
    <td>JUR</td>
    <td>KLS</td>
    <td>SKS</td>
    <td>TTL SKS</td>
    <td>NO. REK</td>
  </tr>
  		<?php
        $Jumlah1 = $DataJadwal->get_data_beban_rekap('',$b,'jumlah', $semester, $tahun, $status, $jurusan);
		for ($b=1;$b<=$Jumlah1;$b++){
		$nama1 = $DataJadwal->get_data_beban_rekap('nama', $b, '', $semester, $tahun, $status, $jurusan);
		$golongan = $DataJadwal->get_data_beban_rekap('gol',$b,'', $semester, $tahun, $status, $jurusan);
		$norek = $DataJadwal->get_data_beban_rekap('norek',$b,'', $semester, $tahun, $status, $jurusan);
		
			$totalsks = 0;
			$Jumlah2 = $DataJadwal2->get_data_sk_nama('',$a,'jumlah', $nama1, $semester, $tahun);
				for ($a=1;$a<=$Jumlah2;$a++){
					$sks = $DataJadwal2->get_data_sk_nama('sks',$a,'', $nama1, $semester, $tahun);
					$totalsks = $totalsks + $sks;
					
					$i = $a;
					if ($totalsks >= 6){
						break;	
					}
				}
				$gol = '';
				for ($c=1;$c<=$i;$c++){
					$matakuliah = $DataJadwal2->get_data_sk_nama('matakuliah',$c,'', $nama, $semester, $tahun);
					$kelas = $DataJadwal2->get_data_sk_nama('kelas', $c, '', $nama, $semester, $tahun);
					$sks = $DataJadwal2->get_data_sk_nama('sks',$c,'', $nama, $semester, $tahun);
					$hari = $DataJadwal2->get_data_sk_nama('hari',$c,'', $nama, $semester, $tahun);
					$ruang = $DataJadwal2->get_data_sk_nama('ruang',$c,'', $nama, $semester, $tahun);
					$waktu = $DataJadwal2->get_data_sk_nama('waktu',$c,'', $nama, $semester, $tahun);
					$sm = $DataJadwal2->get_data_sk_nama('semester',$c,'', $nama, $semester, $tahun);
					
					if($c > 1){
						$nomer = '';	
					}else{
						$nomer = $b	;
					}
    ?>
  <tr>
    <td><?php echo $nomer?></td>
    <td><?php echo $nama1?></td>
    <td><?php echo $golongan?></td>
    <td>FE Unwar</td>
    <td><?php echo $matakuliah?></td>
    <td><?php echo $sm?></td>
    <td>
		<?php
			$sb = substr($kelas, 0, 1);
			if($sb == 'D'){
				$jur = 'AKUN';	
			}elseif($sb == 'B'){
				$jur = 'IESP';	
			}else{
				$jur = 'MAN';	
			}
			echo $jur;
		?>
    </td>
    <td><?php echo $kelas?></td>
    <td><?php echo $sks?></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <?php
    		$Jmlsks = $Jmlsks + $sks;
   }
    ?>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td><?php echo $totalsks?></td>
    <td><?php echo $norek?></td>
  </tr>
  <?php 
			$JmlTotal = $JmlTotal +  $totalsks;

  } ?>
  <tr>
    <td colspan="8">TOTAL SKS</td>
    <td><?php echo $Jmlsks?></td>
    <td><?php echo $JmlTotal?></td>
    <td>&nbsp;</td>
  </tr>
</table>
<p>&nbsp;</p>
<table width="100%" border="0" style="border-collapse:collapse;">
  <tr>
    <td>&nbsp;</td>
    <td width="52%"><div align="center">Denpasar, <?php echo $tgl?></div></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><div align="center">Universitas Warmadewa</div></td>
  </tr>
  <tr>
    <td><div align="center"></div></td>
    <td><div align="center">Fakultas Ekonomi</div></td>
  </tr>
  <tr>
    <td><div align="center">Mengetahui</div></td>
    <td><div align="center">A.N. Dekan</div></td>
  </tr>
  <tr>
    <td><div align="center">Rektor,</div></td>
    <td><div align="center">Wadek II</div></td>
  </tr>
  <tr>
    <td height="41">&nbsp;</td>
    <td></td>
  </tr>
	<?php 
			$dekan = $DataDosen1->get_pejabat_by_id('nama', '2');
			$nipdekan = $DataDosen1->get_pejabat_by_id('NIP', '2');
			$rektor = $DataDosen2->get_pejabat_by_id('nama', '11');
			$niprektor = $DataDosen2->get_pejabat_by_id('NIP', '11');
	?>
  <tr>
    <td><div align="center"><u><?php echo $rektor ?></u></div></td>
    <td><div align="center"><u><?php echo $dekan ?></u></div></td>
  </tr>
  <tr>
    <td><div align="center">NIK. <?php echo $niprektor?></div></td>
    <td><div align="center">NIK. <?php echo $nipdekan?></div></td>
  </tr>
</table>

<p>&nbsp;</p>
</body>
</html>