
	<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='searchDetilShow()' value="Search Detil" id="search-btn1"></input>
</div>
<div id="left" style="margin-left:50px;">
	<input id="cetak_perkara_list" type="submit" value="Excel" class="btn"></input>
</div>
<?php
if($this->session->userdata('is_logged_in')){
	$AuthorizationAction = $this->nativesession->get('getAuthorizationAction');
	if($this->authorization->hasAuthorizationAddPerkara($idalurperkara,$AuthorizationAction)){
?>
			<div id="left" style="margin-left:50px;">
				<input type="submit" value="Tambah Perkara" class="btn"></input>
			</div>
<?php
	}
}
?>
<div id="pages">
    <div id="selector"></div>
</div>
<div class="cssTable">
	<table id="tablePerkaraAll">
		<?php if($this->session->userdata('jenis_pengadilan')==3){ ?>
		<col  width="3%" />
        <col  width="15%" />
        <col  width="25%" />
        <col  width="15%" />
        <col  width="15%" />
        <?php }  else {  ?>
		<col  width="3%" />
        <col  width="14%" />
        <col  width="15%" />
        <col  width="9%" />
        <col  width="13%" />
        <col  width="9%" />
        <col  width="9%" />
        <col  width="13%" />
        <col  width="9%" />
        <col  width="6%" />
		<?php } ?>
		<tbody>
			<?php if($this->session->userdata('jenis_pengadilan')==3){ $colspan='6'; ?>
			<tr>
				<td>No</td>
				<td onclick="sorting(1)">Nomor Perkara</td>
				<td onclick="sorting(2)">Pemohon Eksekusi</td>
				<td onclick="sorting(3)">Tanggal Diterima Permohonan</td>
				<td onclick="sorting(4)">Tanggal Pangilan Pihak</td>
				<td onclick="sorting(4)">Tanggal Penetapan Ketua</td>
				<td>Link</td>
			</tr>
			<?php } else { $colspan='10'; ?> 
			<tr>
				<td>No</td>
				<td onclick="sorting(1)">Nomor Perkara PN</td>
				<td onclick="sorting(2)">Pemohon eksekusi</td>
				<td onclick="sorting(3)">Tanggal Penetapan Teguran</td>
				<td onclick="sorting(4)">Nomor Penetapan Teguran</td>
				<td onclick="sorting(4)">Tanggal Pelaksanaan Teguran</td>
				<td onclick="sorting(6)">Tanggal Penetapan Sita</td>
				<td onclick="sorting(5)">Nomor Penetapan Sita</td>
				<td onclick="sorting(7)">Tanggal Sita Eksekusi</td>
				<td>Link</td>
			</tr>
			<?php } ?>
			<?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) {
		    				if($this->session->userdata('jenis_pengadilan')==3){
		    					echo "<tr>";
				    				echo '<td>'.$con.'</td>';
				    				echo '<td>'.$row->nomor_perkara_pn.'</td>';
				    				echo '<td>'.parse_date($row->permohonan_eksekusi);
				    				echo "<br>".$row->pemohon_eksekusi.'</td>';
				    				echo '<td align="center">'.$this->tanggalhelper->convertDayDate($row->diterima_permohonan).'</td>';
				    				echo '<td>'.$this->tanggalhelper->convertDayDate($row->panggilan_parapihak).'</td>';
				    				echo '<td align="center">'.$this->tanggalhelper->convertDayDate($row->penetapan_ketua).'</td>';
				    				echo '<td align="center">[<a href="'.base_url('eksekusi_detil/'.base64_encode($this->encrypt->encode($row->perkara_id))).'">detil</a>]</td>';
				    			echo "</tr>";
		    				} else {
			    				echo "<tr>";
				    				echo '<td>'.$con.'</td>';
				    				//echo '<td>'.$row->nomor_urut_perkara_eksekusi.'</td>';
				    				echo '<td>'.$row->nomor_register_eksekusi.'<br> jo <br/>'.$row->nomor_perkara_pn.'</td>';
				    				echo '<td>'.parse_date($row->permohonan_eksekusi);
				    				echo "<br>".$row->pemohon_eksekusi.'</td>';
				    				echo '<td align="center">'.($row->penetapan_teguran_eksekusi!='0000-00-00' ? parse_date($row->penetapan_teguran_eksekusi) : '').'</td>';
				    				echo '<td>'.$row->nomor_penetapan_teguran_eksekusi.'</td>';
				    				echo '<td align="center">'.($row->pelaksanaan_teguran_eksekusi!='0000-00-00' ? parse_date($row->pelaksanaan_teguran_eksekusi) : '').'</td>';
				    				echo '<td align="center">'.($row->penetapan_sita_eksekusi!='0000-00-00' ? parse_date($row->penetapan_sita_eksekusi) : '').'</td>';
				    				echo '<td>'.$row->nomor_penetapan_sita_eksekusi.'</td>';
				    				echo '<td align="center">'.($row->pelaksanaan_sita_eksekusi!='0000-00-00' ? parse_date($row->pelaksanaan_sita_eksekusi) : '').'</td>';
				    				//puji
				    				echo '<td align="center">[<a href="'.base_url('eksekusi_detil/'.base64_encode($this->encrypt->encode($row->perkara_id))).'">detil</a>]</td>';
				    				//puji


			    				echo "</tr>";
			    			}
		    				$con++;
		    			}
			    	}else{

		    			echo "<tr><td colspan='".$colspan."' align='center'>Data Tidak diTemukan</td></tr>";
		    		}
				}else{
		    		echo "<tr><td colspan='".$colspan."' 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 searchDetilShow(){
		popup_form('<?php echo base_url();?>search_eksekusi<?php echo $enc; ?>')
	}
	$('#cetak_perkara_list').click(function(){
		window.open('<?php echo base_url(); echo "perkara_list_cetak/cetak/8".$enc."/".$keyword; ?>','_self')
	});
</script>
