<?php 
$this->nativesession->set_flash_session('url_from_dataumum', $history);
$canCetakPutusan=$this->authorization->HasRuleHakimCetakPutusan($perkaraid); 
$minut_diversi=false;
if ($idalurperkara==118 && $idTahapan==15 && $tahapanText=='Diversi' && $idProses==220){
	$minut_diversi=true;
}
$canCetakPutusan = TRUE;

if(($idProses==21 || $idProses==31 || $idProses==41) && $ada_jadwal_sidang){
	$keepshow=true;
}
?>
<script src="<?php echo base_url();?>resources/js/jquery.idTabs.min.js"></script>
<hr class="thick-line" style="clear:both;">
<style type="text/css">
	#submenus td{font-size:13px;}
	#submenus a {font-size:13px;color:#3598db;text-decoration: none;}
	#submenus a:visited {color:#3598db;text-decoration: none;}
	#submenus a:hover {font-size:13px;color:#3598db;text-decoration: none;}
	#submenus a:active {color:#3598db;text-decoration: none;}
</style>
<?php $canEditHakimPanitera = $this->authorization->HasRuleFormHakimPanitera($perkaraid);
$idjenisperkara = $this->tanggalhelper->getIDJenisPerkara($perkaraid);
?>
<table width="100%" id="submenus" style="font-size:13px;" >
	<tr>
		<td>
			<table>
				<tr>
					<td id="backlist"><a style="margin-left:3px" class="btn btn-default btn-sm" href="<?php echo $main_history;?>"><i class="fa fa-reply-all"></i> Kembali</a></td>
					<?php
					if ($this->authorization->HasRuleAddPenetapan() && $alur_perkara_id>100 AND $alur_perkara_id<120 && $idProses<30 && $ada_data_umum==1){
						$url = base_url("c_template_penetapan/popup_penetapan_kpn_perkara_tidak_termasuk_wewenangnya/".$enc);
						echo '<td><a style="margin-left:3px" class="btn btn-default btn-sm" href="#" onClick="popup_form(\''.$url.'\')">|<span style="color:red;">Penetapan Tidak Berwenang</span></a></td>';
					}
					if (($canEditHakimPanitera || $this->authorization->HasRuleEditPendaftaran($idalurperkara, $perkaraid)) && $ada_data_saksi==0 && $idProses<=200 && $jenis_perkara_id!=624){
						echo '<td><a style="margin-left:3px" class="btn btn-default btn-sm" href="#" onClick="popup_form(\''.base_url('add_saksi/'.$enc.'/add').'\')">Saksi Yang Dihadirkan</a></td>';
					}
					if ($this->authorization->HasRuleAddPenetapan() && $idProses==10 && $ada_data_umum==1){
						if($jenis_perkara_id==624 && $ada_data_mediasi>0){
							echo '<td><a style="margin-left:3px" class="btn btn-default btn-sm" href="#" onClick="popup_form(\''.base_url('add_majelis/'.$enc).'\')">Penetapan Majelis Hakim</a></td>';
						}elseif($jenis_perkara_id!=624 && $ada_data_mediasi==0){
							echo '<td><a style="margin-left:3px" class="btn btn-default btn-sm" href="#" onClick="popup_form(\''.base_url('add_majelis/'.$enc).'\')">Penetapan Majelis Hakim</a></td>';
						}
					}
					if ($this->authorization->HasRuleAddMediasi($perkaraid) && $ada_data_gugur == 0 && $idalurperkara==17 && $idProses>=20 && $idProses<81 ){
					 	echo '<td id="backlist"><a href="#" onClick="popup_form(\''.base_url('add_dismissal/'.$enc).'\')" style="margin-left:3px" class="btn btn-default btn-sm">Penetapan Dismissal</a></td>';
					}
					if ($this->authorization->HasRuleAddMediasi($perkaraid) && $idProses>=80 && ($idalurperkara==15) && $ada_data_mediasi==0 && $cekStatusPihakHadir==1 && $sudah_putusan==0 && intval($idProses)!=214 && $jenis_perkara_id!=344 && $jenis_perkara_id!=360 && $jenis_perkara_id!=359 && $jenis_perkara_id!=624){
						echo '<td><a style="margin-left:3px" class="btn btn-default btn-sm" href="#" onClick="popup_form(\''.base_url('add_info_mediasi/'.$enc.'/1/1').'\')">Mediasi</a></td>';
					}
					if ($this->authorization->HasRuleAddIntervensi($perkaraid) && $idalurperkara==15 && $idProses>=81 && $idProses<270 && $ada_data_intervensi==0 && $ada_data_putusan_sela==1){
						echo '<td><a style="margin-left:3px" class="btn btn-default btn-sm" href="#" onClick="popup_form(\''.base_url('add_pihak_ketiga/'.$enc."/add").'\')">Tambah Data Intervensi</a></td>';
					}
					if($this->authorization->HasRuleAddIntervensi($perkaraid) && $idalurperkara==15 && $ada_data_rekonvensi==0 && $idProses<210 && $jenis_perkara_id!=624){
						echo '<td><a style="margin-left:3px" class="btn btn-default btn-sm" href="#" onClick="popup_form(\''.base_url("add_gugatan_rekonve/".$enc).'\')">Tambah Data Rekonvensi</a></td>';
					}
					if ($this->authorization->HasRuleAddVerzet() && $idalurperkara==15 && $ada_data_verzet<1 AND $idProses>=210 AND $isVerstek>0 && empty($tgl_bht)){
						echo '<td><a style="margin-left:3px" class="btn btn-default btn-sm" href="#" onClick="popup_form(\''.base_url('add_verzet/'.$enc).'\')">Tambah Data Verzet</a></td>';
					}
					 
					if ($this->authorization->HasRuleAddVerzet() && $idalurperkara==15 && !empty($tgl_bht) && ($is_ikrar_talak==0 && $is_islam_ikrar==1) AND ($jenis_perkara_id==346 && $statusPutusan==62)){
						echo '<td><a style="margin-left:3px" class="btn btn-default btn-sm" href="#" onClick="popup_form(\''.base_url('add_ikrar_talak/'.$enc).'\')">Tambah Data Ikrar Talak</a></td>';
					}

					if ($canEditHakimPanitera && $ada_data_putusan_sela==0 && $idProses>=80 && $idProses<210  && $idalurperkara!=114 && $idalurperkara!=8 && $jenis_perkara_id!=624){
						echo '<td><a style="margin-left:3px" class="btn btn-default btn-sm" href="#" onClick="popup_form(\''.base_url("add_putusan_sela/".$enc."/add").'\')">Tambah Putusan Sela</a></td>';
					}
					if($canEditHakimPanitera && $idalurperkara>100 && $idProses>=81 && $ada_data_penuntutan==0 && $idalurperkara!=119 && $idalurperkara!=114 && $idalurperkara!=123){
						if (!$minut_diversi){
							echo '<td><a style="margin-left:3px" class="btn btn-default btn-sm" href="#" onClick="popup_form(\''.base_url('add_info_penuntutan/'.$enc).'\')">Tambah Data Tuntutan</a></td>';
						}
					}
					$templatebisadicetak = FALSE;
					$show = TRUE;
					if(($idalurperkara==1 OR $idalurperkara==7 OR $idalurperkara==15) AND $ada_data_mediasi==0 AND $cekStatusPihakHadir<2){
						$show = FALSE;
					}
					if(($idalurperkara==1 OR $idalurperkara==8 OR $idalurperkara==7 OR $idalurperkara==15) AND $ada_data_mediasi==1 AND $hasil_mediasi==0){
						$show = FALSE;
					}
					if(($idalurperkara==111 OR $idalurperkara==115 OR $idalurperkara==116 OR $idalurperkara==117 OR $idalurperkara==118 OR $idalurperkara==122) AND $ada_data_penuntutan==0){
						$show = FALSE;
					}
					if($idalurperkara>100  AND $terdakwa_tidak_hadir>=2){
						$show = TRUE;
					}
					if($idalurperkara==15 && $idProses>=80 && ($kehadiran_pihak==1 || $kehadiran_pihak==2)){
						$show = TRUE;
					}
					if($idalurperkara==15 && $kehadiran_pihak==1 && $ada_data_mediasi==0){
						$show = false;
					}
					if(($jenis_perkara_id==344 OR $jenis_perkara_id==360 OR $jenis_perkara_id==359 OR $jenis_perkara_id==624) && $kehadiran_pihak!=0){
						$show = TRUE;
					}
					if($idalurperkara==16){
						$show = TRUE;
					}
					if($ada_data_mediasi==1 && $hasil_mediasi== 0 && $jenis_perkara_id!=624){
						$show = FALSE;	
					}
					if(($idalurperkara==122 OR $idalurperkara==123) && $is_keberatan_diterima==1){
						$show = TRUE;
					}
					if (intval($kehadiran_pihak)>0 && ($canEditHakimPanitera && $idProses>=130) || ($canEditHakimPanitera && $idalurperkara==113 && $idProses>=80) || ($canEditHakimPanitera && $idalurperkara>100 && $terdakwa_tidak_hadir>=2) || ($canEditHakimPanitera && $idalurperkara==8 && $idProses>=81) || ($idalurperkara==16 && $kehadiran_pihak==1) || ($idalurperkara==15 && $idProses>=80 && ($kehadiran_pihak==1 || $kehadiran_pihak==2)) || (($jenis_perkara_id==344 OR $jenis_perkara_id==360 OR $jenis_perkara_id==359 OR $jenis_perkara_id==624) && $kehadiran_pihak!=0)){
						if($show AND $sudah_putusan==0){
							$templatebisadicetak = TRUE;
							echo '<td><a style="margin-left:3px" class="btn btn-default btn-sm" href="#" onClick="popup_form(\''.base_url("add_putusan_akhir/".$enc."/tambah").'\')">Tambah '; echo ($idalurperkara==2 OR $idalurperkara==16)? 'Penetapan (Putusan Akhir)':'Putusan Akhir'; echo '</a></td>';
						}
					}
					if ($canCetakPutusan && $idProses>=80 && $idProses<218 AND $ada_data_dismissal!=1  && $idalurperkara!=122 && $idalurperkara!=123){
						echo '<td>|';
							echo '<span class="custom-dropdown custom-dropdown--emerald">';
			                    echo '<select onchange="pilih_cetak(this)" style="width:200px;z-index:99999" class="custom-dropdown__select custom-dropdown__select--white">';
				                    echo '<option value="1">Pilih Draft Putusan Akhir</option>';
				                    if ($alur_perkara_id==='15' || $alur_perkara_id==='16'){
										echo '<option value="'.base_url("c_template_putusan_agama/popup_putusan/".$enc.'/'.$alur_perkara_id).'">Cetak Draft Putusan</option>';
										echo '<option id="mediasi" value="'.base_url('c_template_mediasi').'/popup/'.$enc.'">Model Penetapan/Putusan Tergugat/Penggugat Tidak Beritikad Baik </option>';
										echo '<option value="cetakAkta">Akta Perdamaian</option>';
									}elseif($alur_perkara_id==='17'){
										echo '<option value="'.base_url("c_template_putusan_perdata/popup_putusan_perdata_s/".$enc).'">Putusan Gugatan Sederhana</option>';
									}
			                    echo '</select>';
		                    echo '</span>';
	                    echo '</td>';
					}
					if($this->authorization->HasRuleAddAktaCerai() && $idalurperkara==15 &&  $ada_akta_cerai==0 && (($jenis_perkara_id==346 && $is_already_ikrar>0 && $statusIkrarTalak==1) OR ($sudah_putusan==1 && $jenis_perkara_id==347 )) && !empty($tgl_bht) && $ada_penyebab_cerai==1 && $ada_keadaan_istri==1){
						echo "<td><a class='btn btn-default btn-sm' style=\"margin-left:3px';color:#259FD3;text-decoration: none;\" href=\"#\" onClick=\"popup_form('".base_url('edit_ikrar_talak_akta_cerai/'.$enc)."')\">Tambah Data Akta Cerai</a></td>"; 	
					}
					if($this->authorization->HasRuleEditPendaftaran($idalurperkara, $perkaraid) && $idProses>210 && intval($idProses)!=214){
						if($idalurperkara==114 OR $idalurperkara==8 OR $idalurperkara<100 OR $idalurperkara==119){} else {
							echo '<td><a class="btn btn-default btn-sm" href="#" onClick="popup_form(\''.base_url("c_template_akta_kasasi_pid/popup_akta_tidak_kasasi/".$enc).'\')"><span style="color:red;margin-left:3px;">Akta Tidak / Terlambat Mengajukan Kasasi</span></a></td>';
						}
					}
					if ($canEditHakimPanitera && $idalurperkara==8 && $idProses>=81 && $idProses<=200 && $terdakwa_tidak_hadir>=2){
					 	echo '<td id="backlist"><a style="margin-left:3px" class="btn btn-default btn-sm" href="#" onClick="popup_form(\''.base_url('add_pen_gugur/'.$enc).'\')">Penetapan Gugur</a></td>';
					}					
					if ($this->authorization->HasRuleAddPendaftaranBanding($idalurperkara) && $ada_data_gugur == 0 && $idalurperkara==17 && $idProses>=210 && $ada_data_dismissal==0 && $ada_data_keberatan==0){
					 	echo '<td id="backlist"><a href="#" onClick="popup_form(\''.base_url('add_keberatan/'.$enc).'\')" style="margin-left:3px" class="btn btn-default btn-sm">Tambah Keberatan</a></td>';
					}
					?>
				</tr>
			</table>
		</td>
		<td align="right">
			<table  style="font-size:13px;color:#3598db;text-decoration: none;">
				<tr>
					<?php
					if ($idalurperkara==15 OR $idalurperkara==16 ){
						echo '<td>|';
							echo '<span class="custom-dropdown custom-dropdown--emerald">';
			                    echo '<select onchange="pilih_cetak(this)" style="width:200px;z-index:99999" class="custom-dropdown__select custom-dropdown__select--white">';
				                    echo '<option value="1">Pilih Template Pendukung</option>';
				                    if ($alur_perkara_id==='15' || $alur_perkara_id==='16'){
										echo '<option value="'.base_url("c_template_pendukung_agama/popup_pra_persidangan/".$enc.'/'.$alur_perkara_id).'">Pra Persidangan</option>';
										echo '<option value="'.base_url("c_template_pendukung_agama/popup_proses_persidangan/".$enc.'/'.$alur_perkara_id).'">Proses Persidangan</option>';
										echo '<option value="'.base_url("c_template_pendukung_agama/popup_pasca_persidangan/".$enc.'/'.$alur_perkara_id).'">Pasca Persidangan</option>';
						
									}
			                    echo '</select>';
		                    echo '</span>';
	                    echo '</td>';
					}
					if (($idalurperkara<100 OR $idalurperkara==119) && ($this->authorization->HasRuleCabutPerkara($perkaraid)) && intval($idProses)>=10 && intval($idProses)!=214 && $idProses<210 && $this->session->userdata('idgroup')!=30){
						echo '<td><a class="btn btn-default btn-sm" style="margin-right:3px;" href="#" onClick="popup_form(\''.base_url('add_info_cabut/'.$enc).'\')">Cabut Perkara</a></td>';
					}
					if($idalurperkara>100 AND $idalurperkara!=119 AND $idProses<210 AND $this->authorization->HasRuleCabutPerkara($perkaraid)){
						echo '<td><a class="btn btn-default btn-sm" style="margin-right:3px;text-decoration: none;color:#e74c3c;" href="#" onClick="popup_form(\''.base_url("add_putusan_akhir/".$enc."/tambah").'\')">Terdakwa Meninggal</a></td>';
					}
					if ($this->authorization->HasRuleHapusPerkara($perkaraid)){
						echo '<td><a style="text-decoration: none;color:white;" href="#" onclick="popup_form(\''.base_url("hapus_perkara/".$enc."/".base64_encode($this->encrypt->encode($idalurperkara))).'\')" class="btn btn-danger btn-sm">Hapus</a></td>';
					} ?>
				</tr>
			</table>
		</td>
	</tr>
