<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"));
?>
<?php
echo '<div id="left" style="margin-left:30px;">';
echo '<input type="submit" id="tambah_register_blm_12tahun" value="Tambah Register" class="btn"></input>';
echo '</div>';
?>&nbsp;<input type="submit" onClick="popup_form('<?php echo base_url();?>register_12tahun/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="12%" />
        <col  width="25%" />
        <col  width="12%" />
        <col  width="12%" />
        <col  width="8%" />
        <col  width="5%" />
		<tbody>
			<tr>
				<td>No. Urut</td>
				<td style="cursor:pointer;padding-left:50px;text-align:left" onclick="sorting(1)">Penetapan<br>a. Nomor<br>b. Tanggal</td>
						
				<td align="center" onclick="sorting(2)">Anak</td>
				<td style="cursor:pointer;padding-left:50px;text-align:left" onclick="sorting(3)">Laporan Kemasyarakatan<br>a. Nomor<br>b. Tanggal</td>
				<td style="cursor:pointer;text-align:left !important" onclick="sorting(4)">Keputusan Penyidik, Pembimbing Kemasyarakatan dan Pekerja Sosial Profesional<br>a. Nomor<br>b. Tanggal</td>				
				<td>Template Penetapan KPN</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) {
		    				$enc_id = base64_encode($this->encrypt->encode($row->id));
		    				echo "<tr>";
			    				echo '<td style="text-align:right;">'.$con.'.</td>';
			    				echo '<td>a. '.$row->nomor_penetapan.'<br>b. '.$this->tanggalhelper->convertDate($row->tgl_penetapan).'</td>';
			    				echo '<td>'.($row->nama=="" ? "<a>Data anak belum diinput</a>" : $row->nama).'</td>';
			    				echo '<td><ol type="a">
			    				            <li class="rata-kiri">'.$row->nomor_lap_kemasyarakatan.'</li>
			    				            <li class="rata-kiri">'.$this->tanggalhelper->convertDate($row->tgl_lap_kemasyarakatan).'</li></ol>
			    				           </ol></td>';
			    			
			    				echo '<td><ol type="a">
			    				            <li class="rata-kiri">'.$row->nomor_kep_penyidik.'</li>
			    				            <li class="rata-kiri">'.$this->tanggalhelper->convertDate($row->tgl_kep_penyidik).'</li></ol>
			    				           </ol></td>';
			    				// echo '<td style="cursor:pointer;" align="center" onclick=""><a href="#">detil</a></td>';
			    				echo '<td align="center">';			    					
			    					echo '<a href="#" style="color:white;margin-bottom:15px" class="btn btn-warning btn-sm" onClick="popup_form(\''.base_url('c_template_diversi/popup_penetapan_kpn/'.$enc_id).'\')"><i class="fa fa-print" aria-hidden="true"></i> Cetak</a>';
			    				echo '</td>';
			    				echo '<td style="cursor:pointer;" align="center"><a href="detil_anak_blm_12tahun/'.base64_encode($this->encrypt->encode($row->id)).'">[ detil ]</a></td>';
		    				echo "</tr>";
		    				$con++;
		    			}
			    	}else{
		    			echo "<tr><td colspan='5' align='center'>Data Tidak diTemukan</td></tr>";
		    		}
				}else{
		    		echo "<tr><td colspan='5' 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_register_blm_12tahun').click(function(event){
		window.open('<?php echo base_url("add_register_blm_12tahun/add_register"); ?>','_self')
	});
</script>
