<link rel="stylesheet" type="text/css" href="<?php echo base_url()."resources/css/bootstrap.css" ?>">

<?php
if ($idalur==1) {
	$sumber="Pengaju";
	$namaDelegasi="MASUK";
	$namapn=$pn_asal_text;
	$hasil="Hasil Pelaksanaan Delegasi";
	$tab_edoc=" <b>E-Doc Pelaksanaan</b> ";
	$lampiran_edoc="E-Doc Permohonan";
}else{
	$sumber="Tujuan";
	$namaDelegasi="KELUAR";
	$namapn=$pn_tujuan_text;
	$hasil=" Permohonan Bantuan Delegasi";
	$tab_edoc=" <b>E-Doc Permohonan</b> ";
	$lampiran_edoc="E-Doc Pelaksanaan";
}

?>
<style type="text/css">
	body{overflow:auto;}
</style>
<script src="<?php echo base_url();?>resources/js/jquery.idTabs.min.js"></script>
<hr class="thick-line" style="clear:both;">

<table id='submenus' style='width:100%;font-size:13px;'>
	<tr><td style='padding:5px;'>[<a style='font-size: 13px;color: #3598DB;text-decoration: none;' href="<?php echo base_url('perkara_list_delegasi/type/'.base64_encode($this->encrypt->encode($idalur)));?>">Kembali</a>]</td></tr>
</table>
<hr class="thick-line" style="clear:both;">
<div class="cssTable" style="margin-top:5px;width:99%">
<table id="tableinfo">
		<col  width="25%" />
		<col  width="25%" />
        <col  width="25%" />
        <col  width="35%" />
        <col  width="25%" />
        <col  width="25%" />
		<tbody>
			<tr>
				<td>Pengadilan Negeri <?php echo $sumber; ?></td>
				<td>Nomor Perkara</td>
				<td>Jenis Delegasi</td>
				<td>Pihak</td>
				<td>Pelaksanaan</td>
				<td>Status Kirim</td>
			</tr>
			<tr>
			<?php
				if ($idalur==1) {	
					echo '<td>'.$pn_asal_text.'</td>';
				}else {	
					echo '<td>'.$pn_tujuan_text.'</td>';
				}
				echo '<td>'.$nomor_perkara.'</td>';
				echo '<td>'.$jenis_delegasi_text.'</td>';
				echo '<td>'.$para_pihak.'</td>';
				echo '<td>'.$p_status_delegasi.'</td>';
				if ($status_kirim==0){
					echo '<td style="background-color:#FFC750">Upload E-DOC pada tab '.$tab_edoc.' untuk mengirim '.$hasil.'</td>';
				}else if ($status_kirim==1){
					echo '<td style="background-color: #339E6C;color:#fff">Sudah terkirim</td>';
				}else if ($status_kirim==2){
					echo '<td style="background-color: #339E6C;color:#fff">Sudah dilaksanakan</td>';
				}
			?>
			</tr>
		</tbody>
	</table>
</div>
<div id='content' style="margin: 5px;margin-top:10px;">
	<div id="usual2" class="usual"> 
		<ul>
			<?php 
			echo "<li class='tab'><a href=\"#tabs1\" id= 'tabInfo' class=\"selected\">Data Umum</a></li>";
			if ( $status_kirim!=0) { 
			}
			echo "<li class='tab'><a href=\"#tabs3\" class='tabs3' id= 'tabInfo'>".$lampiran_edoc."</a></li>";
			if ( $idalur==1) { 
				echo "<li class='tab'><a class='tabs4' href=\"#tabs4\" id= 'tabInfo'>Penunjukan</a></li>";
			}
			if (!empty($p_tgl_penunjukan_jurusita)){	
				echo "<li class='tab'><a href=\"#tabs5\" id= 'tabInfo'>Pelaksanaan Delegasi</a></li>";
			}
			if (!empty($p_tgl_resi) || !empty($p_nomor_resi)) {	
				echo "<li class='tab'><a href=\"#tabs6\" id= 'tabInfo'>Biaya Delegasi</a></li>";
			}
				echo "<li class='tab'><a class='tabs7' href=\"#tabs2\" id= 'tabInfo'>".$tab_edoc."</a></li>";
			?>	
		</ul>
		
		<div id="tabs1"><?php $this->load->view('delegasi/data_umum');?></div>
		<div id="tabs2"><?php
							if ( ($idalur==1 AND !empty($p_tgl_penunjukan_jurusita)) OR $idalur == 2) { 
								$this->load->view('delegasi/tab_edoc');
							}?>						
	    </div>
		<div id="tabs3"><?php $this->load->view('delegasi/lampiran_edoc');?></div>					
		<div id="tabs4"><?php
							if ( $idalur==1) {  
							$this->load->view('delegasi/tab_penunjukkan');
							}?></div>
		<div id="tabs5"><?php 
							if (!empty($p_tgl_penunjukan_jurusita)) {
								$this->load->view('delegasi/tab_pelaksanaan');
							}?>
		</div>
		<div id="tabs6"><?php
							if (!empty($p_tgl_resi) || !empty($p_nomor_resi)){	
								$this->load->view('delegasi/tab_biaya');
							}?>
		</div>
	</div>
</div>
<input type="hidden" id="refresh" name="refresh" value="">
<script type="text/javascript"> 

$("#usual2 ul").idTabs("tabs2");
$( document ).ready(function() {
	$('a#tabInfo').click(function(event){
		if (!$(this).hasClass('loaded')){
			if($(this).attr('href')=='#tabs2'){
				$('a[href=#tabs2]').addClass('loaded');
			}
		}
	});
});

function refreshPage(){
    window.open('<?php echo $main_history;?>','_self');
};

	<?php
	$segment = $this->uri->segment_array();
	if($this->uri->segment(7)==2){		
		echo "$('.tabs7').click();";
		echo "tab_no = '';";
	}
	if($this->uri->segment(7)=='js'){		
		echo "$('.tabs4').click();";
		echo "tab_no = '';";
	}

	?>
</script>