</table>
<hr class="thick-line" style="clear:both;">
<div class="cssTable" style="margin-top:5px;">
	<table id="tableinfo">
		<col  width="15%" />
        <col  width="30%" />
        <col  width="30%" />
        <col  width="20%" />
         <?php
		if ($sudah_putusan==1){
			echo "<col  width='15%' />";
		}
		?>
		<tbody>
			<tr>
				<td>Nomor Perkara</td>
				<td><?php if($idalurperkara==114) {  } else {echo $this->nativesession->getStatusPihak(10,$idalurperkara,1,$this->session->userdata('jenis_pengadilan'),$jenis_perkara_id); } ?></td>
				<td><?php echo $this->nativesession->getStatusPihak(10,$idalurperkara,2,$this->session->userdata('jenis_pengadilan'),$jenis_perkara_id); ?></td>
				<td>Status Perkara</td>
				<?php
				if ($sudah_putusan==1){
					echo "<td>Tanggal BHT</td>";
				}
				?>
			</tr>
			<tr>
				<td><?php echo $noPerkara;?></td>
				<td><?php if($idalurperkara==114){} else { echo $pihak1; } ?></td>
				<td><?php echo $pihak2;?></td>
				<td><?php echo $statuTerakhir;?></td>
				<?php
				if ($sudah_putusan==1){
					if ($this->authorization->HasRuleAddBHT($perkaraid,$idalurperkara) && $jenis_perkara_id!=624){

					?>
				<td>
					<a href="#" onClick="popup_form('<?php echo base_url('detil_perkara_agama/manage_bht/'.$enc);?>')"><?php echo (!empty($tgl_bht)? $tgl_bht.' (Edit)':'Tambah');?></a>
				</td>
				<?php
					}else{ ?>
				<td>
					<label><?php echo $tgl_bht;?></label>
				</td>
				<?php
					}
				}
				?>
			</tr>
		</tbody>
	</table>
