
	<hr class="thick-line" style="clear:both;">
<div id="left">
	<?php
	echo form_open(base_url().$page_url.'/search');
	$attributes = array('name' => 'search', 'id' => 'search-box', 'type' => 'text','size' => '50','placeholder'=>"  Ketik kata kunci  ");
	echo form_input($attributes);
	$data = array(
		'enc' => $enc
	);
	echo form_hidden($data);
	echo "<span>  </span>";
	$attributes = array('value' => 'Search', 'id' => 'search-btn1', 'type' => 'submit');
	echo form_submit($attributes);
	echo form_close('');
	?>
</div>
<div id="left">
<input type="submit" onClick="popup_form('<?php echo base_url();?>search_banding/<?php echo $enc; ?>');" value="Search Detil" id="search-btn1"></input>
<?php if($idalurperkara=='118'){ ?>
<input type="submit" onClick="popup_form('<?php echo base_url();?>register_banding/<?php echo $idalurperkara; ?>');" value="Cetak Register" id="cetak_reg" class="btn btn-warning"></input>
<?php } ?>
</div>
<div id="left" style="margin-left:50px;">
	<input type="submit" id="cetak_perkara_list" value="Excel" class="btn"></input>
</div>
<?php
if($this->session->userdata('is_logged_in')){
	if($this->authorization->HasRuleAddPendaftaranBanding($idalurperkara) && $idalurperkara>100){
?>
		<div id="left" style="margin-left:50px;">
			<input type="submit" id="tambah_pekara" value="Tambah Perkara" class="btn"></input>
			<script type="text/javascript">
				$('#tambah_pekara').click(function(event){
					window.open('<?php echo base_url();echo "new_perdata/".$enc; ?>/','_self')
				});
			</script>
		</div>
<?php
	}
}
?>
<div id="pages">
    <div id="selector"></div>
</div>
<div class="cssTable">
	<table id="tablePerkaraAll">
		<col  width="3%" />
        <col  width="14%" />
        <col  width="15%" />
        <col  width="9%" />
        <col  width="9%" />
        <col  width="14%" />
        <col  width="10%" />
        <col  width="10%" />
        <col  width="10%" />
        <col  width="6%" />
		<tbody>
			<tr>
				<td>No</td>
				<td onclick="sorting(1)"><?php echo $lang_nomor_perkara;?></td>
				<td onclick="sorting(2)">Pemohon Banding</td>
				<td onclick="sorting(3)">Tanggal Pengiriman Berkas</td>
				<td onclick="sorting(4)">Tanggal Putusan Banding</td>
				<td onclick="sorting(5)">Nomor Perkara Banding</td>
				<td onclick="sorting(6)">Tanggal Penerimaan Kembali Berkas</td>
				<td onclick="sorting(7)">Tanggal Pemberitahuan Putusan</td>
				<td onclick="sorting(8)">Status Banding</td>
				<td>Link</td>
			</tr>
			<?php
				function parse_date($date){
					if(!empty($date)){
						$date_fmt = new DateTime(str_replace("-","",$date));
						return $date_fmt->format('d M Y');
					}else{
						return '';
					}
				}

				if($list_perkara!=''){
					if($list_perkara->num_rows>0){
						if($page_active<1){
							$con = 1;
						}else{
							$con = $page_active+1;
						}
		    			foreach ($list_perkara->result() as $row) {
		    				echo "<tr>";
			    				echo '<td>'.$con.'</td>';
			    				echo '<td>'.$row->nomor_perkara_pn.'</td>';
			    				echo '<td>'.parse_date($row->permohonan_banding);
			    				echo "<br>".$row->pemohon_banding.'</td>';
			    				echo '<td align="center">'.parse_date($row->pengiriman_berkas_banding).'</td>';
			    				echo '<td align="center">'.parse_date($row->putusan_banding).'</td>';
			    				echo '<td>'.$row->nomor_perkara_banding.'</td>';
			    				echo '<td align="center">'.parse_date($row->penerimaan_kembali_berkas_banding).'</td>';
			    				echo '<td align="center">'.parse_date($row->pemberitahuan_putusan_banding).'</td>';
			    				echo '<td>'.$row->status_banding_text.'</td>';
			    				echo '<td align="center">[<a href="'.base_url('perkara_banding_detil/'.base64_encode($this->encrypt->encode($row->perkara_id))).'">detil</a>]</td>';
		    				echo "</tr>";
		    				$con++;
		    			}
			    	}else{
		    			echo "<tr><td colspan='10' align='center'>Data Tidak diTemukan</td></tr>";
		    		}
				}else{
		    		echo "<tr><td colspan='10' align='center'>Data Tidak diTemukan</td></tr>";
		    	}
		    
			?>
		</tbody>
	</table>
</div>
<?php
if($keyword!==''){
	$keyword=$keyword;
} else {
	$keyword="0";
}
?>
<div id="pages_bottom" style="width:100%;padding-left:5px;padding-top:5px;">
    <div id="selector_bottom"></div>
</div>
<?php
$url = base_url().$page_url.'/sort/';
?>
<script type="text/javascript">
	function sorting(col){
		window.open('<?php echo $url;?>'+col+'/<?php echo $enc; ?>/<?php echo $keyword; ?>','_self')
	}
	<?php $enc = (!empty($enc)) ? "/".$enc : $enc;?>
	function searchDetilBandingShow(){
		window.open('<?php echo base_url();?>search_banding<?php echo $enc; ?>','_self')
	}
	$('#cetak_perkara_list').click(function(){
		window.open('<?php echo base_url(); echo "perkara_list_cetak/cetak/2".$enc."/".$keyword; ?>','_self')
	});
</script>
