<style type="text/css">
#view_laporan .dodon tr td,  tr th {
	border: none;
}
</style>
<div style="padding:5px;min-width:2600px;">
<div style="padding:20px;">
<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:2600px;">
	<tbody>
		<tr>
			<td align="center" colspan="17" style="text-align: center;border:0px;border-top:0;font-size:14px;border-right:0px;">LAPORAN KEADAAN PERKARA <?php echo $perkara_nama;?></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>
		<tr>
			<td align="center" colspan="17" style="text-align: center;border:0px;font-size:14px;border-bottom:1px solid #000000;border-right:0px;">Bulan <?php echo fetch_montd($bulan);?> <?php echo $tahun;?></td>
		</tr>
	</tbody>
	<tr>
		<th rowspan="3">NO</th>
		<th rowspan="3">NOMOR PERKARA</th>
		<th rowspan="3">TANGGAL PENERIMAAN</th>
		<th colspan="3">DISMISSAL</th>
		<th colspan="5">ACARA SINGKAT</th>
		<th colspan="5">ACARA BIASA / ACARA CEPAT</th>
		<th rowspan="2" colspan="2">SISA AKHIR NOMOR PERKARA</th>
		<th rowspan="3">NOMOR PERKARA BELUM DIMINUTASI</th>
		<th rowspan="3">KETERANGAN</th>
	</tr>
	<tr>
		<th rowspan="2">NAMA KETUA/PANITERA</th>
		<th colspan="2">TANGGAL</th>
		<th colspan="2">TANGGAL</th>
		<th rowspan="2">MAJELIS HAKIM DAN PANITERA/PP</th>
		<th colspan="2">TANGGAL</th>
		<th rowspan="2">TANGGAL PENETAPAN MAJELIS HAKIM/ HAKIM TUNGGAL DAN PANITERA / PP</th>
		<th rowspan="2">SUSUNAN  MAJELIS HAKIM/ HAKIM TUNGGAL DAN PANITERA / PP7</th>
		<th colspan="3">TANGGAL</th>
	</tr>	
	<tr>
		<th>PANGGILAN</th>
		<th>PENETAPAN</th>
		<th>PENERIMAAN PERLAWANAN</th>
		<th>PENETAPAN MEJELIS HAKIM DAN PANITERA/PP</th>
		<th>DIMULAINYA SIDANG</th>
		<th>PUTUSAN PERLAWANAN</th>
		<th>PEMERIKSAAN PERSIAPAN</th>
		<th>DIMULAINYA SIDANG</th>
		<th>PUTUSAN</th>
		<th>BELUM DIBAGI</th>
		<th>BELUM DIPUTUS</th>
	</tr>
	<tr>
		<?php
		for ($i=1; $i<=19 ; $i++) { 
			echo "<td><div align='center'>".$i."</div></td>";
		}
		echo "<td><div align='center'>20</div></td>";
		?>
	</tr>
	<?php
	if($statBulan!=''){
		if($statBulan->num_rows>0){
			foreach ($statBulan->result() as $row) {
				$sisaLalu = $row->sisa;
				$masukBulanIni = $row->masuk;
				$putusBulanIni = $row->putus;
				$cabutBulanIni = $row->cabutPerkara;
				$belumDibagiBulanIni = $row->blm_majelis;
				$belumMinutasiBulanIni = $row->blm_minut;
				$belumPutusBulanIni = $row->blm_putus;
				$dismissal = $row->dismissal;
			}
		}
	}

	if($laporan!=''){
		if($laporan->num_rows>0){
			$jumlahbaris=$laporan->num_rows;
			$i=0;
			foreach ($laporan->result() as $row) { $i++;
				$namaKetua = $row->namaKetua;
				echo "<tr>";
					echo "<td style='width:40px'><div align='center'>".$i."</div></td>";
					echo "<td style='width:200px'>".$row->nomor_perkara."</td>";
					echo "<td style='width:90px'>".parse_date($row->tanggal_pendaftaran)."</td>";
					echo "<td style='width:200px'><b>K:</b><br/>".$row->namaKetua."<br/><b>P:</b><br/>".$row->namaPanses."</td>";
					echo "<td style='width:90px'>".parse_date($row->tanggalPanggilan)."</td>";
					echo "<td style='width:90px'>".parse_date($row->tanggalPenetapan)."</td>";
					echo "<td style='width:90px'>".parse_date($row->tanggalPenerimaanPerlawanan)."</td>";
					echo "<td style='width:90px'><b>H:</b><br/>".parse_date($row->tglPenetapanHakimPerlawanan)."<br/><b>P:</b><br/>".parse_date($row->tglPenetapanPPPerlawanan)."</td>";
					echo "<td style='width:200px'><b>H:</b><br/>".$row->hakimPerlawanan."<br/><b>P:</b><br/>".$row->paniteraPerlawanan."</td>";
					echo "<td style='width:90px'>".parse_date($row->tglSidangPertamaPerlawanan)."</td>";
					echo "<td style='width:90px'>".parse_date($row->tglPutusanPerlawanan)."</td>";
					echo "<td style='width:90px'><b>H:</b><br/>".parse_date($row->tglPenetapanHakimBiasa)."<br/><b>P:</b><br/>".parse_date($row->tglPenetapanPPBiasa)."</td>";
					echo "<td style='width:200px'><b>H:</b><br/>".$row->hakimBiasa."<br/> <b>P:</b><br/>".$row->paniteraBiasa."</td>";
					echo "<td style='width:90px'>".parse_date($row->tglPenetapanPersiapan)."</td>";
					echo "<td style='width:90px'>".parse_date($row->sidangPertama)."</td>";
					echo "<td style='width:90px'>".parse_date($row->tanggalPutusan)."</td>";
					echo "<td style='width:150px'>".$row->belumDibagi."</td>";
					echo "<td style='width:150px'>".$row->belumPutus."</td>";
					
					if($i==1){ ?>
						<td rowspan="<?php echo $jumlahbaris; ?>" style='width:150px; vertical-align:top;'>
						<?php	
						if($get_lap_perkara_belum_minut!=''){
							if($get_lap_perkara_belum_minut->num_rows>0){
								foreach ($get_lap_perkara_belum_minut->result() as $row3) {
									echo "".$row3->nomor_perkara."<br/>";
								}
							}
						}
						?>
						</td>
						<td rowspan="<?php echo $jumlahbaris; ?>" style='width:250px; vertical-align:top;'>
						<table class="dodon" width="100%">
						<tr>
							<td>A. Ketua:</td>
							<td><?php echo $row->namaKetua; ?></td>
						<tr>
						<tr>
							<td>B. Wakil Ketua:</td>
							<td><?php echo $row->namaWakilKetua; ?></td>
						<tr>
						<tr>
							<td style='vertical-align:top;'>C. Hakim:</td>
							<td>
								<?php
								$b=0;
								foreach ($listHakim->result() as $row){$b++;
									echo "".$b.". ".$row->nama_gelar."<br/>";
								}
								?>
							</td>
						<tr>
						<tr>
							<td style='vertical-align:top;'>D. Panitera Pengganti</td>
							<td>
								<?php
								$c=0;
								foreach ($listPP->result() as $row){$c++;
									echo "".$c.". ".$row->nama_gelar."<br/>";
								}
								?>
							</td>
						</tr>
						<tr><td colspan="2">&nbsp;</td></tr>
						<tr>
							<td>Sisa Bulan Lalu:</td>
							<td><?php echo $sisaLalu; ?> Perkara</td>
						</tr>
						<tr>
							<td>Masuk Bulan Ini:</td>
							<td><?php echo $masukBulanIni; ?> Perkara</td>
						</tr>
						<tr>
							<td>Putus:</td>
							<td><?php echo $putusBulanIni; ?> Perkara</td>
						</tr>
						<tr>
							<td>Dismissal</td>
							<td><?php echo $dismissal; ?> Perkara</td>
						</tr>
						<tr>
							<td>Cabut</td>
							<td><?php echo $cabutBulanIni; ?> Perkara</td>
						</tr>
						<tr>
							<td>Sisa Bulan Ini</td>
							<td></td>
						</tr>
						<tr>
							<td>Belum Dibagi</td>
							<td><?php echo $belumDibagiBulanIni; ?> Perkara</td>
						</tr>
						<tr>
							<td>Belum Putus</td>
							<td><?php echo $belumPutusBulanIni; ?> Perkara</td>
						</tr>
						<tr>
							<td>Dalam Minutasi</td>
							<td><?php echo $belumMinutasiBulanIni; ?> Perkara</td>
						</tr>
						</table>
						</td>
					<?php
					}
					echo "</tr>";
			}
		}

	}	
	?>
</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>