</div>
<input type="hidden" id="ref_dataumum" value="0">
<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($jenis_perkara_id==624){
				echo "<li class='tab' ><a class='tabs26'  href=\"#tabs26\" id= 'tabInfo'>Mediasi Di Luar Pengadilan</a></li>";
			}
			if ($idProses>=20){
				echo "<li class='tab'><a class='tabs2' href=\"#tabs2\" id= 'tabInfo'>Penetapan</a></li>";
			}
			if ($idProses>=214 AND $idalurperkara==17 AND $ada_data_dismissal==1){				
				echo "<li class='tab' ><a class='tabs20' href=\"#tabs20\" id= 'tabInfo'>Penetapan Dismissal</a></li>";				
			}
			if ($idProses>=20 && ($ada_data_diversi>=0 OR $is_dibuka_kembali>0)){
				echo "<li class='tab' ><a class='tabs27' href=\"#tabs27\" id= 'tabInfo'>Court Calendar</a></li>";
			}
			if ($idProses>=80 && intval($idProses)!=214 && $is_jadwal_sidang>0){
				echo "<li class='tab'><a class='tabs4' href=\"#tabs4\" id= 'tabInfo'>Jadwal Sidang</a></li>";
			}
			if ($ada_data_saksi>0){
				echo "<li class='tab'><a class='tabs23' href=\"#tabs23\" id= 'tabInfo'>Saksi</a></li>";
			}
			if (($idalurperkara==15) && $idProses>=80 && $ada_data_mediasi>0 && $jenis_perkara_id!=624){
				echo "<li class='tab'><a class='tabs6' href=\"#tabs6\" id= 'tabInfo'>Mediasi </a></li>";
			}			
			if ($idProses>=81 && $ada_data_rekonvensi>0 && $idalurperkara<100){
				echo "<li class='tab'><a class='tabs22' href=\"#tabs22\" id= 'tabInfo'>Rekonvensi</a></li>";
			}
			if($idalurperkara>=111 && $ada_data_penuntutan==1 && $idalurperkara!=119 && $idalurperkara!=123){
				echo "<li class='tab'><a class='tabs8' href=\"#tabs8\" id= 'tabInfo'>Tuntutan</a></li>";	
			}
			if ($ada_data_putusan_sela==1 && $idalurperkara!=119 && $idalurperkara!=123){
				echo "<li class='tab'><a class='tabs9' href=\"#tabs9\" id= 'tabInfo'>Putusan Sela</a></li>";	
			}
			if ($idProses>=81 && $ada_data_intervensi>0){
				echo "<li class='tab'><a class='tabs7' href=\"#tabs7\" id= 'tabInfo'>Intervensi</a></li>";
			}
			if ($idProses>=210 AND $idProses!=214 AND $sudah_putusan==1 AND $ada_data_gugur==0){
				echo "<li class='tab'><a class='tabs10' href=\"#tabs10\" id= 'tabInfo'>";
				echo ($idalurperkara==2 OR $idalurperkara==16)? 'Penetapan (Putusan Akhir)':'Putusan Akhir';
				echo "</a></li>";
			}
			if ($idalurperkara==15 && $ada_data_verzet>0){
				echo "<li class='tab'><a class='tabs5' href=\"#tabs5\" id= 'tabInfo'>Verzet</a></li>";
			}
			
			if ($idProses>=210 AND $idalurperkara==17 AND $ada_data_gugur==1){
				echo "<li class='tab'><a class='tabs21' href=\"#tabs21\" id= 'tabInfo'>Penetapan Gugur</a></li>";
			}
			if ($idalurperkara==17 && $idProses>=210 && $ada_data_keberatan==1){				
				echo "<li class='tab' ><a class='tabs19' href=\"#tabs19\" id= 'tabInfo'>Keberatan</a></li>";				
			}
			if ($idProses>=290 AND $ada_data_banding>0){
				echo "<li class='tab'><a href=\"#tabs13\" id= 'tabInfo'>Banding</a></li>";
			}
			if ($idProses>=410 AND $ada_data_kasasi>0){
				echo "<li class='tab'><a href=\"#tabs14\" id= 'tabInfo'>Kasasi</a></li>";
			}
			if ($idProses>=510 AND $ada_data_PK>0){
				echo "<li class='tab'><a href=\"#tabs15\" id= 'tabInfo'>Peninjauan Kembali</a></li>";
			}
			if ($idalurperkara>100 && $idProses>=650 AND $ada_data_grasi>0){
				echo "<li class='tab'><a href=\"#tabs16\" id= 'tabInfo'>Grasi</a></li>";
			}else if(($idalurperkara==1 || $idalurperkara==6) && $idProses>=600 && $ada_data_eksekusi>0){
				echo "<li class='tab'><a href=\"#tabs17\" id= 'tabInfo'>Eksekusi</a></li>";
			}
			if($is_ikrar_talak>0 AND $jenis_perkara_id==346){
				echo "<li class='tab'><a href=\"#tabs24\" id= 'tabInfo'>Ikrar Talak</a></li>";
			}
			if($idalurperkara==15 AND $ada_akta_cerai==1 AND (($jenis_perkara_id==346 AND $is_already_ikrar>0) OR ($sudah_putusan==1 AND $jenis_perkara_id==347))){
					echo "<li class='tab'><a href=\"#tabs25\" id= 'tabInfo'>Akta Cerai</a></li>";
				
			}
			if($idalurperkara<100){
				
					echo "<li class='tab'><a href=\"#tabs11\" id= 'tabInfo'>Biaya Perkara</a></li>";
				
			}
			if($idalurperkara>=111 && $idalurperkara!=119 && $idalurperkara!=114){
				
					echo "<li class='tab'><a href=\"#tabs18\" id= 'tabInfo'>Barang Bukti</a></li>";
				
			}						
			
				echo "<li class='tab'><a href=\"#tabs12\" id= 'tabInfo'>Riwayat Perkara</a></li>";
			
			?>
		</ul>
		<input type="hidden" id="refresh_dest" value="<?php echo $history;?>">
		<div id="tabs1">
		<?php 
			$this->load->view('perkara_tab/data_umum');
		?>
		</div>
		<?php
		if($jenis_perkara_id==624){
			echo '<div id="tabs26"></div>';
		} 
		if ($ada_data_saksi>0){
		echo '<div id="tabs23"></div>';
		}
		if ($idProses>=20 && ($ada_data_diversi==0 OR $is_dibuka_kembali>0)){ 
			echo '<div id="tabs2"></div>';
		}
		if ($idProses>=214 AND $idalurperkara==17 AND $ada_data_dismissal==1){
			echo '<div id="tabs20"></div>';
		}
		if ($idProses>=20 && ($ada_data_diversi>=0 OR $is_dibuka_kembali>0)){ 
			echo '<div id="tabs27"></div>';
		}
		if ($idProses>=80 && intval($idProses)!=214){
			echo '<div id="tabs4"></div>';
		}
		
		if (($idalurperkara==15) && $idProses>=80 && $ada_data_mediasi>0 && $jenis_perkara_id!=624){
			echo '<div id="tabs6"></div>';
		}
		if ($idProses>=81 && $ada_data_intervensi>0){
			echo '<div id="tabs7"></div>';
		}
		if ($idProses>=81 && $ada_data_rekonvensi>0 && $idalurperkara<100){
			echo '<div id="tabs22"></div>';
		}
		if($idalurperkara>=111 && $ada_data_penuntutan==1){
			echo '<div id="tabs8"></div>';
		}
		if($idalurperkara>=111){
			echo '<div id="tabs18"></div>';
		}
		if ($ada_data_putusan_sela==1){
			echo '<div id="tabs9"></div>';
		}
		echo '<div id="tabs10"></div>';
		
		if ($idalurperkara==15 && $ada_data_verzet>0){
			echo '<div id="tabs5"></div>';
		}
		if ($idalurperkara==17 && $idProses>=210 && $ada_data_keberatan==1){
			echo '<div id="tabs19"></div>';
		}
		if ($idProses>=210 AND $idalurperkara==17 AND $ada_data_gugur==1){
			echo '<div id="tabs21"></div>';
		}
		if ($idProses>=290 AND $ada_data_banding>0){ 
			echo '<div id="tabs13"></div>';
		}
		if ($idProses>=410 AND $ada_data_kasasi>0){
			echo '<div id="tabs14"></div>';
		}
		if ($idProses>=510 AND $ada_data_PK>0){
			echo '<div id="tabs15"></div>';
		}
		if ($idalurperkara>100 && $idProses>=650 AND $ada_data_grasi>0){
			echo '<div id="tabs16"></div>';
		}
		if (($idalurperkara==1 || $idalurperkara==6) && $idProses>=600 && $ada_data_eksekusi>0){
			echo '<div id="tabs17"></div>';
		}
		if($is_ikrar_talak>0 AND $jenis_perkara_id==346){
			echo '<div id="tabs24"></div>';
		}
		if($idalurperkara==15 AND (($jenis_perkara_id==346 AND $is_already_ikrar>0) OR ($sudah_putusan==1 AND $jenis_perkara_id==347))){
			echo '<div id="tabs25"></div>';
		}
		if($idalurperkara<100){
			echo '<div id="tabs11"></div>';
		}
		?>
		<div id="tabs12"></div>
	</div>
