<!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" />
    <link href="<?php echo $base?>bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <link href="<?php echo $base?>font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
    <link href="<?php echo $base?>plugins/jvectormap/jquery-jvectormap-1.2.2.css" rel="stylesheet" type="text/css" />
    <link href="<?php echo $base?>dist/css/AdminLTE.min.css" rel="stylesheet" type="text/css" />
    <link href="<?php echo $base?>dist/css/skins/_all-skins.min.css" rel="stylesheet" type="text/css" />
    
	<script src="<?php echo $base?>plugins/jQuery/jQuery-2.1.4.min.js"></script>
    <script src="<?php echo $base?>bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
    <script src='<?php echo $base?>plugins/fastclick/fastclick.min.js'></script>
    <script src="<?php echo $base?>dist/js/app.min.js" type="text/javascript"></script>
    
    <script src="<?php echo $base?>dist/js/demo.js" type="text/javascript"></script>
<title>Untitled Document</title>

</head>
	<style type="text/css" media="print">
    @page 
    {
        size: auto;   /* auto is the initial value */
        margin: 0mm;  /* this affects the margin in the printer settings */
    }
	</style>
<body>
	<?php
        include "php_class/class_mysql.php";
        include "php_class/class_mahasiswa.php";
        $DataMahasiswa = new DataMahasiswa;
        $NoTrx =  $_GET['id'];
        include "php_class/class_transaksi.php";	
        $DataTransaksi = new DataTransaksi;
        $id = $DataTransaksi->get_npm_single_by_ids('NPM', $NoTrx);
		
		$noArsip = substr($NoTrx, 4, 4)
    ?>

<table width="100%" border="0" style="margin-top:10px;">
  <tr>
    <td width="12%" rowspan="3" style="padding-left:30px;"><img src="pict/logo.png" height="70" width="70"></td>
    <td width="68%" style="font-weight:bold; padding-left:30px;">UNIVERSITAS WARMADEWA</td>
    <td width="20%">&nbsp;</td>
  </tr>
  <tr>
    <td style="font-weight:bold; padding-left:30px;">FAKULTAS EKONOMI</td>
    <td style="padding-right:30px;"><div align="right">Arsip</div></td>
  </tr>
  <tr>
    <td style="font-weight:bold; padding-left:30px;">KLAS R. SORE - EKSEKUTIF</td>
    <td style="padding-right:30px;"><div align="right">No. <?php echo $noArsip?></div></td>
  </tr>
</table>
<table width="100%" border="0" style="font-weight:bold;">
  <tr>
    <td><div align="center">KWITANSI</div></td>
  </tr>
  <tr>

  <?php 
	$JumlahData = $DataTransaksi->get_last_detil_trans('',$a,'jumlah', $NoTrx);
		for ($a=2;$a<=$JumlahData;$a++){
			$namaTrx = $DataTransaksi->get_last_detil_trans('NamaTRX',$a,'', $NoTrx);
			$nama2 = ", ". $namaTrx;
		}
		if ($JumlahData > 1 ) {
		$Nama1 = $DataTransaksi->get_last_detil_trans('NamaTRX',1,'', $NoTrx);
		$Namatotal = $Nama1.$nama2;
		}else{
		$Namatotal = $DataTransaksi->get_last_detil_trans('NamaTRX',1,'', $NoTrx);	
			}
  ?>

    <td><div align="center">Pembayaran <?php echo $Namatotal; ?></div></td>
  </tr>
</table>

<?php 

	$NPM = $DataMahasiswa->get_mahasiswa_single_by_npm_trx('NPM', $id);
	$nama = $DataMahasiswa->get_mahasiswa_single_by_npm_trx('Nama', $id);
	$Jurusan = $DataMahasiswa->get_mahasiswa_single_by_npm_trx('Jurusan', $id);
	$tempatLahir = $DataMahasiswa->get_mahasiswa_single_by_npm_trx('TempatLahir', $id);
	$tgl = $DataMahasiswa->get_mahasiswa_single_by_npm_trx('TglLahir', $id);
	$jenisKelamin = $DataMahasiswa->get_mahasiswa_single_by_npm_trx('JenisKelamin', $id);
	$agama = $DataMahasiswa->get_mahasiswa_single_by_npm_trx('Agama', $id);
	$alamat = $DataMahasiswa->get_mahasiswa_single_by_npm_trx('Alamat', $id);
	$notelp = $DataMahasiswa->get_mahasiswa_single_by_npm_trx('NoTelp', $id);
	$email = $DataMahasiswa->get_mahasiswa_single_by_npm_trx('Email', $id);
	$asalSekolah = $DataMahasiswa->get_mahasiswa_single_by_npm_trx('AsalSekolah', $id);
	$statusPerkawinan = $DataMahasiswa->get_mahasiswa_single_by_npm_trx('StatusPerkawinan', $id);
	$statusPekerjaan = $DataMahasiswa->get_mahasiswa_single_by_npm_trx('StatusPekerjaan', $id);
	$perusahaan = $DataMahasiswa->get_mahasiswa_single_by_npm_trx('Perusahaan', $id);
	$jabatan = $DataMahasiswa->get_mahasiswa_single_by_npm_trx('Jabatan', $id);
	$alamatPerusahaan = $DataMahasiswa->get_mahasiswa_single_by_npm_trx('AlamatPerusahaan', $id);
	$statusMahasiswa = $DataMahasiswa->get_mahasiswa_single_by_npm_trx('StatusMahasiswa', $id);
	$perguruanTinggiAsal = $DataMahasiswa->get_mahasiswa_single_by_npm_trx('PerguruanTinggiAsal', $id);
	$programStudi = $DataMahasiswa->get_mahasiswa_single_by_npm_trx('ProgramStudi', $id);
	$jenjang = $DataMahasiswa->get_mahasiswa_single_by_npm_trx('Jenjang', $id);
	$sks = $DataMahasiswa->get_mahasiswa_single_by_npm_trx('SKSDiakui', $id);
