<style type="text/css">
#infoPerkara .wrapword li {
  display: list-item !important;
  clear: both;
  float: none !important;
}
</style>
<?php                        
if($idalurperkara!=114){
	$jenis_surat = '';
}
if ($idalurperkara>100) {
	$jenis_surat = 'Pelimpahan';
}
$idjenisperkara = $this->tanggalhelper->getIDJenisPerkara($perkaraid);
$idpihakpertama = '';
$namapihakpertama = '';
$idpihakkedua = '';
$namapihakkedua = '';
$edit = False;
if ($this->authorization->HasRuleEditPendaftaran($idalurperkara, $perkaraid)){
	$edit = True;	
	echo '<div id="infoPerkara" style="font-size:14px;">';
		echo '<a href="#" onClick="popup_form(\''.base_url('add_info_dataumum/'.$enc).'\')" class="btn btn-default btn-sm">Edit Data Umum</a>';
		if(($idalurperkara==1 OR $idalurperkara==7) AND $idjenisperkara!=625){
			if($idalurperkara==1){
				$judul_alur = 'Edit Gugatan ke Bantahan';
			}elseif($idalurperkara==7){
				$judul_alur = 'Edit Bantahan ke Gugatan';
			}	
			echo '<a style="margin-left:3px" href="#" onClick="popup_form(\''.base_url('edit_gugatan_bantahan/'.$enc).'\')" class="btn btn-default btn-sm">'.$judul_alur.'</a>';			
		}
		if($ada_data_umum==1 && $this->session->userdata('jenis_pengadilan')==3){
				echo '<input type="hidden" id="enc" value="'.$enc.'">';
				echo '[ <a href="#" id="cetakResume" name="cetakResume" style="color:white" class="btn btn-warning btn-sm">Cetak Resume</a> ]';
	 		if($jenisPerkara=='Permohonan Keberatan (KIP)'){ 
				echo '[ <a href="#" id="cetakSurat" name="cetakSurat" style="color:white" class="btn btn-warning btn-sm">Cetak Pemberitahuan Perkara KIP</a> ]'; 
				}
			}
	echo '</div>';
} ?>
			