</div>
<script type="text/javascript"> 
$("#usual2 ul").idTabs("tabs2");
$( document ).ready(function() {
	$('a#tabInfo').click(function(event){
		if (!$(this).hasClass('loaded')){
			if($(this).attr('href')=='#tabs1'){
				if($('#ref_dataumum').val()==1){
					openLoadingDialog();
					$('#tabs1').load('')
					$('#tabs1').load('<?php echo base_url("open_dataumum/".$enc);?>');
				}
			}else if($(this).attr('href')=='#tabs2'){
				openLoadingDialog();
				$('#tabs2').load('<?php echo base_url("add_info_penetapan/".$enc);?>');
				$('a[href=#tabs2]').addClass('loaded');
			}else if($(this).attr('href')=='#tabs20'){
				openLoadingDialog();
				$('#tabs20').load('<?php echo base_url("dismissal_c/showinfo/".$enc);?>');
				$('a[href=#tabs20]').addClass('loaded');
			}else if($(this).attr('href')=='#tabs4'){
				openLoadingDialog();
				$('#tabs4').load('<?php echo base_url("view_info_jadwal_sidang/".$enc);?>');
				$('a[href=#tabs4]').addClass('loaded');
			}else if($(this).attr('href')=='#tabs5'){
				$('#tabs5').load('<?php echo base_url("add_info_verzet/".$enc);?>');
				$('a[href=#tabs5]').addClass('loaded');
			}else if($(this).attr('href')=='#tabs6'){
				openLoadingDialog();
				$('#tabs6').load('<?php echo base_url("tab_info_mediasi/".$enc);?>');
				$('a[href=#tabs6]').addClass('loaded');
			}else if($(this).attr('href')=='#tabs7'){
				openLoadingDialog();
				$('#tabs7').load('<?php echo base_url("add_info_intervensi/".$enc);?>');
				$('a[href=#tabs7]').addClass('loaded');
			}else if($(this).attr('href')=='#tabs8'){
				openLoadingDialog();
				$('#tabs8').load('<?php echo base_url("view_info_penuntutan/".$enc);?>');
				$('a[href=#tabs8]').addClass('loaded');
			}else if($(this).attr('href')=='#tabs9'){
				openLoadingDialog();
				$('#tabs9').load('<?php echo base_url("add_info_putusan_sela/".$enc);?>');
				$('a[href=#tabs9]').addClass('loaded');
			}else if($(this).attr('href')=='#tabs10'){
				openLoadingDialog();
				$('#tabs10').load('<?php echo base_url("add_info_putusan_akhir/".$enc);?>');
				$('a[href=#tabs10]').addClass('loaded');
			}else if($(this).attr('href')=='#tabs11'){
				openLoadingDialog();
				$('#tabs11').load('<?php echo base_url("tab_info_biaya_perkara/".$enc);?>');
				$('a[href=#tabs11]').addClass('loaded');
			}else if($(this).attr('href')=='#tabs12'){
				openLoadingDialog();
				$('#tabs12').load('<?php echo base_url("view_info_riwayat_perkara/".$enc);?>');
				$('a[href=#tabs12]').addClass('loaded');
			}else if($(this).attr('href')=='#tabs13'){
				openLoadingDialog();
				$('#tabs13').load('<?php echo base_url("open_banding/".$enc);?>');
				$('a[href=#tabs13]').addClass('loaded');
			}else if($(this).attr('href')=='#tabs14'){
				openLoadingDialog();
				$('#tabs14').load('<?php echo base_url("open_kasasi/".$enc);?>');
				$('a[href=#tabs14]').addClass('loaded');
			}else if($(this).attr('href')=='#tabs15'){
				openLoadingDialog();
				$('#tabs15').load('<?php echo base_url("open_pk/".$enc);?>');
				$('a[href=#tabs15]').addClass('loaded');
			}else if($(this).attr('href')=='#tabs16'){
				openLoadingDialog();
				$('#tabs16').load('<?php echo base_url("perkara_tab_grasi/".$enc);?>');
				$('a[href=#tabs16]').addClass('loaded');
			}else if($(this).attr('href')=='#tabs17'){
				
				$('#tabs17').load('<?php echo base_url("open_eksekusi/".$enc);?>');
				$('a[href=#tabs17]').addClass('loaded');
			}else if($(this).attr('href')=='#tabs18'){
				//openLoadingDialog();
				$('#tabs18').load('<?php echo base_url("perkara_tab_barang_bukti/".$enc);?>');
				$('a[href=#tabs18]').addClass('loaded');
			}else if($(this).attr('href')=='#tabs19'){
				openLoadingDialog();
				$('#tabs19').load('<?php echo base_url("add_info_keberatan/".$enc);?>');
				$('a[href=#tabs19]').addClass('loaded');
			}else if($(this).attr('href')=='#tabs21'){
				openLoadingDialog();
				$('#tabs21').load('<?php echo base_url("penetapan_gugur/showinfo/".$enc);?>');
				$('a[href=#tabs21]').addClass('loaded');
			}else if($(this).attr('href')=='#tabs22'){
				openLoadingDialog();
				$('#tabs22').load('<?php echo base_url("show_gugatan_rekonve/".$enc);?>');
				$('a[href=#tabs22]').addClass('loaded');
			}else if($(this).attr('href')=='#tabs23'){
				openLoadingDialog();
				$('#tabs23').load('<?php echo base_url("view_info_saksi/".$enc);?>');
				$('a[href=#tabs23]').addClass('loaded');
			}else if($(this).attr('href')=='#tabs24'){
				openLoadingDialog();
				$('#tabs24').load('<?php echo base_url("add_info_ikrar/".$enc);?>');
				$('a[href=#tabs24]').addClass('loaded');
			}else if($(this).attr('href')=='#tabs25'){
				 openLoadingDialog();
				 $('#tabs25').load('<?php echo base_url("add_info_akta_cerai/".$enc);?>');
				 $('a[href=#tabs25]').addClass('loaded');
			}else if($(this).attr('href')=='#tabs26'){
				openLoadingDialog();
				$('#tabs26').load('<?php echo base_url("show_mediasi_diluar/".$enc);?>');
				$('a[href=#tabs26]').addClass('loaded');
			}else if($(this).attr('href')=='#tabs27'){
				openLoadingDialog();
				$('#tabs27').load('<?php echo base_url("court_calendar/".$enc);?>');
				$('a[href=#tabs27]').addClass('loaded');
			}
		}
	});
	<?php
	if($tabs_no!= ''){
		echo "var tab_no ='';";
		echo "tab_no ='.tabs".$tabs_no."';";
		echo "$(tab_no).click();";
		echo "tab_no = '';";
	}
	?>
});

