<div style="margin-left:8px;margin-top:20px;padding:0px 5px 8px 10px;border:2px solid #008C4B;">
<br>
<div>
<div style="float:left">
<a class="btn btn-warning btn-sm"  href="<?php echo $main_history;?>">Kembali</a>
|<a class="btn btn-info btn-sm"  href="<?php echo base_url('new_diversi/'.$enc_diversi_id.'/'.base64_encode($this->encrypt->encode('edit')));?>">Edit Data Diversi</a>
</div>
<div style="float:right"><?php echo '<a class="btn btn-danger btn-sm" href="#" onClick="popup_form(\''.base_url('add_register_diversi/popup_hapus_register/'.$enc_diversi_id).'\')"> Hapus </a>';?></div>
</div>
<br><br>			
<div style="font-size:14px;">
	<table id='infoPerkara' style="font-size:14px;width:100%" border="0">
		<col width="20%">
		<col width="">
		<col width="100px">
		<tbody>
			<tr>
				<td id="first-child">Nomor Urut</td>
				<td colspan="2"><?php echo $no_urut;?></td>
			</tr>
			<tr>
				<td id="first-child">Tanggal Permohonan Diversi </td>
				<td colspan="2"><?php echo $this->tanggalhelper->convertDayDate($tgl_diterima_permohonan);?></td>
			</tr>
			<tr>
				<td id="first-child">No. Diversi</td>
				<td colspan="2"><?php if($pemohon_diversi==3){echo $no_diversi."<br> jo ".$no_perkara;}else{echo $no_diversi;};?></td>
			</tr>
			<tr>
				<td id="first-child">Pasal Sangkaan / Dakwaan </td>
				<td colspan="2"><?php echo $pasal_sangkaan_dakwaan;?></td>
			</tr>

			<?php if($pemohon_diversi==1 || $pemohon_diversi==2){?>
			<tr>
				<td id="first-child">No. Berita Acara</td>
				<td colspan="2"><?php echo $no_berita_acara;?></td>
			</tr>
			<tr>
				<td id="first-child">Tanggal Berita Acara </td>
				<td colspan="2"><?php echo $this->tanggalhelper->convertDayDate($tgl_berita_acara);?></td>
			</tr>
			<?php }else{ ?>
			<tr>
				<td id="first-child">No. Berita Acara</td>
				<td colspan="2"><?php echo $no_berita_acara;?></td>
			</tr>
			<tr>
				<td id="first-child">Tanggal Berita Acara </td>
				<td colspan="2"><?php echo $this->tanggalhelper->convertDayDate($tgl_berita_acara);?></td>
			</tr>
			<?php } ?>			
			<tr>
				<td id="first-child">Pemohon Diversi</td>
				<td colspan="2"><?php 
				if($pemohon_diversi==1){
					$pemohondiversi = 'Penyidik';
				}else if($pemohon_diversi==2){
					$pemohondiversi = 'Penuntut';
				}else{
					$pemohondiversi = 'Hakim';
				}
				echo $pemohondiversi;?></td>
			</tr>
			<tr>
				<td id="first-child">Nomor Register <?php echo $pemohondiversi;?></td>
				<td colspan="2"><?php 
				if($pemohon_diversi==1){
					$noreg = $no_reg_penyidik;
				}else if($pemohon_diversi==2){
					$noreg = $no_reg_penuntut;
				}else{
					$noreg = $no_perkara;
				}
				echo $noreg;?></td>
			</tr>

			<?php if($pemohon_diversi==1 || $pemohon_diversi==2){?>
			<tr>
				<td id="first-child" style="vertical-align: top;">Penyidik</td>
				<td colspan="2">				
						<?php
						if($pihak_penyidik!=''){
							if($pihak_penyidik->num_rows()>0){
						?>
								<div class="cssTable">
									<table id="tableinfo" style="margin:0px;padding:0px;">
										<col width="5%">
										<col width="20%">
										<col width="40%">
										<col width="6%">
										<tbody>
											<tr>
												<td>No</td>
												<td>Nama</td>
												<td>Alamat</td>
												<td></td>
											</tr>
							<?php
									$i=1;
									foreach ($pihak_penyidik->result() as $row) {
										echo "<tr>";
											echo "<td align='center'>".$i."</td>";
											echo "<td>".$row->nama_penyidik."</td>";
											echo "<td>".$row->alamat_penyidik."</td>";
											
												$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_penyidik_diversi/'.$enc_diversi_id.'/edit/'.$idpihak).'/urt/'.$urutan.'/'.$enc_id.'\')">[Edit]</a>';
												echo '</td>';
										echo "</tr>";
										$i++;

									}?>
										</tbody>
									</table>
								</div>
						<?php
							}
						}?>
						[<a href="#" onClick="popup_form('<?php echo base_url("add_pihak_penyidik_diversi/".$enc_diversi_id."/add");?>')">Tambah Penyidik</a>]
			</tr>
			<?php } ;?>
			<?php if($pemohon_diversi==1 || $pemohon_diversi==2){?>
			<tr>
				<td id="first-child" style="vertical-align: top;">Pembimbing Kemasyarakatan Bapas</td>
				<td colspan="2">				
						<?php
						if($pihak_pkbapas!=''){
							if($pihak_pkbapas->num_rows()>0){
						?>
								<div class="cssTable">
									<table id="tableinfo" style="margin:0px;padding:0px;">
										<col width="5%">
										<col width="20%">
										<col width="40%">
										<col width="6%">
										<tbody>
											<tr>
												<td>No</td>
												<td>Nama</td>
												<td>Alamat</td>
												<td></td>
											</tr>
							<?php
									$i=1;
									foreach ($pihak_pkbapas->result() as $row) {
										echo "<tr>";
											echo "<td align='center'>".$i."</td>";
											echo "<td>".$row->nama_pkbapas."</td>";
											echo "<td>".$row->alamat_pkbapas."</td>";
											
												$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_pkbapas_diversi/'.$enc_diversi_id.'/edit/'.$idpihak).'/urt/'.$urutan.'/'.$enc_id.'\')">[Edit]</a>';
												echo '</td>';
										echo "</tr>";
										$i++;

									}?>
										</tbody>
									</table>
								</div>
						<?php
							}
						}?>
						[<a href="#" onClick="popup_form('<?php echo base_url("add_pihak_pkbapas_diversi/".$enc_diversi_id."/add");?>')">Tambah PK Bapas</a>]
			</tr>	
			<?php }else{ ?>
			<tr>
				<td id="first-child" style="vertical-align: top;">Pembimbing Kemasyarakatan Bapas</td>
				<td colspan="2">				
						<?php
						if($pihak_pkbapas_hakim!=''){
							if($pihak_pkbapas_hakim->num_rows()>0){
						?>
								<div class="cssTable">
									<table id="tableinfo" style="margin:0px;padding:0px;">
										<col width="5%">
										<col width="20%">
										<col width="40%">
										<col width="6%">
										<tbody>
											<tr>
												<td>No</td>
												<td>Nama</td>
												<td>Alamat</td>
												<td></td>
											</tr>
							<?php
									$i=1;
									foreach ($pihak_pkbapas_hakim->result() as $row) {
										echo "<tr>";
											echo "<td align='center'>".$i."</td>";
											echo "<td>".$row->nama_pkbapas."</td>";
											echo "<td>".$row->alamat_pkbapas."</td>";
											
												$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 '</td>';
										echo "</tr>";
										$i++;

									}?>
										</tbody>
									</table>
								</div>
						<?php
							}
						}?>
			</tr>			
			<?php }?>
			<?php if($pemohon_diversi==1 || $pemohon_diversi==2){?>
			<tr>
				<td id="first-child" style="vertical-align: top;">Penuntut</td>
				<td colspan="2">				
						<?php
						if($pihak_penuntut!=''){
							if($pihak_penuntut->num_rows()>0){
						?>
								<div class="cssTable">
									<table id="tableinfo" style="margin:0px;padding:0px;">
										<col width="5%">
										<col width="20%">
										<col width="40%">
										<col width="6%">
										<tbody>
											<tr>
												<td>No</td>
												<td>Nama</td>
												<td>Alamat</td>
												<td></td>
											</tr>
							<?php
									$i=1;
									foreach ($pihak_penuntut->result() as $row) {
										echo "<tr>";
											echo "<td align='center'>".$i."</td>";
											echo "<td>".$row->nama_penuntut."</td>";
											echo "<td>".$row->alamat_penuntut."</td>";
											
												$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_penuntut_diversi/'.$enc_diversi_id.'/edit/'.$idpihak).'/urt/'.$urutan.'/'.$enc_id.'\')">[Edit]</a>';
												echo '</td>';
										echo "</tr>";
										$i++;

									}?>
										</tbody>
									</table>
								</div>
						<?php
							}
						}?>
						[<a href="#" onClick="popup_form('<?php echo base_url("add_pihak_penuntut_diversi/".$enc_diversi_id."/add");?>')">Tambah Penuntut</a>]
			</tr>
			<?php }else{ ?>
			<tr>
				<td id="first-child" style="vertical-align: top;">Penuntut</td>
				<td colspan="2">				
						<?php
						if($pihak_penuntut_hakim!=''){
							if($pihak_penuntut_hakim->num_rows()>0){
						?>
								<div class="cssTable">
									<table id="tableinfo" style="margin:0px;padding:0px;">
										<col width="5%">
										<col width="20%">
										<col width="40%">
										<col width="6%">
										<tbody>
											<tr>
												<td>No</td>
												<td>Nama</td>
												<td>Alamat</td>
												<td></td>
											</tr>
							<?php
									$i=1;
									foreach ($pihak_penuntut_hakim->result() as $row) {
										echo "<tr>";
											echo "<td align='center'>".$i."</td>";
											echo "<td>".$row->nama_penuntut."</td>";
											echo "<td>".$row->alamat_penuntut."</td>";
											
												$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 '</td>';
										echo "</tr>";
										$i++;

									}?>
										</tbody>
									</table>
								</div>
						<?php
							}
						}?>
						
			</tr>

			<?php }?>
			<?php if($pemohon_diversi==1 || $pemohon_diversi==2){?>									
			<tr>
				<td id="first-child" style="vertical-align: top;">Anak Berhadapan dengan Hukum</td>
				<td colspan="2">				
						<?php
						if($pihak_anak!=''){
							if($pihak_anak->num_rows()>0){
						?>
								<div class="cssTable">
									<table id="tableinfo" style="margin:0px;padding:0px;">
										<col width="5%">
										<col width="20%">
										<col width="40%">
										<col width="12%">
										<col width="6%">
										<tbody>
											<tr>
												<td>No</td>
												<td>Nama</td>
												<td>Alamat</td>
												<td>Orang Tua/Wali</td>
												<td></td>
											</tr>
							<?php
									$i=1;
									foreach ($pihak_anak->result() as $row) {
										echo "<tr>";
											echo "<td align='center'>".$i."</td>";
											echo "<td>".$row->nama_anak."</td>";
											echo "<td>".$row->alamat_anak."</td>";
											echo "<td>".$row->orang_tua."</td>";
											
												$idpihak = base64_encode($this->encrypt->encode($row->pihak_anak));
												$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_anak_diversi/'.$enc_diversi_id.'/edit/'.$idpihak).'/urt/'.$urutan.'/'.$enc_id.'\')">[Edit]</a>';
												echo '</td>';
										echo "</tr>";
										$i++;

									}?>
										</tbody>
									</table>
								</div>
						<?php
							}
						}?>
						[<a href="#" onClick="popup_form('<?php echo base_url("add_pihak_anak_diversi/".$enc_diversi_id."/add");?>')">Tambah Anak</a>]
						[<a href="#" id='add_ortu' onClick="popup_form('<?php echo base_url("add_ortuwali_anak_diversi/".$enc_diversi_id."/add");?>')">Tambah/Edit Orang Tua/Wali</a>]
			</tr>
			<?php }else{ ?>
			<tr>
				<td id="first-child" style="vertical-align: top;">Anak Berhadapan dengan Hukum</td>
				<td colspan="2">				
						<?php
						if($pihak_anak_hakim!=''){
							if($pihak_anak_hakim->num_rows()>0){
						?>
								<div class="cssTable">
									<table id="tableinfo" style="margin:0px;padding:0px;">
										<col width="5%">
										<col width="20%">
										<col width="40%">
										<col width="12%">
										<col width="6%">
										<tbody>
											<tr>
												<td>No</td>
												<td>Nama</td>
												<td>Alamat</td>
												<td>Orang Tua/Wali</td>
												<td></td>
											</tr>
							<?php
									$i=1;
									foreach ($pihak_anak_hakim->result() as $row) {
										echo "<tr>";
											echo "<td align='center'>".$i."</td>";
											echo "<td>".$row->nama_anak."</td>";
											echo "<td>".$row->alamat_anak."</td>";
											echo "<td>".$row->orang_tua."</td>";
											
												$idpihak = base64_encode($this->encrypt->encode($row->pihak_anak));
												$enc_id = base64_encode($this->encrypt->encode($row->id));
												$urutan = (empty($row->urutan))? 1:$row->urutan;
												echo '<td align="center" style="cursor:pointer;">';
												
												echo '</td>';
										echo "</tr>";
										$i++;

									}?>
										</tbody>
									</table>
								</div>
						<?php
							}
						}?>
			</tr>

			<?php }?>
			<?php if($pemohon_diversi==1 || $pemohon_diversi==2){?>										
			<tr>
				<td id="first-child" style="vertical-align: top;">Penasihat Hukum</td>
				<td colspan="2">				
						<?php
						if($pihak_penasihat_hukum!=''){
							if($pihak_penasihat_hukum->num_rows()>0){
						?>
								<div class="cssTable">
									<table id="tableinfo" style="margin:0px;padding:0px;">
										<col width="5%">
										<col width="20%">
										<col width="40%">
										<col width="20%">
										<col width="5%">
										<tbody>
											<tr>
												<td>No</td>
												<td>Nama</td>
												<td>Alamat</td>
												<td>Penasihat Hukum dari</td>
												<td></td>
											</tr>
							<?php
									$i=1;
									foreach ($pihak_penasihat_hukum->result() as $row) {
										echo "<tr>";
											echo "<td align='center'>".$i."</td>";
											echo "<td>".$row->nama_pengacara."</td>";
											echo "<td>".$row->alamat_pengacara."</td>";
											echo "<td>".$row->nama_anak."</td>";
											
												$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_diversi/'.$enc_diversi_id.'/edit/'.$idpihak).'/urt/'.$urutan.'/'.$enc_id.'\')">[Edit]</a>';
												echo '</td>';
										echo "</tr>";
										$i++;

									}?>
										</tbody>
									</table>
								</div>
						<?php
							}
						}?>
						[<a href="#" onClick="popup_form('<?php echo base_url("add_pengacara_pihak_diversi/".$enc_diversi_id."/add");?>')">Tambah Penasihat Hukum</a>]
			</tr>	
			<?php }else{ ?>
			<tr>
				<td id="first-child" style="vertical-align: top;">Penasihat Hukum</td>
				<td colspan="2">				
						<?php
						if($pihak_penasihat_hukum_hakim!=''){
							if($pihak_penasihat_hukum_hakim->num_rows()>0){
						?>
								<div class="cssTable">
									<table id="tableinfo" style="margin:0px;padding:0px;">
										<col width="5%">
										<col width="20%">
										<col width="40%">
										<col width="20%">
										<col width="5%">
										<tbody>
											<tr>
												<td>No</td>
												<td>Nama</td>
												<td>Alamat</td>
												<td>Penasihat Hukum dari</td>
												<td></td>
											</tr>
							<?php
									$i=1;
									foreach ($pihak_penasihat_hukum_hakim->result() as $row) {
										echo "<tr>";
											echo "<td align='center'>".$i."</td>";
											echo "<td>".$row->nama_pengacara."</td>";
											echo "<td>".$row->alamat_pengacara."</td>";
											echo "<td>".$row->nama_anak."</td>";
											
												$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 '</td>';
										echo "</tr>";
										$i++;

									}?>
										</tbody>
									</table>
								</div>
						<?php
							}
						}?>

			</tr>				
			<?php }?>
			<?php if($pemohon_diversi==1 || $pemohon_diversi==2){?>							
			<tr>
				<td id="first-child" style="vertical-align: top;">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="20%">
										<col width="40%">
										<col width="12%">
										<col width="6%">
										<tbody>
											<tr>
												<td>No</td>
												<td>Nama</td>
												<td>Alamat</td>
												<td>Orang Tua/Wali</td>
												<td></td>
											</tr>
							<?php
									$i=1;
									foreach ($pihak_korban->result() as $row) {
										echo "<tr>";
											echo "<td align='center'>".$i."</td>";
											echo "<td>".$row->nama_anak."</td>";
											echo "<td>".$row->alamat_anak."</td>";
											echo "<td>".$row->orang_tua."</td>";
											
												$idpihak = base64_encode($this->encrypt->encode($row->pihak_anak));
												$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_korban_diversi/'.$enc_diversi_id.'/edit/'.$idpihak).'/urt/'.$urutan.'/'.$enc_id.'\')">[Edit]</a>';
												echo '</td>';
										echo "</tr>";
										$i++;

									}?>
										</tbody>
									</table>
								</div>
						<?php
							}
						}?>
						[<a href="#" onClick="popup_form('<?php echo base_url("add_pihak_korban_diversi/".$enc_diversi_id."/add");?>')">Tambah Anak Korban</a>]
						[<a href="#" id='add_ortu' onClick="popup_form('<?php echo base_url("add_ortuwalikorban_anak_diversi/".$enc_diversi_id."/add");?>')">Tambah/Edit Orang Tua/Wali</a>]
			</tr>	
			<?php }else{ ?>
			<tr>
				<td id="first-child" style="vertical-align: top;">Korban</td>
				<td colspan="2">				
						<?php
						if($pihak_korban_hakim!=''){
							if($pihak_korban_hakim->num_rows()>0){
						?>
								<div class="cssTable">
									<table id="tableinfo" style="margin:0px;padding:0px;">
										<col width="5%">
										<col width="20%">
										<col width="40%">
										<col width="12%">
										<col width="6%">
										<tbody>
											<tr>
												<td>No</td>
												<td>Nama</td>
												<td>Alamat</td>
												<td>Orang Tua/Wali</td>
												<td></td>
											</tr>
							<?php
									$i=1;
									foreach ($pihak_korban_hakim->result() as $row) {
										echo "<tr>";
											echo "<td align='center'>".$i."</td>";
											echo "<td>".$row->nama_anak."</td>";
											echo "<td>".$row->alamat_anak."</td>";
											echo "<td>".$row->orang_tua."</td>";
											
												$idpihak = base64_encode($this->encrypt->encode($row->pihak_anak));
												$enc_id = base64_encode($this->encrypt->encode($row->id));
												$urutan = (empty($row->urutan))? 1:$row->urutan;
												echo '<td align="center" style="cursor:pointer;">';
													
												echo '</td>';
										echo "</tr>";
										$i++;

									}?>
										</tbody>
									</table>
								</div>
						<?php
							}
						}?>
			</tr>
			<?php } ?>
			<tr>
				<td id="first-child">Tanggal Kesepakatan Diversi </td>
				<td colspan="2"><?php echo $this->tanggalhelper->convertDayDate($tgl_kesepakatan_diversi);?></td>
			</tr>
			<tr>
				<td id="first-child">Isi Kesepakatan Diversi </td>
				<td colspan="2"><?php echo $isi_kesepakatan_diversi;?></td>
			</tr>
			<tr>
				<td id="first-child">Tanggal Penetapan KPN</td>
				<td colspan="2"><?php echo $this->tanggalhelper->convertDayDate($tanggal_penetapan_kpn);?></td>
			</tr>
			<tr>
				<td id="first-child">Tanggal Pengiriman Penetapan KPN</td>
				<td colspan="2"><?php echo $this->tanggalhelper->convertDayDate($tgl_pengiriman_penetapan_kpn);?></td>
			</tr>
			<tr>
				<td id="first-child">Amar</td>
				<td colspan="2"><?php echo $amar;?></td>
			</tr>
			<tr>
				<td id="first-child">Tanggal Pengiriman Penetapan KPN</td>
				<td colspan="2"><?php echo $this->tanggalhelper->convertDayDate($tgl_pelaksanaan_isi_diversi);?></td>
			</tr>


			<input type="hidden" id="refresh" class='detil_perkara_refresh' value="0">
		</tbody>
	</table>
</div>
</div></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_anak_diversi/".$enc_diversi_id."/add");?>')
	}else if(jenis_pihak==1){
		popup_form('<?php echo base_url("add_ortuwalikorban_anak_diversi/".$enc_diversi_id."/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>