<div style="font-size:14px;">
	<table id='infoPerkara' style="font-size:14px;width:100%" border="0">
		<col width="15%">
		<col width="">
		<col width="100px">
		<tbody>
			<?php
			$editPenahanan=false;
			if ($this->authorization->HasRuleHakimPanitera($perkaraid) && $idalurperkara>100){
				$editPenahanan=true;
			}
			?>
			<tr>
				<td id="first-child">Tanggal Pendaftaran </td>
				<td colspan="2"><?php echo $this->tanggalhelper->convertDayDate($tglPendaftaran);?></td>
			</tr>
			<tr>
				<td id="first-child">Klasifikasi Perkara</td>
				<td colspan="2"><?php echo $jenisPerkara;?></td>
			</tr>
			<tr>
				<td id="first-child">Nomor Urut</td>
				<td colspan="2"><?php echo $noUrut;?></td>
			</tr>
			<tr>
				<td id="first-child">Nomor Perkara</td>
				<td colspan="2"><?php echo $noPerkara;?></td>
			</tr>
			<tr>
				<td id="first-child">Tanggal Surat <?php echo $jenis_surat;?></td>
				<td colspan="2"><?php echo $this->tanggalhelper->convertDayDate($tglSurat);?></td>
			</tr>
			<?php if($idalurperkara==114){ ?>
			<tr>
				<td id="first-child">Tanggal Penindakan</td>
				<td colspan="2"><?php echo (!empty($tanggal_penindakan) ? $this->tanggalhelper->convertDayDate($tanggal_penindakan) : ''); ?></td>
			</tr>
			<tr>
				<td id="first-child">Penindakan Oleh</td>
				<td colspan="2"><?php echo (!empty($ditilang_oleh) ? $ditilang_oleh : ''); ?></td>
			</tr>
			<tr>
				<td id="first-child">Jenis Tilang</td>
				<td colspan="2"><?php echo (!empty($jenis_tilang) ? $jenis_tilang : ''); ?></td>
			</tr>
			<tr>
				<td id="first-child">Nomor Seri Surat Tilang</td>
				<td colspan="2"><?php echo (!empty($nomor_tilang) ? $nomor_tilang : ''); ?></td>
			</tr>
			<tr>
				<td id="first-child">Jenis Kendaraan</td>
				<td colspan="2"><?php echo (!empty($nama_kendaraan) ? $nama_kendaraan : ''); ?></td>
			</tr>
			<tr>
				<td id="first-child">Tanda Nomor Kerndaraan Bermotor</td>
				<td colspan="2"><?php echo (!empty($nomor_polisi) ? $nomor_polisi : ''); ?></td>
			</tr>
			<tr>
				<td id="first-child">Bukti</td>
				<td colspan="2"><?php echo (!empty($nama_bukti) ? $nama_bukti : ''); ?></td>
			</tr>
			<tr>
				<td id="first-child">Nomor Pembayaran</td>
				<td colspan="2"><?php echo (!empty($nomor_pembayaran) ? $nomor_pembayaran : ''); ?></td>
			</tr>
			<?php } else { ?>
			<tr>
				<td id="first-child">Nomor Surat <?php echo $jenis_surat;?></td>
				<td colspan="2"><?php echo (!empty($noSurat) ? $noSurat : '');?></td>
			</tr>
			<?php } ?>
			<?php
			if($this->session->userdata('jenis_pengadilan')==4 AND $idalurperkara==15 AND ($idjenisperkara==346 OR $idjenisperkara==347)){
			?>
			<tr>
				<td id="first-child">Tanggal Menikah</td>
				<td colspan="2"><?php echo $tgl_nikah;?></td>
			</tr>
			<tr>
				<td id="first-child">Tanggal Kutipan Akta Nikah</td>
				<td colspan="2"><?php echo $tgl_kutipan_akta_nikah;?></td>
			</tr>
			<tr>
				<td id="first-child">Nomor Kutipan Akta Nikah</td>
				<td colspan="2"><?php echo $no_kutipan_akta_nikah;?></td>
			</tr>
			<tr>
				<td id="first-child">KUA Tempat Menikah</td>
				<td colspan="2"><?php echo $kua_tempat_nikah;?></td>
			</tr>
			<?php
			}
			?>
			<?php
			if($this->session->userdata('jenis_pengadilan')==2){
			?>
				<tr>
					<td id="first-child">Berkas Dari</td>
					<td colspan="2"><?php echo $BerkasDari;?></td>
				</tr>
				<tr>
					<td id="first-child">Tanggal Kejadian</td>
					<td colspan="2"><?php echo $tglKejadian;?></td>
				</tr>
				<tr>
					<td id="first-child">Tempat Kejadian</td>
					<td colspan="2"><?php echo $tempatKejadian;?></td>
				</tr>
				<tr>
					<td id="first-child">Tanggal Skeppera</td>
					<td colspan="2"><?php echo $this->tanggalhelper->convertDayDate($tanggal_skeppera);?></td>
				</tr>
				<tr>
					<td id="first-child">Nomor Skeppera</td>
					<td colspan="2"><?php echo $noSkeppera;?></td>
				</tr>
				<tr>
					<td id="first-child">Pejabat Skeppera</td>
					<td colspan="2"><?php echo $pejabatSkeppera;?></td>
				</tr>			
				<tr>
					<td id="first-child">Tanggal Surat Dakwaan</td>
					<td colspan="2"><?php echo $this->tanggalhelper->convertDayDate($tglSuratDakwaan);?></td>
				</tr>
				<tr>
					<td id="first-child">Nomor Surat Dakwaan</td>
					<td colspan="2"><?php echo $noSuratDakwaan;?></td>
				</tr>
				<tr>
					<td id="first-child">Pasal Dakwaan</td>
					<td colspan="2"><?php echo (!empty($pasal_dakwaan) ? $pasal_dakwaan : '');?></td>
				</tr>
				<tr>
					<td id="first-child">Penyidik Militer </td>
					<td colspan="2"><?php echo (!empty($penyidik_mil) ? $penyidik_mil : '-');?></td>
				</tr>
				<tr>
					<td id="first-child">Nomor BAP Penyidik Militer</td>
					<td colspan="2"><?php echo (!empty($no_bap_penyidik_mil) ? $no_bap_penyidik_mil : '-');?></td>
				</tr>
				<tr>
					<td id="first-child">Tanggal BAP Penyidik</td>
					<td colspan="2"><?php echo (!empty($tgl_penyidik_mil) ? $this->tanggalhelper->convertDayDate($tgl_penyidik_mil) : '-') ;?></td>
				</tr>
			<?php
			}
			?>
			<?php if($idalurperkara!=114){ ?>
			<tr>
				<td id="first-child" style="vertical-align: top;"><?php echo $this->nativesession->getStatusPihak(10,$idalurperkara,1,$this->session->userdata('jenis_pengadilan'),$idjenisperkara);?></td>
				<td colspan="2">
					<?php
					if($pihak_pertama!=''){
						if($pihak_pertama->num_rows>0){
					?>
						<div name="table_pihak1" class="cssTable">
							<table id="tableinfo" class="table_pihak1" style="margin:0px;padding:0px;">
								<col width="5%">
								<col width="40%">
								<col width="49%">
								<?php
								if($edit){
									echo '<col width="6%">';
								}
								?>
								<tbody>
									<tr>
										<td>No</td>
										<td>Nama</td>
										<td>Alamat</td>
										<?php
										if($edit){
											echo '<td></td>';
										}
										?>
									</tr>
						<?php
								$i=1;
								foreach ($pihak_pertama->result() as $row) {

									echo "<tr>";
										echo "<td align='center'>".$i."</td>";
										echo "<td>".$row->nama."</td>";
										echo "<td>".$row->alamat."</td>";
										$idpihak = base64_encode($this->encrypt->encode($row->pihak_id));
										$idpihakpertama=$row->pihak_id;//digunakan izin cerai
										$namapihakpertama=$row->nama;//digunakan izin cerai
										$enc_id = base64_encode($this->encrypt->encode($row->id));
										$urutan = (empty($row->urutan))? 1:$row->urutan;
										if($edit==True){
											echo '<td align="center" style="cursor:pointer;">';
												if($idalurperkara<100 OR $idalurperkara==119 OR $idalurperkara==123){
													echo '<a href="#" onClick="popup_form(\''.base_url('add_pihak_pertama/'.$enc.'/edit/'.$idpihak).'/urt/'.$urutan.'/'.$enc_id.'\')">[Edit]</a>';
												}else{
													echo '<a href="#" onClick="popup_form(\''.base_url('add_jaksa/'.$enc.'/edit/'.$idpihak).'/urt/'.$urutan.'/'.$enc_id.'\')">[Edit]</a>';
												}
											echo "</td>";
										}
									echo "</tr>";
									$i++;
								}?>
								</tbody>
							</table>
						</div>
						<?php
						}
					}
					if($edit==True){
						if($idalurperkara>100){
							//di militer oditur hanya satu orang
							$jumpihak1=count($pihak_pertama->result());
							if(($this->session->userdata('jenis_pengadilan')==2) || ($this->session->userdata('jenis_pengadilan')==1 && $idalurperkara!=119) || ($this->session->userdata('jenis_pengadilan')==3 || ($this->session->userdata('jenis_pengadilan')==4 && $idalurperkara!=123))){								
								echo '<a href="#" onClick="popup_form(\''.base_url("add_jaksa/".$enc."/add").'\')" class="btn btn-default btn-sm">Tambah '.$this->nativesession->getStatusPihak(10,$idalurperkara,1).'</a>';
							}else{
								echo '<a href="#" onClick="popup_form(\''.base_url("add_pihak_pertama/".$enc."/add").'\')" class="btn btn-default btn-sm">Tambah '.$this->nativesession->getStatusPihak(10,$idalurperkara,1).'</a>';
							}
						}elseif($idalurperkara==15){
							$jumpihak1=count($pihak_pertama->result());
							if($jumpihak1==0 AND ($idjenisperkara==346 OR $idjenisperkara==347)){
								echo '[<a href="#" onClick="popup_form(\''.base_url("add_pihak_pertama/".$enc."/add").'\')" class="btn btn-default btn-sm">Tambah '.$this->nativesession->getStatusPihak(10,$idalurperkara,1,$this->session->userdata('jenis_pengadilan'),$idjenisperkara).'</a>]';
							}elseif($idjenisperkara!=346 AND $idjenisperkara!=347){
								echo '[<a href="#" onClick="popup_form(\''.base_url("add_pihak_pertama/".$enc."/add").'\')" class="btn btn-default btn-sm">Tambah '.$this->nativesession->getStatusPihak(10,$idalurperkara,1,$this->session->userdata('jenis_pengadilan'),$idjenisperkara).'</a>]';						
							}
						}else{														
							echo '<a href="#" onClick="popup_form(\''.base_url("add_pihak_pertama/".$enc."/add").'\')" class="btn btn-default btn-sm">Tambah '.$this->nativesession->getStatusPihak(10,$idalurperkara,1,$this->session->userdata('jenis_pengadilan'),$idjenisperkara).'</a>';
						}
					}
					if ($this->authorization->HasRuleHakimPanitera($perkaraid) && $idalurperkara==15 && ($idjenisperkara==346 OR $idjenisperkara==347)){ 
						echo '</br><span id="span_ijin_cerai_pihak1"><input type="checkbox" name="ijin_cerai_pihak1" id="ijin_cerai_pihak1" value="1">Izin Cerai</span>';
					} 
					?>
				</td>
			</tr>
			<?php } ?>
			<?php if ($idalurperkara==15 && ($idjenisperkara==346 OR $idjenisperkara==347)){ ?>
			<tr class="ijin_cerai_pihak1" hidden>
				<td id="first-child" style="vertical-align: top;">Izin Cerai</td>
				<td colspan="2">
					<div class="cssTable">
					<table id='infoPerkara' style="font-size:14px;width:100%" border="0">
						<col width="20%">
						<col width="40%">
						<col width="40%">
						<tbody>
							<?php 								
								$tanggal_surat =  '';
								$nomor_surat = '';
								$status_surat = '';
								$nama_pejabat = '';
								$jabatan_pejabat = '';
								$adaizinpihakpertama = '';
								if(!empty($info_ijin_cerai)){
									if($info_ijin_cerai->num_rows>0){
										foreach ($info_ijin_cerai->result() as $row) {
											if($idpihakpertama==$row->pihak_id){
												$adaizinpihakpertama = $row->pihak_id;
												$tanggal_surat =  $this->templatehelper->convertKeTglIndo($row->tanggal_surat);
												$nomor_surat = $row->nomor_surat;
												$status_surat = $row->status==1?'Ada Izin':'Tidak Ada Izin';
												$nama_pejabat = $row->nama_pejabat;
												$jabatan_pejabat = $row->jabatan_pejabat;
											}	
										}
									}																																				
								}
							?>
							<tr>
								<td hidden colspan="3"></td>
							</tr>
							<tr>
								<td id="first-child">Nama Pemohon/Penggugat</td>
								<td colspan="2"><?php echo $namapihakpertama; ?></td>
							</tr>
							<tr>
								<td id="first-child">Tanggal Surat</td>
								<td colspan="2"><?php echo $tanggal_surat; ?></td>
							</tr>
							<tr>
								<td id="first-child">Nomor Surat</td>
								<td colspan="2"><?php echo $nomor_surat; ?></td>
							</tr>
							<tr>
								<td id="first-child">Status Surat</td>
								<td colspan="2"><?php echo $status_surat; ?></td>
							</tr>
							<tr>
								<td id="first-child">Pejabat Pembuat Surat</td>
								<td colspan="2"><?php echo $nama_pejabat; ?></td>
							</tr>
							<tr>
								<td id="first-child">Jabatan Pejabat Pembuat Surat</td>
								<td colspan="2"><?php echo $jabatan_pejabat; ?></td>
							</tr>
						</tbody>
					</table>
					</div>
					<?php 
					if ($this->authorization->HasRuleHakimPanitera($perkaraid) && $idalurperkara==15 && ($idjenisperkara==346 OR $idjenisperkara==347)){
						echo '<a href="#" onClick="popup_form(\''.base_url("add_ijin_cerai_c/show_form/".$enc."/1"."/".$idpihak).'\')" class="btn btn-default btn-sm">Tambah/Edit Data Izin Cerai</a>';
					}?>
				</td>
			</tr>
			<?php }
			if($idalurperkara<100 OR $idalurperkara==119 OR $idalurperkara==123){
			?>
				<tr>
					<td id="first-child" style="vertical-align: top;"><?php echo $this->nativesession->getStatusPihak(10,$idalurperkara,7,$this->session->userdata('jenis_pengadilan'),$idjenisperkara);?></td>
					<td colspan="2">
						
						<?php
						if($pengacara_pihak_pertama!=''){
							if($pengacara_pihak_pertama->num_rows>0){
						?>
						<div class="cssTable">
							<table id="tableinfo" style="margin:0px;padding:0px;">
								<col width="5%">
								<col width="40%">
								<col width="49%">
								<?php 
								if($idalurperkara==9 AND $edit){
									echo '<col width="20%">';
									
								}
								if($edit){
									echo '<col width="6%">';
								}
								?>
								<tbody>
										<tr>
											<td>No</td>
											<td>Nama</td>
											<td>Alamat</td>
											<?php 
											if($idalurperkara==9 AND $edit){
												echo "<td>Cetak Dokumen (hanya untuk Kuasa Insidentil)</td>";
											}
											if($edit){
												echo '<td></td>';
											}
											?>
										</tr>
						<?php
								$i=1;
								foreach ($pengacara_pihak_pertama->result() as $row) {
									$pesan = '';
									if($row->aktif=='T'){
										$pesan = '(Tidak Aktif) ';
									}
									echo "<tr>";
										echo "<td align='center'>".$i."</td>";
										echo "<td>".$pesan.$row->nama."</td>";
										echo "<td>".$row->alamat."</td>";
										if($idalurperkara==9 AND $edit){ ?>
											<td align="center">
												<a href="#" onClick="popup_form('<?php echo base_url("c_template_tun_perlawanan/popup_pilihan_ketua/".$enc."/1815");?>')">											
							                        <img src="<?php echo base_url();?>resources/img/nm_icon_doc.gif">
							                    </a>    
							                </td>
										<?php }
										if($edit==True){
											$idpihak = base64_encode($this->encrypt->encode($row->pengacara_id));
											$enc_id = base64_encode($this->encrypt->encode($row->id));
											echo '<td align="center" style="cursor:pointer;">';
												echo '<a href="#" onClick="popup_form(\''.base_url('add_pengacara_pihak_pertama/'.$enc.'/edit/'.$idpihak).'/urt/'.$row->urutan.'/'.$enc_id.'\')">[Edit]</a>';
											echo '</td>';
										}
									echo "</tr>";
									$i++;

								}?>
									</tbody>
								</table>
						</div>
							<?php
							}
						}
						if($edit==True){
							echo '<a href="#" onClick="popup_form(\''.base_url("add_pengacara_pihak_pertama/".$enc."/add").'\')" class="btn btn-default btn-sm"> Tambah '.(($idalurperkara<100) ? 'Kuasa Hukum '.$this->nativesession->getStatusPihak(10,$idalurperkara,1,$this->session->userdata('jenis_pengadilan'),$idjenisperkara) :  'Kuasa Hukum '.$this->nativesession->getStatusPihak(10,$idalurperkara,1)).'</a>';
						}
						?>
						
					</td>
				</tr>
			<?php
			}
			if(($idalurperkara<100 and $idalurperkara<>16) OR $idalurperkara==119 OR $idalurperkara==123){
			?>
				<tr>
					<td id="first-child" style="vertical-align: top;"><?php echo $this->nativesession->getStatusPihak(10,$idalurperkara,2,$this->session->userdata('jenis_pengadilan'),$idjenisperkara);?></td>
					<td colspan="2">

						<?php
						if($pihak_kedua!=''){
							if($pihak_kedua->num_rows>0){
						?>
						<div name="table_pihak2" class="cssTable">
								<table class="table_pihak2" id="tableinfo" style="margin:0px;padding:0px;">
									<col width="5%">
									<col width="40%">
									<col width="49%">
									<?php
									if($edit){
										echo '<col width="6%">';
									}
									?>
									<tbody>
										<tr>
											<td>No</td>
											<td>Nama</td>
											<td>Alamat</td>
											<?php
											if($edit){
												echo '<td></td>';
											}
											?>
										</tr>
						<?php
								$i=1;
								foreach ($pihak_kedua->result() as $row) {
									echo "<tr>";
										echo "<td align='center'>".$i."</td>";
										echo "<td>".$row->nama."</td>";
										echo "<td>".$row->alamat."</td>";
										if($edit==True){
											$idpihak = base64_encode($this->encrypt->encode($row->pihak_id));
											$idpihakkedua = $row->pihak_id;//digunakan izin cerai
											$enc_id = base64_encode($this->encrypt->encode($row->id));
											$urutan = (empty($row->urutan))? 1:$row->urutan;
											$namapihakkedua = $row->nama;//digunakan izin cerai
											echo '<td align="center" style="cursor:pointer;">';
												echo '<a href="#" onClick="popup_form(\''.base_url('add_pihak_kedua/'.$enc.'/edit/'.$idpihak).'/urt/'.$urutan.'/'.$enc_id.'\')">[Edit]</a>';
											echo '</td>';
										}
									echo "</tr>";
									$i++;

								}
								echo '</tbody>';
							echo '</table>';
				  echo  '</div>';
							}
						}
						if($edit==True){
							if($idalurperkara==15){
								$jumpihak2=count($pihak_kedua->result());
								if($jumpihak2==0 AND ($idjenisperkara==346 OR $idjenisperkara==347)){
									echo '<a href="#" onClick="popup_form(\''.base_url("add_pihak_kedua/".$enc."/add").'\')" class="btn btn-default btn-sm">Tambah '.$this->nativesession->getStatusPihak(10,$idalurperkara,2,$this->session->userdata('jenis_pengadilan'),$idjenisperkara).'</a>';
								}elseif($idjenisperkara!=346 AND $idjenisperkara!=347){
									echo '<a href="#" onClick="popup_form(\''.base_url("add_pihak_kedua/".$enc."/add").'\')" class="btn btn-default btn-sm">Tambah '.$this->nativesession->getStatusPihak(10,$idalurperkara,2,$this->session->userdata('jenis_pengadilan'),$idjenisperkara).'</a>';
								}
							}else{							
								echo '<a href="#" onClick="popup_form(\''.base_url("add_pihak_kedua/".$enc."/add").'\')" class="btn btn-default btn-sm">Tambah '.$this->nativesession->getStatusPihak(10,$idalurperkara,2,$this->session->userdata('jenis_pengadilan'),$idjenisperkara).'</a>';
							}					
						}
						if ($this->authorization->HasRuleHakimPanitera($perkaraid) && $idalurperkara==15 && ($idjenisperkara==346 OR $idjenisperkara==347)){
							echo '</br><span id="span_ijin_cerai_pihak2"><input type="checkbox" name="ijin_cerai_pihak2" id="ijin_cerai_pihak2" value="1">Izin Cerai</span>';
						} 
						?>	
					</td>
				</tr>
			<?php
			}
			?>
			<?php if ($idalurperkara==15 && ($idjenisperkara==346 OR $idjenisperkara==347)){ ?>
			<tr class="ijin_cerai_pihak2" hidden>
				<td id="first-child" style="vertical-align: top;">Izin Cerai</td>
				<td colspan="2">
					<div class="cssTable">
					<table id='infoPerkara' style="font-size:14px;width:100%" border="0">
						<col width="20%">
						<col width="40%">
						<col width="40%">
						<tbody>
							<?php 								
								$tanggal_surat =  '';
								$nomor_surat = '';
								$status_surat = '';
								$nama_pejabat = '';
								$jabatan_pejabat = '';
								$adaizinpihakkedua = '';
								if(!empty($info_ijin_cerai)){
									if($info_ijin_cerai->num_rows>0){
										foreach ($info_ijin_cerai->result() as $row) {
											if($idpihakkedua==$row->pihak_id){
												$adaizinpihakkedua = $row->pihak_id;
												$tanggal_surat =  $this->templatehelper->convertKeTglIndo($row->tanggal_surat);
												$nomor_surat = $row->nomor_surat;
												$status_surat = $row->status==1?'Ada Izin':'Tidak Ada Izin';
												$nama_pejabat = $row->nama_pejabat;
												$jabatan_pejabat = $row->jabatan_pejabat;
											}	
										}
									}																																				
								}
							?>
							<tr>
								<td hidden colspan="3"></td>
							</tr>
							<tr>
								<td id="first-child">Nama Termohon/Tergugat</td>								
								<td colspan="2"><?php echo $namapihakkedua; ?></td>
							</tr>
							<tr>
								<td id="first-child">Tanggal Surat</td>
								<td colspan="2"><?php echo $tanggal_surat; ?></td>
							</tr>
							<tr>
								<td id="first-child">Nomor Surat</td>
								<td colspan="2"><?php echo $nomor_surat; ?></td>
							</tr>
							<tr>
								<td id="first-child">Status Surat</td>
								<td colspan="2"><?php echo $status_surat; ?></td>
							</tr>
							<tr>
								<td id="first-child">Pejabat Pembuat Surat</td>
								<td colspan="2"><?php echo $nama_pejabat; ?></td>
							</tr>
							<tr>
								<td id="first-child">Jabatan Pejabat Pembuat Surat</td>
								<td colspan="2"><?php echo $jabatan_pejabat; ?></td>
							</tr>
						</tbody>
					</table>
					</div>
					<?php 
					if ($this->authorization->HasRuleHakimPanitera($perkaraid) && $idalurperkara==15 && ($idjenisperkara==346 OR $idjenisperkara==347)){ 
						echo '<a href="#" onClick="popup_form(\''.base_url("add_ijin_cerai_c/show_form/".$enc."/2"."/".$idpihak).'\')" class="btn btn-default btn-sm">Tambah/Edit Data Izin Cerai</a>';
					}?>
				</td>
			</tr>
			<?php }
			if($idalurperkara>100 AND $idalurperkara!=118 AND $idalurperkara!=119 AND $idalurperkara!=123){
			?>
				<tr>
					<td id="first-child" style="vertical-align: top;"><?php echo $this->nativesession->getStatusPihak(10,$idalurperkara,2);?></td>
					<td colspan="2">
						<?php
						if($pihak_kedua!=''){
							if($pihak_kedua->num_rows>0){?>
								<div class="cssTable">
									<table id="tableinfo" style="margin:0px;padding:0px;">
										<col width="5%">
										<?php if($idalurperkara!=114) { ?>
											<col width="26%">
											<col width="27%">
										<?php } else { ?>
											<col width="25%">
											<col width="70%">
										<?php } ?>
										<?php
										if($edit || $editPenahanan){
											if($idalurperkara!=114){
												echo '<col width="13%">';
												echo '<col width="6%">';
											}
										}
										?>
										<tbody>
											<tr>
												<td>No</td>
												<td>Nama</td>
												<td>Alamat</td>
												<?php
												if($edit || $editPenahanan){
													if($idalurperkara!=114){
														echo '<td>Penahanan</td>';
														echo '<td></td>';
													}
												}
												?>
											</tr>
							<?php
									$i=1;
									$nrp = '';
									$pangkat = '';
									$jabatan = '';
									$kesatuan = '';
									foreach ($pihak_kedua->result() as $row){
										if(!empty($row->nrp))
											$nrp = '<br>NRP: '.$row->nrp;
										if(!empty($row->pangkat))
											$pangkat = '<br>Pangkat: '.$row->pangkat;
										if(!empty($row->jabatan))
											$jabatan = '<br>Jabatan: '.$row->jabatan;
										if(!empty($row->kesatuan))
											$kesatuan = '<br>Kesatuan: '.$row->kesatuan;
										echo "<tr>";
											echo "<td align='center'>".$i."</td>";
											echo "<td>".$row->nama.$pangkat.$nrp.$jabatan.$kesatuan."</td>";
											echo "<td>".$row->alamat."</td>";
											if($idalurperkara!=114){
												if($edit==True || $editPenahanan){
													$idpihak = base64_encode($this->encrypt->encode($row->pihak_id));
													$enc_id = base64_encode($this->encrypt->encode($row->id));
													$urutan = (empty($row->urutan))? 1:$row->urutan;
													if($idalurperkara!=114){
													echo '<td align="center" style="cursor:pointer;">';
														echo '<a href="'.base_url('detail_penahanan_dataumum/'.base64_encode($this->encrypt->encode($row->pihak_id)).'/'.$enc).'">[Penahanan]</a>';
													echo '</td>';
													} else {
														echo '<td align="center" style="cursor:pointer;"></td>';
													}
												}
												if($edit==True){
													echo '<td align="center" style="cursor:pointer;">';
														echo '<a href="#" onClick="popup_form(\''.base_url('add_pihak_kedua/'.$enc.'/edit/'.$idpihak).'/urt/'.$urutan.'/'.$enc_id.'\')">[Edit]</a>';
													echo '</td>';
												}
											}
											echo "</tr>";
											$i++;
									}?>
										</tbody>
									</table>
								</div>
						<?php
							}
						}
					if($idalurperkara!=114){
						if($edit==True){
							echo '<a href="#" onClick="popup_form(\''.base_url("add_pihak_kedua/".$enc."/add").'\')" class="btn btn-default btn-sm">Tambah '.$this->nativesession->getStatusPihak(10,$idalurperkara,2).'</a>';
						}
					}
					?>
					</td>
				</tr>
			<?php
			}
			if($idalurperkara==118){
			?>
				<tr>
					<td id="first-child" style="vertical-align: top;"><?php echo $this->nativesession->getStatusPihak(10,$idalurperkara,2);?></td>
					<td colspan="2">
						
						<?php
						if($pihak_kedua!=''){
							if($pihak_kedua->num_rows>0){
						?>
								<div class="cssTable">
									<table id="tableinfo" style="margin:0px;padding:0px;">
										<col width="5%">
										<col width="30%">
										<col width="30%">
										<col width="17%">
										<col width="12%">
										<?php
										if($edit){
											echo '<col width="6%">';
										}
										?>
										<tbody>
											<tr>
												<td>No</td>
												<td>Nama</td>
												<td>Alamat</td>
												<td>Orang Tua/Wali</td>
												<td>Penahanan</td>
												<?php
												if($edit){
													echo '<td></td>';
												}
												?>
											</tr>
							<?php
									$i=1;
									foreach ($pihak_kedua->result() as $row) {
										echo "<tr>";
											echo "<td align='center'>".$i."</td>";
											echo "<td>".$row->nama."</td>";
											echo "<td>".$row->alamat."</td>";
											echo "<td>".$row->wali."</td>";
											
											if($edit==True || $editPenahanan){												
												echo '<td align="center" style="cursor:pointer;">';
													echo '<a href="'.base_url('detail_penahanan_dataumum/'.base64_encode($this->encrypt->encode($row->pihak_id)).'/'.$enc).'">[Penahanan]</a>';
												echo '</td>';
											}
											if($edit==True){
												$idpihak = base64_encode($this->encrypt->encode($row->pihak_id));
												$enc_id = base64_encode($this->encrypt->encode($row->id));
												$urutan = (empty($row->urutan))? 1:$row->urutan;
												echo '<td align="center" style="cursor:pointer;">';
													echo '<a href="#" onClick="popup_form(\''.base_url('add_pihak_kedua/'.$enc.'/edit/'.$idpihak).'/urt/'.$urutan.'/'.$enc_id.'\')">[Detil]</a>';
												echo '</td>';
											}
										echo "</tr>";
										$i++;

									}?>
										</tbody>
									</table>
								</div>
						<?php
							}
						}
					if($edit==True){
						echo '<a href="#" onClick="popup_form(\''.base_url("add_pihak_kedua/".$enc."/add").'\')" class="btn btn-default btn-sm">Tambah '.$this->nativesession->getStatusPihak(10,$idalurperkara,2).'</a>';
						echo '<a href="#" style="margin-left:3px" id="add_ortu" onClick="popup_form(\''.base_url("add_ortuwali/".$enc."/add").'\')" class="btn btn-default btn-sm">Tambah/Edit Orang Tua/Wali</a>';
					}
					?>
						
					</td>
				</tr>
			<?php
			}
			if(($idalurperkara!=114) and ($idalurperkara<>16)){
			?>
				<tr>
					<td id="first-child" style="vertical-align: top;"><?php echo $this->nativesession->getStatusPihak(10,$idalurperkara,8,$this->session->userdata('jenis_pengadilan'),$idjenisperkara);?>
					</td>
					<td colspan="2">
				       <?php
						if($pengacara_pihak_kedua!=''){
							if($pengacara_pihak_kedua->num_rows>0){
						?>
								<div class="cssTable">
									<table id="tableinfo" style="margin:0px;padding:0px;">
										<col width="5%">
										<col width="40%">
										<col width="49%">
										<?php
										if($edit){
											echo '<col width="6%">';
										}
										?>
										<tbody>
											<tr>
												<td>No</td>
												<td>Nama</td>
												<td>Alamat</td>
												<?php
												if($edit){
													echo '<td></td>';
												}
												?>
											</tr>
							<?php
									$i=1;
									foreach ($pengacara_pihak_kedua->result() as $row) {
										echo "<tr>";
											echo "<td align='center'>".$i."</td>";
											echo "<td>".$row->nama."</td>";
											echo "<td>".$row->alamat."</td>";
											
											if($edit==True){
												$idpihak = base64_encode($this->encrypt->encode($row->pengacara_id));
												$enc_id = base64_encode($this->encrypt->encode($row->id));
												$urutan = (empty($row->urutan))? 1:$row->urutan;
												echo '<td align="center" style="cursor:pointer;">';
													echo '<a href="#" onClick="popup_form(\''.base_url('add_pengacara_pihak_kedua/'.$enc.'/edit/'.$idpihak).'/urt/'.$urutan.'/'.$enc_id.'\')">[Detil]</a>';
												echo '</td>';
											}
											
										echo "</tr>";
										$i++;

									}?>
										</tbody>
									</table>
								</div>
							<?php
							}
						}
					if($edit==True){
						echo '<a href="#" onClick="popup_form(\''.base_url("add_pengacara_pihak_kedua/".$enc."/add").'\')" class="btn btn-default btn-sm"> '.$this->nativesession->getStatusPihak(10,$idalurperkara,8,$this->session->userdata('jenis_pengadilan'),$idjenisperkara).'</a>';
					}
					?>
						
					</td>
				</tr>
			<?php
			}
			if($idalurperkara==1 OR ($idalurperkara!=8 and $idalurperkara!=3 and $idalurperkara!=4 AND $idalurperkara>2 AND $idalurperkara<9) OR $idalurperkara==15){
				if($idjenisperkara!=346 AND $idjenisperkara!=347){
			?>
				<tr>
					<td id="first-child" style="vertical-align: top;"><?php echo $this->nativesession->getStatusPihak(10,$idalurperkara,4,$this->session->userdata('jenis_pengadilan'),$idjenisperkara);?></td>
					<td colspan="2">
						
						<?php
						if($pihak_keempat!=''){
							if($pihak_keempat->num_rows>0){
						?>
								<div class="cssTable">
									<table id="tableinfo" style="margin:0px;padding:0px;">
									<col width="5%">
									<col width="40%">
									<col width="49%">
									<?php
									if($edit){
										echo '<col width="6%">';
									}
									?>
										<tbody>
											<tr>
												<td>No</td>
												<td>Nama</td>
												<td>Alamat</td>
												<?php
												if($edit){
													echo '<td></td>';
												}
												?>
											</tr>
							<?php
									$i=1;
									foreach ($pihak_keempat->result() as $row) {
										echo "<tr>";
											echo "<td align='center'>".$i."</td>";
											echo "<td>".$row->nama."</td>";
											echo "<td>".$row->alamat."</td>";
											
											if($edit==True){
												$idpihak = base64_encode($this->encrypt->encode($row->pihak_id));
												$enc_id = base64_encode($this->encrypt->encode($row->id));
												$urutan = (empty($row->urutan))? 1:$row->urutan;
												echo '<td align="center" style="cursor:pointer;">';
													echo '<a href="#" onClick="popup_form(\''.base_url('add_pihak_keempat/'.$enc.'/edit/'.$idpihak).'/urt/'.$urutan.'/'.$enc_id.'\')">[Detil]</a>';
												echo '</td>';
											}
											
										echo "</tr>";
										$i++;

									}?>
										</tbody>
									</table>
								</div>
						<?php
							}
						}
					if($edit==True){
						echo '<a href="#" onClick="popup_form(\''.base_url("add_pihak_keempat/".$enc."/add").'\')" class="btn btn-default btn-sm">Tambah '.$this->nativesession->getStatusPihak(10,$idalurperkara,4,$this->session->userdata('jenis_pengadilan'),$idjenisperkara).'</a>';
					}
					?>
						
					</td>
				</tr>
			<?php }
			}
			?>
			<?php 
			if($idalurperkara==1 OR $idalurperkara==7 OR $idalurperkara==15){
				if($idjenisperkara!=346 AND $idjenisperkara!=347){
			?>
				<tr>
					<td id="first-child" style="vertical-align: top;"><?php echo $this->nativesession->getStatusPihak(10,$idalurperkara,10,$this->session->userdata('jenis_pengadilan'),$idjenisperkara);?></td>
					<td colspan="2">
						<?php
						if($pengacara_pihak_keempat!=''){
							if($pengacara_pihak_keempat->num_rows>0){?>
								<div class="cssTable">
									<table id="tableinfo" style="margin:0px;padding:0px;">
										<col width="5%">
										<col width="40%">
										<col width="49%">
										<?php
										if($edit){
											echo '<col width="6%">';
										}
										?>
										<tbody>
												<tr>
													<td>No</td>
													<td>Nama</td>
													<td>Alamat</td>
													<?php
													if($edit){
														echo '<td></td>';
													}
													?>
												</tr>
								<?php
										$i=1;
										foreach ($pengacara_pihak_keempat->result() as $row) {
											$pesan = '';
											if($row->aktif=='T'){
												$pesan = '(Tidak Aktif) ';
											}
											echo "<tr>";
												echo "<td align='center'>".$i."</td>";
												echo "<td>".$pesan.$row->nama."</td>";
												echo "<td>".$row->alamat."</td>";
												if($edit==True){
													$idpihak = base64_encode($this->encrypt->encode($row->pengacara_id));
													$enc_id = base64_encode($this->encrypt->encode($row->id));
													echo '<td align="center" style="cursor:pointer;">';
														echo '<a href="#" onClick="popup_form(\''.base_url('add_pengacara_pihak_keempat/'.$enc.'/edit/'.$idpihak).'/urt/'.$row->urutan.'/'.$enc_id.'\')">[Edit]</a>';
													echo '</td>';
												}
											echo "</tr>";
											$i++;

										}?>
											</tbody>
										</table>
								</div>
							<?php
							}
						}
						if($edit==True){
							echo '<a href="#" onClick="popup_form(\''.base_url("add_pengacara_pihak_keempat/".$enc."/add").'\')" class="btn btn-default btn-sm"> Tambah '.$this->nativesession->getStatusPihak(10,$idalurperkara,10,$this->session->userdata('jenis_pengadilan'),$idjenisperkara).'</a>';
						}
						?>						
					</td>
				</tr>
			<?php }
			}
			if($idalurperkara==118 OR $idalurperkara==111 OR $idalurperkara==112 OR $idalurperkara==113){?>
				<tr>
					<td id="first-child" style="vertical-align: top;">Anak Korban</td>
					<td colspan="2">
					<?php
						if($pihak_korban!=''){
							if($pihak_korban->num_rows>0){
					?>
								<div class="cssTable">
									<table id="tableinfo" style="margin:0px;padding:0px;">
										<col width="5%">
										<col width="25%">
										<col width="30%">
										<col width="30%">
										<?php
										if($edit){
											echo '<col width="10%">';
										}
										?>
										<tbody>
											<tr>
												<td>No</td>
												<td>Nama</td>
												<td>Alamat</td>
												<td>Orang Tua/Wali</td>
												<?php
												if($edit){
													echo '<td></td>';
												}
												?>
											</tr>
							<?php
									$i=1;
									foreach ($pihak_korban->result() as $row) {
										echo "<tr>";
											echo "<td align='center'>".$i."</td>";
											echo "<td>".$row->nama."</td>";
											echo "<td>".$row->alamat."</td>";
											echo "<td>".$row->wali."</td>";
											
											if($edit==True){
												$idpihak = base64_encode($this->encrypt->encode($row->pihak_id));
												$enc_id = base64_encode($this->encrypt->encode($row->id));
												$urutan = (empty($row->urutan))? 1:$row->urutan;
												echo '<td align="center" style="cursor:pointer;">';
													echo '<a href="#" onClick="popup_form(\''.base_url('add_anak_korban/'.$enc.'/edit/'.$idpihak).'/urt/'.$urutan.'/'.$enc_id.'\')">[Detil]</a>';
												echo '</td>';
											}
											
										echo "</tr>";
										$i++;

									}?>
										</tbody>
									</table>
								</div>
						<?php
							}
						}
					if($edit==True){
						echo '<a href="#" onClick="popup_form(\''.base_url("add_anak_korban/".$enc."/add").'\')" class="btn btn-default btn-sm">Tambah Anak Korban</a>';
						echo '<a href="#" style="margin-left:3px" id="add_ortu" onClick="popup_form(\''.base_url("add_ortuwalikorban/".$enc."/add").'\')" class="btn btn-default btn-sm">Tambah/Edit Orang Tua/Wali Anak Korban</a>';
					}
					?>
						
					</td>
				</tr>
			<?php
			}
			if($idalurperkara==8 OR $idalurperkara==1){ ?>
			<tr>
				<td id="first-child" style="vertical-align: top;">Nilai Sengketa(Rp)</td>
				<td colspan="2" class='wrapword'><?php echo $nilai_sengketa;?></td>
			</tr>
			<?php 
			} ?>
			<tr>
				<td id="first-child" style="vertical-align: top;">Pihak Dipublikasikan</td>
				<td colspan="2"><?php echo $isPublish;?></td>
			</tr>
			<?php if($idalurperkara<100){?>
			<tr>
				<td id="first-child" style="vertical-align: top;">Posita</td>
				<td colspan="2" class='wrapword'><?php echo ($idalurperkara<100)? $posita:"-";?></td>
			</tr>			
			<?php } ?>
			<?php
			if($idalurperkara==9)
				$jenis_doc = 'Gugatan';
			elseif($idalurperkara<100 AND $idalurperkara!=10 AND $idalurperkara!=11)
				$jenis_doc = 'Petitum';
			elseif($idalurperkara==119 OR $idalurperkara==123 OR $idalurperkara==10 OR $idalurperkara==11)
				$jenis_doc = 'Petitum Permohonan';
			else
				$jenis_doc = 'Dakwaan';
			?>
			<tr>
				<td id="first-child" style="vertical-align: top;"><?php echo $jenis_doc;?></td>
				<td colspan="2" class='wrapword'><?php echo ($idalurperkara<100)? $petitum:$dakwaan;?></td>
			</tr>
			<?php 
			if($idalurperkara>=111 AND $idalurperkara<=118 AND $idalurperkara!=114){
				echo '<tr>';
					echo '<td id="first-child" style="vertical-align: top;">Pasal Dakwaan</td>';
					echo '<td colspan="2" class="wrapword">'.$pasal_dakwaan.'</td>';
				echo '</tr>';
			}?>
			<tr>
				<td id="first-child" style="vertical-align: top;">E-Doc <?php echo $jenis_doc;?></td>
				<td>
				<?php
				if($idalurperkara<100){
					$jenisdok=$petitum_dok;
				} else {
					$jenisdok=$dakwaan_dok; 	
				}
				$jumslash=substr_count($jenisdok,"/");
				if(!empty($jenisdok) && $jumslash!=5){
					$info_tgl_daftar=explode('-', $tglPendaftaran);
					$thn=$info_tgl_daftar[0];
					$bln=$info_tgl_daftar[1];
					$prefix='resources/file/doc/'.$thn.'/'.$bln.'/'.$jenisdok;
					$baseurl=$prefix;
				}else{
					$baseurl=$jenisdok;
				}
				if (($baseurl) and (file_exists($baseurl))){
						echo "<a id='noLoading' target='_self' href='$baseurl'>Unduh Dokumen</a>";
					}else{
						echo "<span style='color:red;font-weight:bold'>Dokumen Belum Ada</span>";
					}
				?>
				</td>
				<td style="text-align:right;">
				<?php
				if ($this->authorization->HasRuleEditPendaftaran($idalurperkara, $perkaraid)){
					if ($idalurperkara<100){$from="datumpdt";}else{$from="datum";}
					echo '<a href="#" style="color:white" onClick="popup_form(\''.base_url("fileupload/".$enc."/".$from).'\')" class="btn btn-warning btn-sm"><i class="fa fa-file-word-o"></i> Unggah E-Doc</a>';
				}
				?>				
				</td>
			</tr>
			<?php
			if($idalurperkara<100){ 
			?>
				<tr>
					<td id="first-child" style="vertical-align: top;">Prodeo</td>
					<td colspan="2"><?php echo $prodeo;?></td>
				</tr>
			<?php
			}?>
			<input type="hidden" id="refresh" class='detil_perkara_refresh' value="0">
		</tbody>
	</table>