$('#backlist').click(function(){
    window.open("<?php echo $main_history;?>","_self");
});

function cetakPutusanPraPidGugur() {
	window.open('<?php echo base_url("c_template_putusan_pidana_pra/cetak_putusan_pra_format_gugur/".$enc);?>','_self');
}
function cetakPutusanPraPidKabul() {
	window.open('<?php echo base_url("c_template_putusan_pidana_pra/cetak_putusan_pra_kabul_tolak/".$enc."/1");?>','_blank');
}
function cetakPutusanPraPidTolak() {
	window.open('<?php echo base_url("c_template_putusan_pidana_pra/cetak_putusan_pra_kabul_tolak/".$enc."/1");?>','_blank');
}

function cetakPutusanFormatPUtidakDiterima(){
    window.open('<?php echo base_url("c_template_putusan_pidana/cetak_putusan_pidana_penuntutan_tidak_diterima/")."/".$enc;?>','_self');
}
function pdt1() {
	window.open('<?php echo base_url("c_template_putusan_perdata/cetak_putusan_pdt/".$enc."/1");?>','_blank');
}
function pdt2() {
	window.open('<?php echo base_url("c_template_putusan_perdata/cetak_putusan_pdt/".$enc."/2");?>','_blank');
}
function pdt3() {
	window.open('<?php echo base_url("c_template_putusan_perdata/cetak_putusan_pdt/".$enc."/3");?>','_blank');
}
function pdt4() {
	window.open('<?php echo base_url("c_template_putusan_perdata/cetak_putusan_pdt/".$enc."/4");?>','_blank');
}
function pdt5() {
	window.open('<?php echo base_url("c_template_putusan_perdata/cetak_putusan_pdt/".$enc."/5");?>','_blank');
}
function pdt6() {
	window.open('<?php echo base_url("c_template_putusan_perdata/cetak_putusan_pdt/".$enc."/6");?>','_blank');
}
function pdt7() {
	window.open('<?php echo base_url("c_template_putusan_perdata/cetak_putusan_pdt/".$enc."/7");?>','_blank');
}
function pdt8() {
	window.open('<?php echo base_url("c_template_putusan_perdata/cetak_putusan_pdt/".$enc."/8");?>','_blank');
}
function pdt9() {
	window.open('<?php echo base_url("c_template_putusan_perdata/cetak_putusan_pdt/".$enc."/9");?>','_blank');
}
function pdt10() {
	window.open('<?php echo base_url("c_template_putusan_perdata/cetak_putusan_pdt/".$enc."/10");?>','_blank');
}
function pdt11() {
	window.open('<?php echo base_url("c_template_putusan_perdata/cetak_putusan_pdt/".$enc."/11");?>','_blank');
}
function pdt12() {
	window.open('<?php echo base_url("c_template_putusan_perdata/cetak_putusan_pdt/".$enc."/12");?>','_blank');
}
function pdt13() {
	window.open('<?php echo base_url("c_template_putusan_perdata/cetak_putusan_pdt/".$enc."/13");?>','_blank');
}
function pdt14() {
	window.open('<?php echo base_url("c_template_putusan_perdata/cetak_putusan_pdt/".$enc."/14");?>','_blank');
}
function pdt15() {
	window.open('<?php echo base_url("c_template_putusan_perdata/cetak_putusan_pdt/".$enc."/15");?>','_blank');
}
function pdt16() {
	window.open('<?php echo base_url("c_template_putusan_perdata/cetak_putusan_pdt/".$enc."/16");?>','_blank');
}
function pdt17() {
	window.open('<?php echo base_url("c_template_putusan_perdata/cetak_putusan_pdt/".$enc."/17");?>','_blank');
}
function pdt18() {
	window.open('<?php echo base_url("c_template_putusan_perdata/cetak_putusan_pdt/".$enc."/18");?>','_blank');
}
function pdt19() {
	window.open('<?php echo base_url("c_template_putusan_perdata/cetak_putusan_pdt/".$enc."/19");?>','_blank');
}

