<hr class="thick-line" style="clear:both;">
<div id="left">
	<?php
	echo form_open(base_url().'list_arsip/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_arsip/<?php #echo $enc; ?>');" value="Search Detil" id="search-btn1"></input>
</div> -->
<div id="left" style="margin-left:50px;">
	<input id="tambah_arsip"type="submit" value="Tambah Arsip" class="btn"></input>
	<script type="text/javascript">
		$('#tambah_arsip').click(function(event){
			popup_form('<?php echo base_url("new_arsip"); ?>','_self')
		});
	</script>
</div>
<div id="pages">
    <div id="selector"></div>
</div>
<div class="cssTable">
	<table id="tableArsipAll">
		<col  width="3%" />
        <col  width="17%" />
        <col  width="10%" />
        <col  width="10%" />
        <col  width="10%" />
        <col  width="5%" />
        <col  width="20%" />
        <col  width="10%" />
        <col  width="10%" />
        <col  width="5%" />
		<tbody>
			<tr>
				<td>No</td>
				<td onclick="sorting(1)">Nomor Arsip</td>
				<td onclick="sorting(2)">Nomor Ruang</td>
				<td onclick="sorting(3)">Nomor Rak/Lemari</td>
				<td onclick="sorting(4)">Nomor Tingkat/Laci</td>
				<td onclick="sorting(5)">Nomor Boks</td>
				<td onclick="sorting(6)">Nomor Perkara</td>
				<td onclick="sorting(7)">Tanggal Masuk</td>
				<td onclick="sorting(8)">Status</td>
				<td>Link</td>
			</tr>
			<?php
				if($list_arsip!=''){
					if($list_arsip->num_rows>0){
						if($page_active<1){
							$con = 1;
						}else{
							$con = $page_active+1;
						}
		    			foreach ($list_arsip->result() as $row) {
		    				//$date = new DateTime(str_replace("-","",$row->tanggal_pendaftaran));
		    				echo "<tr>";
			    				echo '<td>'.$con.'</td>';
			    				echo '<td>'.$row->nomor_arsip.'</td>';
			    				echo '<td>'.$row->no_ruang.'</td>';
			    				echo '<td>'.$row->no_lemari.'</td>';
			    				echo '<td>'.$row->no_rak.'</td>';
			    				echo '<td>'.$row->no_berkas.'</td>';
			    				echo '<td>'.$row->nomor_perkara.'</td>';
			    				echo '<td align="center">'.$this->tanggalhelper->convertDate($row->tanggal_masuk_arsip).'</td>';
			    				echo '<td>'.$row->status.'</td>';
			    				//echo '<td>'.($row->status_id==1?"Ada":($row->status==2?"Dipinjam":"Pemusnahan")).'</td>';
			    				echo '<td align="center">[<a href="'.base_url('arsip_detail/'.base64_encode($this->encrypt->encode($row->arsip_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";
}
?>
<input type="hidden" id="refresh" name="refresh" value="0">
<div id="pages_bottom" style="width:100%;padding-left:5px;padding-top:5px;">
    <div id="selector_bottom"></div>
</div>
<script type="text/javascript">
	function sorting(col){
		window.open('<?php echo base_url();?>list_arsip/sort/'+col+'/<?php echo $enc; ?>/<?php echo $keyword; ?>','_self')
	}
	<?php $enc = (!empty($enc)) ? "/".$enc : $enc;?>
	function searchDetilShow(){
		popup_form('<?php echo base_url();?>search_arsip')
	}

	function refreshPage(){
		window.open('<?php echo base_url("list_arsip");?>','_self');
	};
</script>