</div>
<script type="text/javascript">
$("#refresh").change(function(){
	if($(this).val()==1){
		var urlRefresh = $('#refresh_dest').val();
		window.open(urlRefresh,'_self')
	}
});


function refreshOrtuList(jenis_pihak){
	$("#popup_form").remove();
	if(jenis_pihak==0){
		popup_form('<?php echo base_url("add_ortuwali/".$enc."/add");?>')
	}else if(jenis_pihak==1){
		popup_form('<?php echo base_url("add_ortuwalikorban/".$enc."/add");?>')
	}
}

function backed(){
	$("#popup_form").remove();
	$('#usual2 .selected').click();
	$("body").css({ overflow: 'inherit' })
}

function pilih_cetak(ele){
	if (ele.value!=1) {
		popup_form(ele.value);
		$(ele).val('1');
	}
}

$('#cetakResume').click(function(){
	var enc = $('#enc').val();
	window.open("<?php echo base_url()?>c_template_tun_resume/cetakResume/"+enc);
});

$('#cetakSurat').click(function(){	
	popup_form('<?php echo base_url("c_template_tun_perlawanan/popup_pilihan_panitera/".$enc."/1782");?>'); 
});

$('#donlot').click(function(){	
	closeLoading();
});
<?php 
if ($idalurperkara==15 && ($idjenisperkara==346 OR $idjenisperkara==347)){
?>
if ( $( "div[name=table_pihak1]" ).length ) {
	if($('.table_pihak1 tr').length>1){
		$('#span_ijin_cerai_pihak1').show();
	}else{
		$('#span_ijin_cerai_pihak1').hide();
	}
}else{
	$('#span_ijin_cerai_pihak1').hide();
}
if ( $( "div[name=table_pihak2]" ).length ) {
	if($('.table_pihak2 tr').length>1){
		$('#span_ijin_cerai_pihak2').show();
	}else{
		$('#span_ijin_cerai_pihak2').hide();
	}
}else{
	$('#span_ijin_cerai_pihak2').hide();
}

$('#ijin_cerai_pihak1').click(function(){	
	if ($(this).attr('checked')){
		$('.ijin_cerai_pihak1').show();
	}else{
		$('.ijin_cerai_pihak1').hide();
	}
});
$('#ijin_cerai_pihak2').click(function(){	
	if ($(this).attr('checked')){
		$('.ijin_cerai_pihak2').show();
	}else{
		$('.ijin_cerai_pihak2').hide();
	}
});
<?php
	if ($adaizinpihakpertama!=''){
		echo "$('.ijin_cerai_pihak1').show();";
		echo "$('#ijin_cerai_pihak1').prop('checked',true);";
		echo "$('#ijin_cerai_pihak1').prop('disabled',true);";
	}
	if($adaizinpihakkedua!=''){
		echo "$('.ijin_cerai_pihak2').show();";
		echo "$('#ijin_cerai_pihak2').prop('checked',true);";
		echo "$('#ijin_cerai_pihak2').prop('disabled',true);";
	}
}
?>
</script>