<style type="text/css">
	ol{
		margin-left: -20px;
	}
	.rata-kiri {
		margin-left: -5px;
	}
</style>
<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);
	echo "<span>  </span>";
	$attributes = array('value' => 'Search', 'id' => 'search-btn1','class' => 'btn', 'type' => 'submit');
	echo form_submit($attributes);
	echo form_close('');
	?>
</div>
<?php
$page_name = "register_anak_korban_saksi";
$action = base64_encode($this->encrypt->encode("add"));
?>
&nbsp;<input type="submit" onClick="popup_form('<?php echo base_url();?>register_anak_saksi/118');" value="Cetak Register" id="cetak_reg" class="btn btn-warning"></input>

<div id="pages">
    <div id="selector"></div>
</div>
<div class="cssTable">
	<table id="tablePerkaraAll">
		<col  width="3%" />
        <col  width="17%" />
        <col  width="16%" />
        <col  width="16%" />
        <col  width="15%" />
        <col  width="14%" />
        <col  width="8%" />
        <col  width="5%" />
		<tbody>
			<tr>
				<td style="align:left;">No Urut</td>
				<td style="cursor:pointer;padding-left:50px;text-align:left !important" onclick="sorting(2)">a. Nomor Perkara<br>b. Jenis Perkara</td>
				<td align="center" onclick="sorting(2)">Pihak Anak Korban</td>
				<td align="center" onclick="sorting(2)">Pihak Anak Saksi</td>
				<td style="cursor:pointer;text-align:center !important" onclick="sorting(3)">Pihak Terdakwa</td>				
				<td style="text-align:left !important" onclick="sorting(5)"><ol type="a">
			    				            <li>Tanggal Penerimaan Berkas Dari PU</li><li>Pasal yang didakwakan</li></ol>
				<td onclick="sorting(8)">Tanggal Putusan</td>				
				<td>Link</td>
			</tr>
			<?php
				if($register_list!=''){
					if($register_list->num_rows()>0){
						if($page_active<1){
							$con = 1;
						}else{
							$con = $page_active+1;
						}
							
						$this->nativesession->set_flash_session('history', current_url());
		    			foreach ($register_list->result() as $row) {
		    				echo "<tr>";
			    				echo '<td>'.$con.'</td>';
			    				echo '<td>a. '.$row->nomor_perkara.'<br>b. '.$row->jenis_perkara_nama.'</td>';
			    				echo '<td><ol type="a">';
			    						if(!empty($row->nama_korban)){
			    				          echo '<li>Nama Anak Korban :</li>
			    				                '.$row->nama_korban;
			    				        }
			    				        if(!empty($row->nama_ortu_korban)){
			    				          echo '<li>Nama Orang Tua/Wali :</li>
			    				                '.$row->nama_ortu_korban;
			    				        }
			    				          echo '</ol></td>';
								echo '<td><ol type="a">';
										if(!empty($row->nama_saksi)){
			    				          echo '<li>Nama Anak Saksi :</li>
			    				                '.$row->nama_saksi;
			    				        }
			    				        if(!empty($row->nama_orang_tua_saksi)){
			    				          echo '<li>Nama Orang Tua/Wali :</li>
			    				                '.$row->nama_orang_tua_saksi;
			    				        }
			    				          echo '</ol></td>';			    				
			    				echo '<td>'.$row->terdakwa.'</td>';
			    				echo '<td><ol type="a"> 
			    							<li>'.$this->tanggalhelper->convertDate($row->tanggal_surat).'</li>
			    							<li>'.$row->pasal_dakwaan.'</li>
			    						  </ol></td>';
			    				echo '<td>'.$this->tanggalhelper->convertDate($row->tanggal_putusan).'</td>';			    				
			    				echo '<td align="center">[<a href="'.base_url('perkara_detil/'.base64_encode($this->encrypt->encode($row->perkara_id))).'">detil</a>]</td>';
		    				echo "</tr>";
		    				$con++;
		    			}
			    	}else{
		    			echo "<tr><td colspan='8' align='center'>Data Tidak diTemukan</td></tr>";
		    		}
				}else{
		    		echo "<tr><td colspan='8' 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/';
$keyword = (!empty($keyword))?'/'.$keyword : '';
?>
<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(){
		window.open('<?php echo base_url();?>search','_self')
	}

	$('#tambah_diversi').click(function(event){
		window.open('<?php echo base_url();echo "new_diversi"; ?>/','_self')
	});
</script>