function pilih_cetak(ele){
	if (ele.value=='cetakPutusanFormatPUtidakDiterima()'){
		cetakPutusanFormatPUtidakDiterima();
	}else if (ele.value=='cetakPutusanPraPidGugur()'){
		cetakPutusanPraPidGugur();
	}else if (ele.value=='cetakAkta'){
		window.open('<?php echo base_url("c_template_mediasi/cetak/".$enc."/I_15_1");?>','_self');
	}else if (ele.value=='cetakPutusanPraPidKabul()'){
		cetakPutusanPraPidKabul();
	}else if (ele.value=='cetakPutusanPraPidTolak()'){
		cetakPutusanPraPidTolak();
	}else if (ele.value=='pdt1()'){
		pdt1();
	}else if (ele.value=='pdt2()'){
		pdt2();
	}else if (ele.value=='pdt3()'){
		pdt3();
	}else if (ele.value=='pdt4()'){
		pdt4();
	}else if (ele.value=='pdt5()'){
		pdt5();
	}else if (ele.value=='pdt6()'){
		pdt6();
	}else if (ele.value=='pdt7()'){
		pdt7();
	}else if (ele.value=='pdt8()'){
		pdt8();
	}else if (ele.value=='pdt9()'){
		pdt9();
	}else if (ele.value=='pdt10()'){
		pdt10();
	}else if (ele.value=='pdt11()'){
		pdt11();
	}else if (ele.value=='pdt12()'){
		pdt12();
	}else if (ele.value=='pdt13()'){
		pdt13();
	}else if (ele.value=='pdt14()'){
		pdt14();
	}else if (ele.value=='pdt15()'){
		pdt15();
	}else if (ele.value=='pdt16()'){
		pdt16();
	}else if (ele.value=='pdt17()'){
		pdt17();
	}else if (ele.value=='pdt18()'){
		pdt18();
	}else if (ele.value=='pdt19()'){
		pdt19();
	}else if (ele.value!=1) {
		popup_form(ele.value);
		$(ele).val('1');
	}
}
    function pilih_cetak_template(linknya){      
        if (linknya.value!=1) {
        	$('#popup_form').fadeOut()
            window.open(linknya.value,'_self');
        }
    }
</script>