?>

<table width="100%" border="0" style="border-collapse:collapse; ">
  <tr>
    <td width="17%" style="padding-left:30px;">Sudah terima dari</td>
    <td width="1%">&nbsp;</td>
    <td colspan="5">&nbsp;</td>
  </tr>
  <tr>
    <td style="padding-left:30px;">Nama</td>
    <td>:</td>
    <td colspan="5"><?php echo $nama ?></td>
  </tr>
  <tr>
    <td style="padding-left:30px;">NPM</td>
    <td>:</td>
    <td colspan="5"><?php echo $NPM ?></td>
  </tr>
  <tr>
    <td style="padding-left:30px;">Jurusan / Prodi</td>
    <td>:</td>
    <td colspan="5"><?php echo $Jurusan?></td>
  </tr>
  <tr>
    <td style="padding-left:30px;">Alamat / No. Telp.</td>
    <td>:</td>
    <td colspan="5"><?php echo $alamat?> / <?php echo $notelp?></td>
  </tr>
  <tr>
    <td style="padding-left:30px;">Buat Pembayaran</td>
    <td>:</td>
    <td width="4%"></td>
    <td width="32%"></td>
    <td width="3%"></td>
    <td width="11%"></td>
    <td width="32%"></td>
  </tr>
  <?php 
	$total = 0;
	$Nomer = 0;
	$JumlahData = $DataTransaksi->get_last_detil_trans('',$a,'jumlah', $NoTrx);
		for ($a=1;$a<=$JumlahData;$a++){
			$ID = $DataTransaksi->get_last_detil_trans('ID', $a, '', $NoTrx);
			$tglInput = $DataTransaksi->get_last_detil_trans('TglInput',$a,'', $NoTrx);
			$namaTrx = $DataTransaksi->get_last_detil_trans('NamaTRX',$a,'', $NoTrx);
			$Biaya = $DataTransaksi->get_temp('Biaya',$a,'', $NoTrx);
			$tgl = $DataTransaksi->get_temp('Tgl',$a,'', $NoTrx);
			$total = $total + $Biaya;
			$Nomer = $Nomer + 1;
  ?>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td width="4%"><div align="right"><?php echo $Nomer?>. </div></td>
    <td width="32%"> <?php echo $namaTrx ?></td>
    <td width="3%">Rp.</td>
    <td><?php echo number_format($Biaya)?></td>
    <td>&nbsp;</td>
  </tr>
<?php  } ?>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td style="padding-right:5px"><div align="right">Jumlah</div></td>
    <td style="border-top:solid thin #000">Rp.</td>
    <td style="border-top:solid thin #000"><?php echo number_format($total)?></td>
    <td >&nbsp;</td>
  </tr>
</table>
<div style="padding-left:30px;">
<?php include "terbilang.php ";

	$nilai = $total;
        
	 echo "Terbilang : "; 	
     echo terbilang($nilai, $style=3);
	 echo " Rupiah";

?>
</div>
<?php 
	$tanggal = date('d');
	$bulan = date('m'); 
	$tahun = 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';	
	}
	
	include "php_class/class_setting_laporan.php";
	$DataSetLaporan = new DataSetLaporan;

	$Namabd = $DataSetLaporan->get_setting('nama');
	$NIPbd = $DataSetLaporan->get_setting('nip');
 
?>
<table width="100%" border="0" style="border-collapse:collapse">
  <tr>
    <td width="70%">&nbsp;</td>
    <td width="30%"><div align="center">Denpasar, <?php echo $tanggal."-".$bulans."-".$tahun ?></div></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><div align="center">Bendahara</div></td>
  </tr>
  <tr>
    <td height="67">&nbsp;</td>
    <td><div align="center"></div></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><div align="center"><?php echo $Namabd ?></div></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><div align="center">NIK. <?php echo $NIPbd ?></div></td>
  </tr>
</table>
</body>
</html>