
	<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', 'onClick' => 'load()');
	echo form_submit($attributes);
	echo form_close('');
	?>
</div>
<div id="left">
<input type="submit" onClick='searchDetilShow_eksekusi()' value="Search Detil" id="search-btn1"></input>
</div>
<div id="left" style="margin-left:50px;">
	<input 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">
		<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%" />
		<tbody>
			<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
				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 onClick='show_detail(".$row->perkara_id.")'>";
			    				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">'.parse_date($row->penetapan_teguran_eksekusi).'</td>';
			    				echo '<td>'.$row->nomor_penetapan_teguran_eksekusi.'</td>';
			    				echo '<td align="center">'.parse_date($row->pelaksanaan_teguran_eksekusi).'</td>';
			    				echo '<td align="center">'.parse_date($row->penetapan_sita_eksekusi).'</td>';
			    				echo '<td>'.$row->nomor_penetapan_sita_eksekusi.'</td>';
			    				echo '<td align="center">'.parse_date($row->pelaksanaan_sita_eksekusi).'</td>';
			    				echo '<td align="center">[detil]</td>';
		    				echo "</tr>";
		    				$con++;
		    			}
			    	}else{
		    			echo "<tr><td colspan='9' align='center'>Data Tidak diTemukan</td></tr>";
		    		}
				}else{
		    		echo "<tr><td colspan='9' align='center'>Data Tidak diTemukan</td></tr>";
		    	}
		    
			?>
		</tbody>
	</table>
</div>
<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_eksekusi(){
		popup_form('<?php echo base_url();?>search_eksekusi<?php echo $enc; ?>')
	}
</script>
