<!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{
	   border:thin solid #000;
    display: table-header-group;
}
table { page-break-inside:auto }
tr    { page-break-inside:avoid; page-break-after:auto }
thead { display:table-header-group }
tfoot { display:table-footer-group }
	</style>
    <style type="text/css">
	td {
		padding-left:5px;
	}
    </style>
<body style="margin-left:50px; margin-right:50px; font-size:12px">
<?php 
	error_reporting(0);
	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;
	$DataJadwal4 = new dataJadwal;

	$semester = $_POST['semester'];;
	$tahun = $_POST['tahun'];
	$status = 'Dosen Dalam';
	$jurusan = $_POST['jurusan'];
	$program = $_POST['program'];
	//echo $program;
	
?>

<table width="100%" border="0">
  <tr>
    <td>Form B Dosen Dalam</td>
  </tr>
  <tr>
    <td>UNIVERSITAS WARMADEWA</td>
  </tr>
  <tr>
    <td>FAKULTAS EKONOMI</td>
  </tr>
  <tr>
    <td>JURUSAN <?php echo $jurusan?></td>
  </tr>
</table>
<table width="100%" border="1" style="border-collapse:collapse; margin-top:30px; ">
 <thead> 
  <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>
</thead>
  		<?php
        $Jumlah1 = $DataJadwal->get_beban_rekap_formb('',$b,'jumlah', $semester, $tahun, $jurusan, $program, $status);
		for ($b=1;$b<=$Jumlah1;$b++){
		$nama1 = $DataJadwal->get_beban_rekap_formb('nama', $b, '', $semester, $tahun, $jurusan, $program, $status);
		$golongan = $DataJadwal->get_beban_rekap_formb('gol',$b,'', $semester, $tahun, $jurusan, $program, $status);
		$norek = $DataJadwal->get_beban_rekap_formb('norek',$b,'', $semester, $tahun, $jurusan, $program, $status);
		$subunitkerja = $DataJadwal->get_beban_rekap_formb('subunitkerja',$b,'', $semester, $tahun, $jurusan, $program, $status);
		
			$totalsks = 0;
			$Jumlah2 = $DataJadwal2->get_data_sk_nama_rekap('',$a,'jumlah', $nama1, $semester, $tahun, $program, $jurusan);
				for ($c=1;$c<=$Jumlah2;$c++){
					$matakuliah = $DataJadwal2->get_data_sk_nama_rekap('matakuliah',$c,'', $nama, $semester, $tahun, $program, $jurusan);
					$kelas = $DataJadwal2->get_data_sk_nama_rekap('kelas', $c, '', $nama, $semester, $tahun, $program, $jurusan);
					$sks = $DataJadwal2->get_data_sk_nama_rekap('sks',$c,'', $nama, $semester, $tahun, $program, $jurusan);
					$hari = $DataJadwal2->get_data_sk_nama_rekap('hari',$c,'', $nama, $semester, $tahun, $program, $jurusan);
					$ruang = $DataJadwal2->get_data_sk_nama_rekap('ruang',$c,'', $nama, $semester, $tahun, $program, $jurusan);
					$waktu = $DataJadwal2->get_data_sk_nama_rekap('waktu',$c,'', $nama, $semester, $tahun, $program, $jurusan);
					$sm = $DataJadwal2->get_data_sk_nama_rekap('semester',$c,'', $nama, $semester, $tahun, $program, $jurusan);
					$totalsks = $totalsks + $sks;

					if($c > 1){
						$nomer = '';	
					}else{
						$nomer = $b	;
					}
    ?>
  <tr>
    <td><?php echo $nomer?></td>
    <td><?php echo $nama1?></td>
    <td><?php echo $golongan?></td>
    <td><?php echo $subunitkerja?></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
   }
    ?>
  <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 $JmlTotal?></td>
    <td><?php echo $JmlTotal?></td>
    <td>&nbsp;</td>
  </tr>
</table>
<p>&nbsp;</p>
<?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>&nbsp;</td>
    <td width="52%"><div align="center">Denpasar, <?php echo $tanggal1." ".$bulans." ".$tahun1?></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>