<!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_ujianakhir.php";
	include "php_class/class_dosen.php";	
	include "php_class/class_jadwal.php";	
	$DataDosen1 = new dataDosen;
	$DataDosen2 = new dataDosen;
	$DataUjian1 = new dataUjian;
	$DataUjian2 = new dataUjian;
	$DataUjian3 = new dataUjian;
	$DataJadwal = new dataJadwal;
	
	$koreksiuts = $DataUjian3->get_koreksi('koreksiuts');
	$naskahuts = $DataUjian3->get_koreksi('naskahuts');
	$koreksiuas = $DataUjian3->get_koreksi('koreksiuas');
	$naskahuas = $DataUjian3->get_koreksi('naskahuas');
	
	$koreksiutsnon = $DataUjian3->get_koreksi('koreksiutsnon');
	$naskahutsnon = $DataUjian3->get_koreksi('naskahutsnon');
	$koreksiuasnon = $DataUjian3->get_koreksi('koreksiuasnon');
	$naskahuasnon = $DataUjian3->get_koreksi('naskahuasnon');
	
	$semester = $_GET['semester'];;
	$tahun = $_GET['tahun'];
	$program = $_GET['program'];
	
	if($program == 'REGULER'){
		$uangkoreksi = $koreksiuas;	
		$uangnaskah = $naskahuas;
	}else{
		$uangkoreksi = $koreksiuasnon;	
		$uangnaskah = $naskahuasnon;
	}
	
	
?>

<table width="100%" border="0">
  <tr>
    <td style="font-size:16px"><strong>DAFTAR UANG KOREKSI, NASKAH UAS SEMESTER <?php echo $semester ?> <?php echo $tahun?></strong></td>
  </tr>
  <tr>
    <td style="font-size:16px"><strong>FAKULTAS EKONOMI UNIVERSITAS WARMADEWA</strong></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>
<table width="100%" border="1" style="border-collapse:collapse;">
  <tr>
    <td><div align="center">NO</div></td>
    <td><div align="center">DOSEN PENGAJAR</div></td>
    <td><div align="center">HDR</div></td>
    <td><div align="center">KOREKSI</div></td>
    <td><div align="center">TOTAL</div></td>
    <td><div align="center">NASKAH</div></td>
    <td><div align="center">TOTAL</div></td>
    <td><div align="center">NO. REK</div></td>
  </tr>
            <?php
            	$jumlahnama = $DataUjian1->get_data_uts_laporan('',$b,'jumlah', $semester, $tahun);
				for ($b=1;$b<=$jumlahnama;$b++){
					$dosen = $DataUjian1->get_data_uts_laporan('dosen', $b, '', $semester, $tahun);
					$totalkoreksi = 0;
					$jmlkoreksi =  0;
					$jmlnashkah = 0;
					$jmlkanan = 0;
 	           		$JumlahData = $DataUjian2->get_data_uts_nama('',$a,'jumlah', $dosen, $semester, $tahun);
					for ($a=1;$a<=$JumlahData;$a++){
						$id = $DataUjian2->get_data_uts_nama('id',$a,'', $dosen, $semester, $tahun);
						$dosen = $DataUjian2->get_data_uts_nama('dosen', $a, '', $dosen, $semester, $tahun);
						$matakuliah = $DataUjian2->get_data_uts_nama('matakuliah',$a,'', $dosen, $semester, $tahun);
						$jurusan = $DataUjian2->get_data_uts_nama('jurusan',$a,'', $dosen, $semester, $tahun);
						$kelas = $DataUjian2->get_data_uts_nama('kelas',$a,'', $dosen, $semester, $tahun);
						$hari = $DataUjian2->get_data_uts_nama('hari',$a,'', $dosen, $semester, $tahun);
						$hadir = $DataUjian2->get_data_uts_nama('hadir',$a,'', $dosen, $semester, $tahun);
						$norek = $DataUjian2->get_data_uts_nama('norek',$a,'', $dosen, $semester, $tahun);
						$jmlhadir = $DataUjian2->get_data_uts_nama('jmlhadir',$a,'', $dosen, $semester, $tahun);
						$totalkoreksi = $jmlhadir*$uangkoreksi;
						
					if($a > 1){
						$nomer = '';	
					}else{
						$nomer = $b	;
					}

			?>
  <tr>
    <td><?php echo $nomer?></td>
    <td><?php echo $dosen?></td>
    <td><?php echo $jmlhadir?></td>
    <td>Rp. <?php echo number_format($uangkoreksi)?></td>
    <td>Rp. <?php echo number_format($totalkoreksi)?></td>
    <td>Rp. <?php echo number_format($uangnaskah)?></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
 	 <?php 
  	$jmlkoreksi =  $jmlkoreksi + $totalkoreksi;
	$jmlnashkah = $uangnaskah * $a;
	$jmlkanan = $jmlkoreksi + $jmlnashkah;
	} 
	?>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td style="color:#00F">Rp. <?php echo number_format($jmlkoreksi)?></td>
    <td style="color:#00F">Rp. <?php echo number_format($jmlnashkah)?></td>
    <td style="color:#00F">Rp. <?php echo number_format($jmlkanan)?></td>
    <td><?php echo $norek?></td>
  </tr>
  <?php 
	$jmlkanantotal = $jmlkanantotal + $jmlkanan;
				}

   ?>
  <tr>
    <td>&nbsp;</td>
    <td><div align="center">TOTAL</div></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td style="color:#00F">Rp. <?php echo number_format($jmlkanantotal)?></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"></div></td>
    <td><div align="center">A.N. Dekan</div></td>
  </tr>
  <tr>
    <td><div align="center"></div></td>
    <td><div align="center">Wadek II</div></td>
  </tr>
  <tr>
    <td height="41">&nbsp;</td>
    <td></td>
  </tr>
	<?php 
			$bendahara = $DataDosen3->get_pejabat_by_id('nama', '7');
			$nipbendahara = $DataDosen3->get_pejabat_by_id('NIP', '7');
	
			$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');

     	if ($program == 'REGULER'){
			$dekan = $dekan;
			$nipdekan = $nipdekan;
		}else{
			$dekan = $bendahara;
			$nipdekan = $nipbendahara;	
		}
	
	?>
  <tr>
    <td><div align="center"></div></td>
    <td><div align="center"><u><?php echo $dekan ?></u></div></td>
  </tr>
  <tr>
    <td><div align="center"></div></td>
    <td><div align="center">NIK. <?php echo $nipdekan?></div></td>
  </tr>
</table>

</body>
</html>