<div id='status_penahanan' style="background:white;padding:5px;">
<?php
	$idpanitera = $this->session->userdata('panitera_id');
	$idhakim = $this->session->userdata('hakim_id');
	$all=$this->input->post('all');
	if((!empty($idpanitera) OR !empty($idhakim) OR !empty($idjurusita))){
	?>
	<table width="100%">
		<tr>
			<td width="100%" align="center"><input id="prkAll" class="btn" type="button" value="Semua Perkara" onclick="showAllPrk();" style="height: 28px;padding-top:5px;vertical-align: text-top">&nbsp;
			<input id="prkDitangani" class="btn" type="button" value="Perkara Yang Ditangani" onclick="showDitangani();" style="height: 28px;padding-top:5px;vertical-align: text-top"></td></tr>
	</table>
	<?php
	}
?>
	<div><font color="#5FB85C"><strong>Jumlah Terdakwa Yang Masa Penahanannya Akan Habis Dalam Waktu Kurang Dari 7 Hari</strong></font></div>
		<div class="cssTable">
			<table id="tablePerkaraAll">
				<col  width="5%" />
		        <col  width="70%" />
		        <col  width="25%" />
				<tbody>
					<tr>
						<td>No</td>
						<td>Jenis Perkara</td>
						<td>Jumlah</td>
					</tr>
					<?php
						$con=1;

							if($data_penahanan_min7->num_rows>0){
				    			foreach ($data_penahanan_min7->result() as $row) {
				    				//print_r($data_penahanan_min7->result());
				    				echo "<tr>";
					    				echo '<td align="center">'.$con.'</td>';
					    				echo '<td>'.$row->nama.'</td>';
					    				if($row->jumlah != 0){
					    					$mainurl = '1/'.$row->alur_perkara_id."/".$all;
											$enc = base64_encode($this->encrypt->encode($mainurl));
					    					echo "<td align='center'><a style='color:red' href='".base_url()."perkara_tab_penahanan/type/".$enc."'>".$row->jumlah."</a></td>";
					    				}else{
					    					echo '<td align="center">'.'-'.'</td>';
					    				}
				    				echo "</tr>";
				    				$con++;
				    			}
					    	}else{
				    			echo "<tr><td colspan='3' align='center'>Tidak Ada Data</td></tr>";
				    		}
									
					?>
				</tbody>
			</table>
	</div>
	<div><font color="#5FB85C"><strong>Jumlah Terdakwa Yang Masa Penahanannya Telah Habis</strong></font></div>
		<div class="cssTable">
			<table id="tablePerkaraAll">
				<col  width="5%" />
		        <col  width="70%" />
		        <col  width="25%" />
		        
				<tbody>
					<tr>
						<td>No</td>
						<td>Jenis Perkara</td>
						<td>Jumlah</td>
					</tr>
					<?php
						$con=1;

							if($data_penahanan_habis->num_rows>0){
				    			foreach ($data_penahanan_habis->result() as $row) {
				    				echo "<tr>";
					    				echo '<td align="center">'.$con.'</td>';
					    				echo '<td>'.$row->nama.'</td>';
					    				if($row->jumlah != 0){
					    					$mainurl = '2/'.$row->alur_perkara_id."/".$all;
											$enc = base64_encode($this->encrypt->encode($mainurl));
					    					echo "<td align='center'><a style='color:red' href='".base_url()."perkara_tab_penahanan/type/".$enc."'>".$row->jumlah."</a></td>";		
					    				}else{
					    					echo '<td align="center">'.'-'.'</td>';
					    				}
				    				echo "</tr>";
				    				$con++;
				    			}
					    	}else{
				    			echo "<tr><td colspan='3' align='center'>Tidak Ada Data</td></tr>";
				    		}
					?>
				</tbody>
			</table>
	</div>
</div>
<script type="text/javascript">
function showAllPrk(){
	openLoadingDialog();
	$('#tabs4').load('<?php base_url()?>tab_status_penahanan/',{all:'Y'});
}

function showDitangani(){
	openLoadingDialog();
	$('#tabs4').load('<?php base_url()?>tab_status_penahanan/',{all:'N'});
}


closeLoading()
</script>