<div id='penambahan_perkara' style="background:white;padding:5px;">
		<?php
		$idpanitera = $this->session->userdata('panitera_id');
		$idhakim = $this->session->userdata('hakim_id');
		$idjurusita = $this->session->userdata('jurusita_id');
		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>
				<?php 
				?>				
			</tr>
		</table>
		<?php
		}
		?>
	<div class="cssTable" id="status_perkara_container" style="margin-bottom:35px; padding-bottom:20px">

	<?php
	$i=0;
	$reset = TRUE;
	$idalurperkara = 0;
	foreach ($result as $row) {
		if($row['asterlambat']!=0 OR $row['normal']!=0){
			if($idalurperkara!=$row['alur_perkara_id']){
				$reset = TRUE;
				$i = 1;
			}
			if($reset){
				echo '';
					echo '<table>';
						echo '<col  width="5%"/>';
				        echo '<col  width="60%" />';
				        echo '<col  width="15%" />';
				        echo '<col  width="15%" />';
				        echo '<col  width="15%" />';
    					echo '<tbody>';
							echo "<p align='center'><font color='#5FB85C'><strong>STATUS DARI PERKARA ".strtoupper($row['nama_alur_perkara'])."</strong></font>";
							echo '<tr height="30px">';
								echo '<td>No</td>';
								echo '<td>Status</td>';
								echo '<td>Terlambat</td>';
								echo '<td>Normal</td>';
								echo '<td>Total</td>';
							echo '</tr>';
							}
								$reset = FALSE;
								$idalurperkara = $row['alur_perkara_id'];
								$all = $_POST['all'];
								//$enc = base64_encode($this->encrypt->encode($row['id_proses_alur_perkara']));
								//$mainurl = $row['id_proses_alur_perkara'].'/'.$all;
								//$enc = base64_encode($this->encrypt->encode($mainurl));
								echo "<tr>";
									echo "<td>".$i."</td>";
									echo "<td>".$row['proses_judul']." ".$row['nama_alur_perkara']."</td>";
									if($row['asterlambat']!=0){
										$mainurl = $row['id_proses_alur_perkara'].'/'.$all.'/0';
										$enc = base64_encode($this->encrypt->encode($mainurl));
			    						echo "<td align='center'><a style='color:red' href='".base_url()."perkara_tab_status/type/".$enc."/'>".$row['asterlambat']."</a></td>";									
									}else{
										echo "<td align='center'>-</td>";
									}
									if($row['normal']!=0){
										//echo "<td align='center'>".$row['normal']."</td>";	
										$mainurl = $row['id_proses_alur_perkara'].'/'.$all.'/1';
										$enc = base64_encode($this->encrypt->encode($mainurl));
										echo "<td align='center'><a style='color:blue' href='".base_url()."perkara_tab_status/type/".$enc."/'>".$row['normal']."</a></td>";	
									}else{
										echo "<td align='center'>-</td>";	
									}
									
									echo "<td align='center'>".($row['asterlambat']+$row['normal'])."</td>";
								echo "</tr>";
								$i++;
						}
					}
						echo "</tbody>";
					echo "</table>";
				echo "";
				?>
	</div>	
	
</div>

<script type="text/javascript">

function showAllPrk(){
	openLoadingDialog();
	$('#tabs3').load('<?php base_url()?>tab_status_perkara/',{all:'Y'});
}

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

closeLoading();

</script>
