<?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);
$canAddPenetapan = $this->authorization->HasRuleAddPenetapan();
$HakimPanitera=$this->authorization->HasRuleHakimPanitera($perkaraid);
$canEditPendaftaran = $this->authorization->HasRuleEditPendaftaran($idalurperkara, $perkaraid);
?>
<table width="100%" id="submenus" style="font-size:13px;" >
	<tr>
		<td>
			<table>
				<tr>
					<td id="backlist"><a href="<?php echo $main_history;?>" class="btn btn-default btn-sm"><i class="fa fa-reply-all"></i> Kembali</a></td>

					<?php if ($canAddPenetapan && $idalurperkara==9 && $ada_data_dismissal==0 && $ada_data_umum==1 AND $ada_pemeriksaan_persiapan==0 AND $jenis_perkara!=625){ ?>
					<td id="backlist"><a href="#" onClick="popup_form('<?php echo base_url('add_dismissal/'.$enc);?>')" style="margin-left:3px" class="btn btn-default btn-sm">Penetapan Dismissal</a></td>
					<?php } ?>
					
					<?php 
					if ($canAddPenetapan && $ada_data_umum==1){
							$canPenHakim = TRUE;
							if($idalurperkara==9){
								if($ada_data_dismissal==1 AND $hasilDismissal==1)
									$canPenHakim = TRUE;
								if($ada_data_dismissal==0 AND $jenis_perkara==625)
									$canPenHakim = TRUE;
								if($ada_data_dismissal==1 AND $hasilDismissal==2)
									$canPenHakim = FALSE;
								if($idProses==10 OR $idProses==16)
									$canPenHakim = TRUE;
								if($ada_data_dismissal==0 AND $jenis_perkara!=625)
									$canPenHakim = FALSE;
							}
							if($is_perlawanan_dikabulkan==1)
								$canPenHakim = TRUE;

							if($ada_data_penetapan==1)
								$canPenHakim = FALSE;
					 		if($canPenHakim){ ?>						
								<td><a href="#" onClick="popup_form('<?php echo base_url('add_majelis/'.$enc);?>')" style="margin-left:3px" class="btn btn-default btn-sm">Penetapan Majelis Hakim</a></td>						
					<?php }
					}
					?>
					
					<?php if ($HakimPanitera && $idalurperkara==9 && $idProses>=30 && $ada_data_umum==1 && $ada_pemeriksaan_persiapan==0 && $ada_acara_cepat==0 && $idProses<210 && ($hasilDismissal==1 or $hasilDismissal==0 && $jenis_perkara!=625)){ ?>
							<td><a href="#" onClick="popup_form('<?php echo base_url('show_pemeriksaan_persiapan/'.$enc);?>')" style="margin-left:3px" class="btn btn-default btn-sm">Pemeriksaan Persiapan</a></td>
					<?php }	
					
					?>
					<?php if ($HakimPanitera && $idalurperkara==9 && $idProses>=30 && $ada_data_umum==1 && $ada_perbaikan_gugatan==0 && $idProses<210 and $jenis_perkara==625){ ?>
							<td><a href="#" onClick="popup_form('<?php echo base_url('show_perbaikan_gugatan/'.$enc);?>')" style="margin-left:3px" class="btn btn-default btn-sm">Perbaikan Gugatan</a></td>
					<?php }	?>
					<?php 
							$tgldaftar = new DateTime($tglPendaftaran);
							$harini = new DateTime("now");
							$selisih = $tgldaftar->diff($harini);
							$is3hari = abs($selisih->format('%R%a'));
					  
						  if ($isdiperbaiki==0 and $is3hari >=3 and $canEditHakimPanitera && ($idProses>=43) && $sudah_putusan==0 AND $ada_penetapan_sidang_pertama == 0 and $jenis_perkara==625){ ?>
						<td><a href="#" onClick="popup_form('<?php echo base_url("add_putusan_akhir/".$enc."/tambah");?>')" style="margin-left:3px" class="btn btn-default btn-sm">Gugatan Tidak Diperbaiki</a></td>
					<?php }	?>

					<?php
					if (($canEditHakimPanitera || $this->authorization->HasRuleEditPendaftaran($idalurperkara, $perkaraid)) && $ada_data_saksi==0 && $sudah_minutasi==0){
					?>
						<td><a href="#" onClick="popup_form('<?php echo base_url('add_saksi/'.$enc.'/add');?>')" style="margin-left:3px" class="btn btn-default btn-sm">Saksi Yang Dihadirkan</a></td>
					<?php } ?>

					<?php
					if ($this->authorization->HasRuleAddIntervensi($perkaraid) && $idalurperkara==9 && $idProses>=81 && $idProses<218 && $ada_data_intervensi==0 && $ada_data_putusan_sela==1){
					?>
					<td><a href="#" onClick="popup_form('<?php echo base_url("add_pihak_ketiga/".$enc."/add");?>')" style="margin-left:3px" class="btn btn-default btn-sm">Tambah Data Intervensi</a></td>
					
					<?php
						}
						if ($this->authorization->HasRuleAddVerzet() && $idalurperkara==9 && $idProses <= 214 && $ada_data_verzet<1 AND $idProses>=12 AND $hasilDismissal!="1" && $jenis_perkara!="625"){    
					?>
						<td><a href="#" onClick="popup_form('<?php echo base_url('add_verzet/'.$enc);?>')" style="margin-left:3px" class="btn btn-default btn-sm">Tambah Data Perlawanan</a></td>            
					<?php
						}
						
					if ($canEditHakimPanitera && $ada_data_putusan_sela==0 && $idProses>=80 && $idProses<210 && $idalurperkara!=119 && $idalurperkara!=114 && $idalurperkara!=8 && ($is_perlawanan_dikabulkan==1 OR $is_perlawanan_dikabulkan==0 && $jenis_perkara!="625")){
						echo '<td>|';
		                    echo '<span class="custom-dropdown custom-dropdown--emerald">';
			                    echo '<select style="width:200px;z-index:99999" class="custom-dropdown__select custom-dropdown__select--white">';
			                    	echo '<option>Pilih Draf Putusan Sela</option>';
									echo '<option onClick=cetakPutusanSela1();>Putusan Sela - Pencabutan Gugatan (Dikabulkan)</option>';
									echo '<option onClick=cetakPutusanSela2();>Putusan Sela - Pencabutan Gugatan (Ditolak)</option>';
									echo '<option onClick=cetakPutusanSela3();>Putusan Sela - Penundaan Pelaksanaan KTUN (Dikabulkan)</option>';
									echo '<option onClick=cetakPutusanSela4();>Putusan Sela - Penundaan Pelaksanaan KTUN (Ditolak)</option>';
									echo '<option onClick=cetakPutusanSela5();>Putusan Sela - Penetapan Pihak Intervensi (Dikabulkan)</option>';
									echo '<option onClick=cetakPutusanSela6();>Putusan Sela - Penetapan Pihak Intervensi (Ditolak)</option>';
			                    echo '</select>';
		                    echo '</span>';
						echo '</td>';
					}
					
					if ($canEditHakimPanitera && $ada_data_putusan_sela==0 && $idProses>=80 && $idProses<210 && $idalurperkara!=119 && $idalurperkara!=114 && $idalurperkara!=8 && ($is_perlawanan_dikabulkan==1 OR $is_perlawanan_dikabulkan==0 && $jenis_perkara!="625") ){ ?>
					<td><a href="#" onClick="popup_form('<?php echo base_url("add_putusan_sela/".$enc."/add");?>')">|Tambah Putusan Sela</a></td>
					<?php } ?>
					
					<?php if ($canEditHakimPanitera && ($idProses>=80 OR $idProses>=200) && $sudah_putusan==0 AND $ada_penetapan_sidang_pertama == 1 AND $is_perlawanan_dikabulkan!=2){
						echo '<td>|';
		                    echo '<span class="custom-dropdown custom-dropdown--emerald">';
			                    echo '<select style="width:200px;z-index:99999" class="custom-dropdown__select custom-dropdown__select--white">';
			                    	echo '<option>Pilih Draf Putusan Akhir</option>';
									echo '<option onClick=cetakPutusanAkhir1();>Putusan Akhir - Putusan Ditolak</option>';
									echo '<option onClick=cetakPutusanAkhir2();>Putusan Akhir - Putusan Dikabul</option>';
									echo '<option onClick=cetakPutusanAkhir3();>Putusan Akhir - Putusan Gugur</option>';
									echo '<option onClick=cetakPutusanAkhir4();>Putusan Akhir - Putusan Dicabut</option>';
									echo '<option onClick=cetakPutusanAkhir5();>Putusan Akhir - Putusan Tidak diterima</option>';
									echo '<option onClick=cetakPutusanAkhir6();>Putusan Akhir - FP-KABUL</option>';
									echo '<option onClick=cetakPutusanAkhir7();>Putusan Akhir - FP-TOLAK</option>';
			                    echo '</select>';
		                    echo '</span>';
						echo '</td>';
					}
					?>
					
					<?php if ($canEditHakimPanitera && ($idProses>=80 OR $idProses>=200) && $sudah_putusan==0 AND $ada_penetapan_sidang_pertama == 1 AND $is_perlawanan_dikabulkan!=2){ ?>
						<td><a href="#" onClick="popup_form('<?php echo base_url("add_putusan_akhir/".$enc."/tambah");?>')" style="margin-left:3px" class="btn btn-default btn-sm">Tambah Putusan Akhir</a></td>
					<?php
					}
					?>
					<?php
					
					
					
					if($canEditPendaftaran && $idProses>210 && intval($idProses)!=214){
						if($idalurperkara==114 OR $idalurperkara==8 OR $idalurperkara<100){} else {
					?>
						<td><a href="#" onClick="popup_form('<?php echo base_url("c_template_akta_kasasi_pid/popup_akta_tidak_kasasi/".$enc);?>')" style="margin-left:3px" class="btn btn-default btn-sm">Akta Tidak / Terlambat Mengajukan Kasasi</a></td>
						<?php
						}
					}
					?>
				</tr>
			</table>
		</td>
		<td align="right">
			<table  style="font-size:13px;color:#3598db;text-decoration: none;">
				<tr>
					<?php
					if (($idalurperkara<100 OR $idalurperkara==119) && ($this->authorization->HasRuleCabutPerkara($perkaraid)) && intval($idProses)>=10 && intval($idProses)!=214 && $idProses<210){
					?>
					<td style="padding-right:3px"><a style="text-decoration: none;color:#e74c3c;" href="#" onClick="popup_form('<?php echo base_url('add_info_cabut/'.$enc);?>')" class="btn btn-default btn-sm">Cabut Perkara</a></td>
					<?php }
					if($canEditHakimPanitera && $idalurperkara!=9 && $idalurperkara!=10 && $idalurperkara!=11 && $idalurperkara!=15 && $idalurperkara!=16 &&  $idProses>=10 && $idProses<210){
						echo '<td style="padding-right:3px"><a style="text-decoration: none;color:#e74c3c;" href="#" onClick="popup_form(\''.base_url("add_putusan_akhir/".$enc."/tambah").'\')" class="btn btn-default btn-sm">Tidak Berwenang</a></td>';
					}					
					if ($this->authorization->HasRuleHapusPerkara($perkaraid)){ ?>
						<td><a style="text-decoration: none;color:white;" href="#" onclick="popup_form('<?php echo base_url("hapus_perkara/".$enc."/".base64_encode($this->encrypt->encode($idalurperkara)));?>')" class="btn btn-danger btn-sm">Hapus</a></td>
					<?php } ?>
				</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="15%" />
        <?php
		if ($sudah_putusan==1){
			echo "<col  width='10%' />";
		}
		?>
		<tbody>
			<tr>
				<td>Nomor Perkara</td>
				<td><?php if($idalurperkara==114) {  } else {echo $this->nativesession->getStatusPihak(10,$idalurperkara,1); } ?></td>
				<td><?php echo $this->nativesession->getStatusPihak(10,$idalurperkara,2); ?></td>
				<td>Status Perkara</td>
				<?php
				if ($sudah_putusan==1 OR ($is_perlawanan_dikabulkan==2 AND $bht_perlawanan!=34)){
					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)){
					?>
						<td>
							<a href="#" onClick="popup_form('<?php echo base_url('detil_perkara_tun/manage_bht/'.$enc);?>')"><?php echo $tgl_bht;?></a>
						</td>										
				<?php
					}else{ ?>
						<td>
							<label><?php echo $tgl_bht;?></label>
						</td>
				<?php
					}
				}elseif($this->session->userdata('jenis_pengadilan')==3 AND $is_perlawanan_dikabulkan==2 AND $bht_perlawanan!=34){
					?>
						<td>
							<label><?php echo $this->tanggalhelper->convertDayDate($ada_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 ($ada_data_dismissal==1 AND $idalurperkara==9 ){
					
					echo "<li class='tab'><a class='tabs20' href=\"#tabs20\" id='tabInfo'>Penetapan Dismissal</a></li>";
				
			}
			if ($ada_data_verzet>0){
				
					echo "<li class='tab'><a class='tabs5' href=\"#tabs5\" id= 'tabInfo'>Perlawanan</a></li>";
				
			}
			if ($ada_data_penetapan>=1){
				
					echo "<li class='tab'><a class='tabs2' href=\"#tabs2\" id= 'tabInfo'>Penetapan</a></li>";
				
			}
			if ($ada_data_penetapan>=1){
				echo "<li class='tab' ><a class='tabs25' href=\"#tabs25\" id= 'tabInfo'>Court Calendar</a></li>";
			}

			if ($idProses>=20 AND $ada_pemeriksaan_persiapan==1){
				
					echo "<li class='tab'><a class='tabs99' href=\"#tabs99\" id= 'tabInfo'>Pemeriksaan Persiapan</a></li>";
				
			}	

			if ($idProses>=20 AND $ada_perbaikan_gugatan==1){
				
					echo "<li class='tab'><a class='tabs100' href=\"#tabs100\" id= 'tabInfo'>Perbaikan Gugatan</a></li>";
				
			}			
			if ($idProses>=17 AND $ada_data_sidang>=1){
				
					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 ($ada_data_putusan_sela==1){
				
					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 && $idProses!=214 && $ada_data_putusan>0 && (($hasilDismissal==1 OR $is_perlawanan_dikabulkan==1) && ($idalurperkara==9 OR $idalurperkara==10 OR $idalurperkara==11))){
				
					echo "<li class='tab'><a class='tabs10' href=\"#tabs10\" id= 'tabInfo'>Putusan Akhir</a></li>";
				
			}

			if ($idProses>=300 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($idProses>=600 && $ada_data_eksekusi>0){
					echo "<li class='tab'><a href=\"#tabs17\" id= 'tabInfo'>Eksekusi</a></li>";
				
			}
			if($idalurperkara<100){
					echo "<li class='tab'><a href=\"#tabs11\" id= 'tabInfo'>Biaya Perkara</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 ($ada_data_penetapan>=1){ 
			echo '<div id="tabs2"></div>';
		}
		if ($ada_data_penetapan>=1){ 
			echo '<div id="tabs25"></div>';
		}
		if ($idProses>=20 AND $ada_pemeriksaan_persiapan==1){ 
			echo '<div id="tabs99"></div>';
		}
		if ($idProses>=20 AND $ada_perbaikan_gugatan==1){ 
			echo '<div id="tabs100"></div>';
		}
		if ($ada_data_saksi>0){
			echo '<div id="tabs23"></div>';
		}
		
		if ($idProses>10 AND $idalurperkara==9 AND $ada_data_dismissal==1){
			echo '<div id="tabs20"></div>';
		}
		if ($idProses>=80 OR $ada_data_sidang>=1){
			echo '<div id="tabs4"></div>';
		}
		
		
		if ($idProses>=81 && $ada_data_intervensi>0){
			echo '<div id="tabs7"></div>';
		}
		
		if ($ada_data_putusan_sela==1){
			echo '<div id="tabs9"></div>';
		}
		if ($idProses>=210 && $idProses!=214 && $ada_data_putusan>0 && (($hasilDismissal==1 OR $is_perlawanan_dikabulkan==1) && ($idalurperkara==9 OR $idalurperkara==10 OR $idalurperkara==11))){
			echo '<div id="tabs10"></div>';
		}
		if ($ada_data_verzet>0){
			echo '<div id="tabs5"></div>';
		}
		
		if ($idProses>=300 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 ($idProses>=600 && $ada_data_eksekusi>0){
			echo '<div id="tabs17"></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')=='#tabs99'){
				$('#tabs99').load('<?php echo base_url("show_pemeriksaan_persiapan_tab/".$enc);?>');
				$('a[href=#tabs99]').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'){
				openLoadingDialog();
				$('#tabs5').load('<?php echo base_url("add_info_verzet/".$enc);?>');
				$('a[href=#tabs5]').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')=='#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')=='#tabs17'){
				//openLoadingDialog();
				$('#tabs17').load('<?php echo base_url("open_eksekusi/".$enc);?>');
				$('a[href=#tabs17]').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')=='#tabs23'){
				openLoadingDialog();
				$('#tabs23').load('<?php echo base_url("view_info_saksi/".$enc);?>');
				$('a[href=#tabs23]').addClass('loaded');
			}else if($(this).attr('href')=='#tabs100'){
				openLoadingDialog();
				$('#tabs100').load('<?php echo base_url("show_perbaikan_gugatan_tab/".$enc);?>');
				$('a[href=#tabs100]').addClass('loaded');
			}else if($(this).attr('href')=='#tabs25'){
				openLoadingDialog();
				$('#tabs25').load('<?php echo base_url("court_calendar/".$enc);?>');
				$('a[href=#tabs25]').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 cetakPutusanSelaKeberatanPutusAkhir(){
	window.open('<?php echo base_url("c_template_putusan_pidana/cetak_putusan_sela_keberatan_bersama_putusan_akhir/")."/".$enc;?>','_self');
}
function cetakPutusanSelaKeberatanDiterima(){
	window.open('<?php echo base_url("c_template_putusan_pidana/cetak_putusan_sela_keberatan_diterima/")."/".$enc;?>','_self');
}
function cetakPutusanSelaKeberatanTidakDiterima(){
	window.open('<?php echo base_url("c_template_putusan_pidana/cetak_putusan_sela_keberatan_tidak_diterima/")."/".$enc;?>','_self');
}
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 cetakPutusanSela1(){
	window.open('<?php echo base_url("c_template_tun/cetak_putusan_sela/")."/".$enc."/pencabutan_gugatan_dikabulkan";?>','_self');
}
function cetakPutusanSela2(idSela){
	window.open('<?php echo base_url("c_template_tun/cetak_putusan_sela/")."/".$enc."/pencabutan_gugatan_ditolak/";?>'+idSela,'_self');
}
function cetakPutusanSela3(idSela){
	window.open('<?php echo base_url("c_template_tun/cetak_putusan_sela/")."/".$enc."/ktun_dikabulkan/";?>'+idSela,'_self');
}
function cetakPutusanSela4(idSela){
	window.open('<?php echo base_url("c_template_tun/cetak_putusan_sela/")."/".$enc."/ktun_ditolak/";?>'+idSela,'_self');
}
function cetakPutusanSela5(idSela){
	window.open('<?php echo base_url("c_template_tun/cetak_putusan_sela/")."/".$enc."/penetapan_intervensi_dikabulkan/";?>'+idSela,'_self');
}
function cetakPutusanSela6(idSela){
	window.open('<?php echo base_url("c_template_tun/cetak_putusan_sela/")."/".$enc."/penetapan_intervensi_ditolak/";?>'+idSela,'_self');
}
function cetakPutusanAkhir1(){
	window.open('<?php echo base_url("c_template_tun/cetak_putusan_tun/")."/".$enc."/4/";?>','_self');
}
function cetakPutusanAkhir2(){
	window.open('<?php echo base_url("c_template_tun/cetak_putusan_tun/")."/".$enc."/3/";?>','_self');
}
function cetakPutusanAkhir3(){
	window.open('<?php echo base_url("c_template_tun/cetak_putusan_tun/")."/".$enc."/5/";?>','_self');
}
function cetakPutusanAkhir4(){
	window.open('<?php echo base_url("c_template_tun/cetak_putusan_tun/")."/".$enc."/1/";?>','_self');
}
function cetakPutusanAkhir5(){
	window.open('<?php echo base_url("c_template_tun/cetak_putusan_tun/")."/".$enc."/2/";?>','_self');
}
function cetakPutusanAkhir6(){
	window.open('<?php echo base_url("c_template_tun/cetak_putusan_tun/")."/".$enc."/6/";?>','_self'); //fp kabul
}
function cetakPutusanAkhir7(){
	window.open('<?php echo base_url("c_template_tun/cetak_putusan_tun/")."/".$enc."/7/";?>','_self'); //fp tolak
}

function pilih_cetak(ele){
	if (ele.value=='cetakPutusanFormatPUtidakDiterima()'){
		cetakPutusanFormatPUtidakDiterima();
	}else if (ele.value=='cetakPutusanPraPidGugur()'){
		cetakPutusanPraPidGugur();
	}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');
	} 
}
</script>
