<html>
<head>
<style type="text/css" media="print">
	table {border: solid 1px #000; border-collapse: collapse; width: 100%}
	tr { border: solid 1px #000; page-break-inside: avoid;}
	td { padding: 7px 5px; font-size: 12px}
	th {
		font-family:Arial;
		color:black;
		font-size: 12px;
		background-color:lightgrey;
	}
	thead {
		display:table-header-group;
	}
	tbody {
		display:table-row-group;
	}
	h3 { margin-bottom: -17px }
	h2 { margin-bottom: 0px }
</style>
<style type="text/css" media="screen">
	table {border: solid 0px #000; border-collapse: collapse; width: 100%}
	tr { border: solid 0px #000}
	th {
		font-family:Arial;
		color:black;
		font-size: 12px;
		background-color: green;
		padding: 8px 1;
	}
	td { padding: 7px 5px;font-size: 12px}
	h3 { margin-bottom: -17px }
	h2 { margin-bottom: 0px }
</style>
<title>Cetak Panjar Biaya Perkara</title>
</head>

<body onload="window.print()">
<?php 
$q_instansi	= $this->db->query("SELECT * FROM identitas LIMIT 1")->row();
?>
<h2><img src="<?php echo base_url(); ?>upload/<?php echo $q_instansi->logo; ?>" style="display: inline; float: left; margin-right: 10px; width: 40px; height: 40px"><?php echo $q_instansi->nama_satker; ?></h2>
	Alamat : <?php echo $q_instansi->alamat; ?>	
	</br></br><hr class="onepixel">
<div class="Section1">

<center ><p class="satu"><b>PERINTAH MEMBAYAR PANJAR PERKARA<br> KEPADA <br> <br></b></p><?php echo "Nama Pihak : <b>".$username;?> </b><br>
<?php echo "Jenis Perkara : ".$jenisperkara; ?></center>
<hr class="onepixel">
<br>
<table border=2>
<tr>
<td align="center" bgcolor="#c7f7bf" width="3%" >No</td>
<td align="center" bgcolor="#c7f7bf" width="70%" >Komponen Biaya</td>
<td align="center" bgcolor="#c7f7bf" width="20%" >Jumlah</td>

</tr>

<?php
foreach ($dataidentitas as $rowda) {
	$namapimpinan = $rowda->nama_pimpinan;
}
$warna ="#fcfdfd";
$warnabukanmaterai ="#f9f8f8";
if (empty($komponen)) {
		echo "<tr><td colspan='3' align='center' bgcolor='#f58484'>Data Tidak diTemukan</td></tr>";
	}else{
	$con = 1;
	foreach ($komponen as $row) {
		//$mahasiswa = $row->mahasiswa_id;
		$nama_komponen = $row->nama_komponen;
		$biaya_k = number_format($row->jumlah, 0, ',', '.');
		
	echo "<tr>";
			echo '<td bgcolor='.$warna.'>'.$con.'</td>';
			echo '<td bgcolor='.$warna.'> '.$nama_komponen.'</td>';
			echo '<td bgcolor='.$warna.'> Rp. '.$biaya_k.'</td>';
		echo "</tr>";
		    				$con++;
		    			}
	}



?>

</table>
<table border=2>
<tr>
<td align="center" bgcolor="#c7f7bf" width="3%" >No</td>
<td align="center" bgcolor="#c7f7bf" width="70%" >Komponen Biaya POS</td>
<td align="center" bgcolor="#c7f7bf" width="20%" >Jumlah</td>

</tr>

<?php
$warna ="#fcfdfd";
$warnabukanmaterai ="#f9f8f8";
if (empty($databiayapos)) {
		echo "<tr><td colspan='3' align='center' bgcolor='#f58484'>Data N i h i l</td></tr>";
	}else{
	$con = 1;
	foreach ($databiayapos as $rowpos) {
		$sebutan_pihakpos = $rowpos->pemohon_termohon;
		$jumlah_radiuspos = $rowpos->jumlah_panggilan;
		$biaya_radiuspos = number_format($rowpos->biaya, 0, ',', '.');
		$namapos = $rowpos->nama_pihak;
		$jumlahpos = number_format($rowpos->jumlah_panggilan_x_biaya, 0, ',', '.');
	echo "<tr>";
			echo '<td  bgcolor='.$warna.'>'.$con.'</td>';
			echo '<td  bgcolor='.$warna.'> Biaya Kirim POS '.$sebutan_pihakpos.' [ <b>'.$namapos.'</b> ] '.$jumlah_radiuspos.' x '.$biaya_radiuspos.'</td>';
			echo '<td  bgcolor='.$warna.'> Rp. '.$jumlahpos.'</td>';
		echo "</tr>";
		    				$con++;
		    			}
	}



?>

</table>
<table border=2>
<tr>
<td align="center" bgcolor="#c7f7bf" width="3%" >No</td>
<td align="center" bgcolor="#c7f7bf" width="70%" >Detail Radius Biaya</td>
<td align="center" bgcolor="#c7f7bf" width="20%" >Jumlah</td>

</tr>

<?php

$warna ="#fcfdfd";
$warnabukanmaterai ="#f9f8f8";
if (empty($databiaya)) {
		echo "<tr><td colspan='3' align='center' bgcolor='#f58484'>Data Tidak diTemukan</td></tr>";
	}else{
	$con = 1;
	foreach ($databiaya as $row) {
		//$mahasiswa = $row->mahasiswa_id;
		$sebutan_pihak = $row->pemohon_termohon;
		$jumlah_radius = $row->jumlah_panggilan;
		$biaya_radius = number_format($row->biaya, 0, ',', '.');
		$nama = $row->nama_pihak;
		$jumlah = number_format($row->jumlah_panggilan_x_biaya, 0, ',', '.');
		
	echo "<tr>";
			echo '<td  bgcolor='.$warna.'>'.$con.'</td>';
			echo '<td  bgcolor='.$warna.'> Radius '.$sebutan_pihak.' [ <b>'.$nama.'</b> ] '.$jumlah_radius.' x '.$biaya_radius.'</td>';
			echo '<td  bgcolor='.$warna.'> Rp. '.$jumlah.'</td>';
		echo "</tr>";
		    				$con++;
		    			}
	}
foreach ($countdatabiayapos as $rowbayarpos) {
	$totalkomponenpos = $rowbayarpos->totalradius;
}
foreach ($countkomponen as $rowbayar) {
	$totalkomponen = $rowbayar->total;
}
foreach ($countdatabiaya as $rowradius) {
	$totalradius = $rowradius->totalradius;
}
$jumlah_all = $totalkomponen + $totalradius + $totalkomponenpos;
$total = number_format($jumlah_all, 0, ',', '.');
$terbilang = terbilang($jumlah_all);
foreach ($dataidentitas as $rowda) {
	$namapimpinan = $rowda->nama_pimpinan;
	$pemilik_rekening = $rowda->pemilik_rekening;
	$nomor_rekening = $rowda->nomor_rekening;
	$nama_bank = $rowda->nama_bank;
	$nama_kasir = $rowda->nama_kasir;
	$nip_kasir = $rowda->nip_kasir;
	$kota = $rowda->nama_kota;
}

?>

</table>
<br><?php echo "<i class='icon icon-arrow-left pull-right'> Total pembayaran panjar perkara sejumlah Rp.<b> ".$total."</b> <br>Terbilang : <b>".$terbilang." rupiah </b> </i>";?><br>
<table border=0>
<tr>

<td width="60%">
</td>
<td width="40%"><?php 
$nipkasir = '1235457679';

echo $kota.' , '.tgl_indo(date('Y-m-d')); ?>  
<br>Petugas Meja I<br><br><br><br>
<?php echo $nama_kasir."<br>";?>
<?php echo $nip_kasir;?>
</td>
</tr>
<tr border=0>
<td >Perhatian : <br>
Silahkan Bayar  <?php echo  "Ke Bank ".$nama_bank. ", Nomor Rekening : ".$nomor_rekening." An.".$pemilik_rekening;?> <br> Bukti Bayar dari Bank,mohon disetor ke Kasir Penerimaan Perkara pada hari saat membayar Panjar Perkara di Bank.
</td>
</tr>
</table>
</body>
</html>