<style type="text/css">
#view_laporan .dodon tr td,  tr th {
	border: none;
}
</style>
<div style="padding:5px;min-width:1200px;">
<div style="padding:20px;">
</div>
<button class="btn btnExcel" style="width:150px;text-align:center;">Export Excel</button></div>
<table id="view_laporan" class="cetakExcel" border="0" cellpadding="2" cellspacing="0" style="margin:10px;min-width:1200px;">
	<tbody>
		<tr>
			<td align="center" colspan="17" style="text-align: center;border:0px;border-top:0;font-size:14px;border-right:0px;">LAPORAN PERKARA TAHUN  <?php echo $tahun;?></td>
		</tr>
		<tr><td align="center" colspan="17" style="text-align: center;border:0px;font-size:14px;border-right:0px;"><?php echo $nama_pn;?></td></tr>
	</tbody>
	<tr>
		<th rowspan="2">NO</th>
		<th rowspan="2">JENIS PERKARA</th>
		<th rowspan="2">SISA TAHUN LALU</th>
		<th rowspan="2">MASUK</th>
		<th rowspan="2">DISMISSAL</th>
		<th rowspan="2">PERLAWANAN</th>
		<th rowspan="2">CABUT</th>
		<th rowspan="2">PUTUS</th>
		<th rowspan="2">SISA YANG BELUM DIMINUTASI</th>
		<th colspan="4">PERMOHONAN</th>
		<th rowspan="2">KETERANGAN</th>
	</tr>
	<tr>
		<th>BANDING</th>
		<th>KASASI</th>
		<th>PENINJAUAN KEMBALI</th>
		<th>EKSEKUSI</th>
	</tr>
	<tr>
		<?php
		for ($i=1; $i<=14 ; $i++) { 
			echo "<td><div align='center'>".$i."</div></td>";
		}
		?>
	</tr>
	<?php
	function cekHasil($nilai){
		if(empty($nilai)||$nilai==''){
			return 0;
		} else {
			return $nilai;
		}
	}


	if($rekapPerkaraTUN!=''){
		if($rekapPerkaraTUN->num_rows>0){
			$i=0;
			foreach ($rekapPerkaraTUN->result() as $row) { $i++;
				if(!empty($row->sisa)){

				}
			?>
				<tr>
					<td style="width:40px;"><?php echo $i; ?></td>
					<td style="width:250px;"><?php echo $row->nama; ?></td>
					<td style="width:80px;"><?php echo cekHasil($row->sisa); ?></td>
					<td style="width:80px;"><?php echo cekHasil($row->masuk); ?></td>
					<td style="width:80px;"><?php echo cekHasil($row->dismissal); ?></td>
					<td style="width:80px;"><?php echo cekHasil($row->perlawanan); ?></td>
					<td style="width:80px;"><?php echo cekHasil($row->cabut); ?></td>
					<td style="width:80px;"><?php echo cekHasil($row->putusan); ?></td>
					<td style="width:80px;"><?php echo cekHasil($row->belumminutasi); ?></td>
					<td style="width:80px;"><?php echo cekHasil($row->banding); ?></td>
					<td style="width:80px;"><?php echo cekHasil($row->kasasi); ?></td>
					<td style="width:80px;"><?php echo cekHasil($row->pk); ?></td>
					<td style="width:80px;"><?php echo cekHasil($row->eksekusi); ?></td>
					<td></td>
				</tr>
			<?php
			}
		}
	}
	?>
	</tr>
	</tbody>
</table>
</div>
<div style="padding:15px;"></div>
<script src="resources/js/jquery.table2excel.js"></script>
<script>
$(function() {
	$(".btnExcel").click(function(){
		$(".cetakExcel").table2excel({
			exclude: ".noExl",
			name: "Excel Document Name",
			filename: "Cetak Excel"
		});
	});
});
</script>