<div style="padding:5px;min-width:1550px;">
<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:1500px;">
	<tbody>
	<?php
	$maxcol = ($idalurperkara<111)? 93:54;
	$colspan = ($idalurperkara<111)? 7:4;
	?>
		<tr>
			<td align="center" colspan="<?php echo $maxcol;?>" style="text-align: center;border:0px;border-top:0;font-size:14px;border-right:0px;">REKAPITULASI HAKIM PERKARA <?php echo $perkara_nama;?></td>
		</tr>
		<tr>
			<td align="center" colspan="<?php echo $maxcol;?>" style="text-align: center;border:0px;font-size:14px;border-right:0px;"><?php echo $nama_pn;?></td>
		</tr>
		<tr>
			<td align="center" colspan="<?php echo $maxcol;?>" style="text-align: center;border:0px;font-size:14px;border-bottom:1px solid #000000;border-right:0px;">Januari Desember <?php echo $tahun;?></td>
		</tr>
	</tbody>
	<tr>
		<th rowspan="2" style='width:50px;border-style: solid;border-width:0.1em;'>NO</th>
		<th rowspan="2" style='width:150px;border-style: solid;border-width:0.1em;'>NAMA HAKIM</th>
		<th colspan="<?php echo $colspan;?>" style="border-left:1px solid #000000;">Januari</th>
		<th colspan="<?php echo $colspan;?>">Februari</th>
		<th colspan="<?php echo $colspan;?>">Maret</th>
		<th colspan="<?php echo $colspan;?>">April</th>
		<th colspan="<?php echo $colspan;?>">Mei</th>
		<th colspan="<?php echo $colspan;?>">Juni</th>
		<th colspan="<?php echo $colspan;?>">Juli</th>
		<th colspan="<?php echo $colspan;?>">Agustus</th>
		<th colspan="<?php echo $colspan;?>">September</th>
		<th colspan="<?php echo $colspan;?>">Oktober</th>
		<th colspan="<?php echo $colspan;?>">November</th>
		<th colspan="<?php echo $colspan;?>">Desember</th>
		<th colspan="<?php echo $colspan;?>">Total</th>
	</tr>
	<tr>
		<?php
		for ($i=1; $i <=12 ; $i++) { 
			echo "<th style='width:100px;border-style: solid;border-width:0.1em;'>Sisa Perkara Belum Putus</th>";
			echo "<th style='width:100px;border-style: solid;border-width:0.1em;'>Terima</th>";
			echo "<th style='width:100px;border-style: solid;border-width:0.1em;'>Jumlah</th>";
			echo "<th style='width:100px;border-style: solid;border-width:0.1em;'>Putus</th>";
			if($idalurperkara<111){
				echo "<th style='width:100px;border-style: solid;border-width:0.1em;'>Cabut</th>";
				echo "<th style='width:100px;border-style: solid;border-width:0.1em;'>Gugur</th>";
				echo "<th style='width:100px;border-style: solid;border-width:0.1em;'>Mediasi</th>";
			}
		}
		?>
		<th style='width:100px;border-style: solid;border-width:0.1em;'>Sisa Awal</th>
		<th style='width:100px;border-style: solid;border-width:0.1em;'>Terima</th>
		<th style='width:100px;border-style: solid;border-width:0.1em;'>Putus</th>
		<?php
		if($idalurperkara<111){
			echo "<th style='width:100px;border-style: solid;border-width:0.1em;'>Cabut</th>";
			echo "<th style='width:100px;border-style: solid;border-width:0.1em;'>Gugur</th>";
			echo "<th style='width:100px;border-style: solid;border-width:0.1em;'>Mediasi</th>";
		}
		?>
		<th>Sisa Akhir</th>
	</tr>
	<tr>
	<?php

		for ($i=1; $i<=$maxcol ; $i++) { 
			echo "<th  style='width:100px;border-style: solid;border-width:0.1em;'>".$i."</th>";
		}
		?>
	</tr>
	<tr>
		<?php
		for ($i=1; $i<=$maxcol ; $i++) { 
			echo "<td  style='width:100px;border-style: solid;border-width:0.1em;'></td>";
		}
		?>
	</tr>
	<?php 
	if($rekap!=''){
		if($rekap->num_rows>0){
			$i = 1;
			foreach ($rekap->result() as $row) {
				echo "<tr>";
					echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$i."</td>";
					echo "<td>".$row->hakim_nama."</td>";
					echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->BelumPutus01."</td>";
					echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Masuk01."</td>";
					echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Beban01."</td>";
					echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Putus01."</td>";
					if($idalurperkara<111){
						echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Cabut01."</td>";
						echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Gugur01."</td>";
						echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Mediasi01."</td>";
					}
					
					
					echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->BelumPutus02."</td>";
					echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Masuk02."</td>";
					echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Beban02."</td>";
					echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Putus02."</td>";
					if($idalurperkara<111){
						echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Cabut02."</td>";
						echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Gugur02."</td>";
						echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Mediasi02."</td>";
					}

					echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->BelumPutus03."</td>";
					echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Masuk03."</td>";
					echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Beban03."</td>";
					echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Putus03."</td>";
					if($idalurperkara<111){
						echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Cabut03."</td>";
						echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Gugur03."</td>";
						echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Mediasi03."</td>";
					}

					echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->BelumPutus04."</td>";
					echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Masuk04."</td>";
					echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Beban04."</td>";
					echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Putus04."</td>";
					if($idalurperkara<111){
						echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Cabut04."</td>";
						echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Gugur04."</td>";
						echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Mediasi04."</td>";
					}

					echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->BelumPutus05."</td>";
					echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Masuk05."</td>";
					echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Beban05."</td>";
					echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Putus05."</td>";
					if($idalurperkara<111){
						echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Cabut05."</td>";
						echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Gugur05."</td>";
						echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Mediasi05."</td>";
					}

					echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->BelumPutus06."</td>";
					echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Masuk06."</td>";
					echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Beban06."</td>";
					echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Putus06."</td>";
					if($idalurperkara<111){
						echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Cabut06."</td>";
						echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Gugur06."</td>";
						echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Mediasi06."</td>";
					}

					echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->BelumPutus07."</td>";
					echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Masuk07."</td>";
					echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Beban07."</td>";
					echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Putus07."</td>";
					if($idalurperkara<111){
						echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Cabut07."</td>";
						echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Gugur07."</td>";
						echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Mediasi07."</td>";
					}

					echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->BelumPutus08."</td>";
					echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Masuk08."</td>";
					echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Beban08."</td>";
					echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Putus08."</td>";
					if($idalurperkara<111){
						echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Cabut08."</td>";
						echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Gugur08."</td>";
						echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Mediasi08."</td>";
					}

					echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->BelumPutus09."</td>";
					echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Masuk09."</td>";
					echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Beban09."</td>";
					echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Putus09."</td>";
					if($idalurperkara<111){
						echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Cabut09."</td>";
						echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Gugur09."</td>";
						echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Mediasi09."</td>";
					}

					echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->BelumPutus10."</td>";
					echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Masuk10."</td>";
					echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Beban10."</td>";
					echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Putus10."</td>";
					if($idalurperkara<111){
						echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Cabut10."</td>";
						echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Gugur10."</td>";
						echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Mediasi10."</td>";
					}

					echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->BelumPutus11."</td>";
					echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Masuk11."</td>";
					echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Beban11."</td>";
					echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Putus11."</td>";
					if($idalurperkara<111){
						echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Cabut11."</td>";
						echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Gugur11."</td>";
						echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Mediasi11."</td>";
					}

					echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->BelumPutus12."</td>";
					echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Masuk12."</td>";
					echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Beban12."</td>";
					echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Putus12."</td>";
					if($idalurperkara<111){
						echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Cabut12."</td>";
						echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Gugur12."</td>";
						echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->Mediasi12."</td>";
					}

					echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->BelumPutusTahunLalu."</td>";
					echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->MasukTahunIni."</td>";
					echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->BebanTahunIni."</td>";
					echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->PutusTahunIni."</td>";
					if($idalurperkara<111){
						echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->CabutTahunIni."</td>";
						echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->GugurTahunIni."</td>";
						echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$row->MediasiBerhasilTahunIni."</td>";
					}
					echo "<td style='text-align:center;border-style: solid;border-width:0.1em;'>".$SisaAkhir."</td>";
				echo "</tr>";
				$i++;
			}
		}
	}
	?>
</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>