<div style="font-size:14px;margin:0px;border:0px;">
    <?php
    $idalurperkara = $this->tanggalhelper->getIDAlurPerkara($this->encrypt->decode(base64_decode($enc)));    
    ?>
    <div style="padding:3px;"></div>
    <table id='infoPerkara' style="font-size:14px;width:100%;">
        <col width="20%">
        <col width="">
        <col width="200%">
        <tbody>
            <tr>
                <td class="divider" colspan="3">Data Akta Cerai</td>
            </tr>
        </tbody>
    </table>
	<table id="infoPerkara" style="font-size:14px;width:100%;">
		<col width="15%">
		<col width="50%">
		<col width="200px">
        <tbody>
            <tr>
                <td id="first-child">Nomor Akta Cerai</td>
                <td colspan=3"><strong><label><?php echo $enc_ac;?></label></strong></td>
               <?php if($this->session->userdata('idgroup')==1 OR $this->session->userdata('idgroup')==10 OR $this->session->userdata('idgroup')==410 OR $this->session->userdata('idgroup')==414 OR $this->session->userdata('idgroup')==1003 OR $this->session->userdata('idgroup')==1013){ ?>
				<td align="right">[<a style="color:#259FD3;text-decoration: none;" href="#" onClick="popup_form('<?php echo base_url('edit_ikrar_talak_akta_cerai/'.$enc);?>')">Tambah/Edit Data Akta Cerai</a>]</br>         
                </td>
            <?php } ?>
            </tr>
            <tr>
                <td id="first-child">Tanggal Akta Cerai</td>
                <td colspan="2"><span><?php echo $this->tanggalhelper->convertDayDate($tanggal_akta_cerai);?></span></td>
            </tr>
            <tr>
                <td id="first-child">Nomor Seri Akta Cerai</td>
                <td colspan="2"><label><?php echo $no_seri_akta_cerai;?></label></td>
            </tr>
            <tr>
                <td id="first-child">Jenis Cerai</td>
                <td colspan="2"><label><?php echo $status_penetapan;?></label>
               </td>
            </tr>
            <tr>
                <td id="first-child">Faktor Perceraian</td>
                <td colspan="2"><label><?php echo $faktor_penyebab;?></label></td>
            </tr>
            <tr>
                <td id="first-child">Qobla/Ba'da</td>
                <td colspan="2"><label><?php echo $qobla;?></label></td>
            </tr>
            <tr>
                <td id="first-child">Keadaan Istri</td>
                <td colspan="2"><label><?php echo (!empty($keadaan_istri)?$keadaan_istri:'');?></label></td>                
            </tr>
            <tr>
                <td id="first-child">Perceraian Ke</td>
                <td colspan="2"><label><?php echo $perceraian_ke;?></label></td>
            </tr>
            
            <?php if($this->session->userdata('idgroup')==1 OR $this->session->userdata('idgroup')==10 OR $this->session->userdata('idgroup')==410 OR $this->session->userdata('idgroup')==414 OR $this->session->userdata('idgroup')==1003 OR $this->session->userdata('idgroup')==1013){ ?>
            <tr>
                <td id="first-child">Template Dokumen</td>
                <td colspan="3">
                    <span class="custom-dropdown custom-dropdown--emerald">
                        <select id="blangko" style="width:150px;z-index:99999" class="custom-dropdown__select custom-dropdown__select--white">
                            <option value="1" <?php echo ($blangko==1?'selected':'');?>>Blangko Baru</option>
                            <option value="0" <?php echo ($blangko==0?'selected':'');?>>Blangko Lama</option>
                        </select>
                    </span>
                    <a href="#" onClick="cetak_akta_cerai();"><span style="color:red;"><img height="30px"src="<?php echo base_url();?>resources/img/nm_icon_doc.gif"></span></a>
                </td>
            </tr>
            <?php }?>
            <tr>
                <td id="first-child">E-Doc Akta Cerai</td>
                <td colspan=3">
                <?php
                $baseurl=$akta_cerai_dok;
                if(($baseurl) and (file_exists($baseurl))) {
                    echo "<a target='_new' href=$baseurl>Unduh Dokumen</a>";
                } else {
                    echo "<span style='color:red;font-weight:bold'>Dokumen Belum Ada</span>";
                }
                ?>
                </td>
                <?php if($this->session->userdata('idgroup')==1 OR $this->session->userdata('idgroup')==10 OR $this->session->userdata('idgroup')==410 OR $this->session->userdata('idgroup')==414 OR $this->session->userdata('idgroup')==1003 OR $this->session->userdata('idgroup')==1013){ ?>
                <td align="right">
                    [ <a href="#" onClick="popup_form('<?php echo base_url("fileupload/".$enc."/aktacerai");?>')">Edit E-Doc</a> ]
                </td>
                <?php } ?>
            </tr>
			<tr>
                <td id="first-child">Dokumen Tanda Terima Akta Cerai </td>
                <td colspan="2"><span> <a href="#" onClick="cetak_akta_cerai_tandaterima();"><span style="color:red;"><img src="<?php echo base_url();?>resources/img/nm_icon_doc.gif"></span></a></span></a></span></td>
            </tr>
			<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="4">
				<?php
				if($tgl_penyerahan_akta_cerai!==null){ ?>
					[<a style="color:#259FD3;text-decoration: none;" href="#" onClick="popup_form('<?php echo base_url('tab_ikrar_akta_cerai_c/edit_tanda_terima_akta_cerai/'.$enc.'/1');?>')">Edit Tanggal Terima Akta Cerai <?php echo $this->nativesession->getStatusPihak(10,$idalurperkara,1,$this->session->userdata('jenis_pengadilan'),$idjenisperkara);?></a>]
				<?php }else{ ?>
					[<a style="color:#259FD3;text-decoration: none;" href="#" onClick="popup_form('<?php echo base_url('tab_ikrar_akta_cerai_c/edit_tanda_terima_akta_cerai/'.$enc.'/1');?>')">Tambah Tanggal Terima Akta Cerai <?php echo $this->nativesession->getStatusPihak(10,$idalurperkara,1,$this->session->userdata('jenis_pengadilan'),$idjenisperkara);?></a>]
				
				<?php } ?>
				<div name="table_pihak1" class="cssTable">
							<table id="tableinfo" class="table_pihak1" style="margin:0px;padding:0px;">
								<col width="5%">
								<col width="35%">
								<col width="45%">
								<?php
								if($tgl_penyerahan_akta_cerai!==null){
									echo '<col width="15%">';
								}
								?>
								<tbody>
									<tr>
										<td>No</td>
										<td>Nama</td>
										<td>Alamat</td>
										<td>Tanggal Penyerahan</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($tgl_penyerahan_akta_cerai!==null){
											echo '<td align="center" style="cursor:pointer;">';
												echo $tgl_penyerahan_akta_cerai;
											echo "</td>";
										}else{
											echo '<td align="center" style="cursor:pointer;">';
												echo "Belum Diambil";
											echo "</td>";
										}
									echo "</tr>";
									$i++;
								}?>
								</tbody>
							</table>
						</div>
				</td>
            </tr>
			<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="4">
				<?php
				if($tgl_penyerahan_akta_cerai_pihak2!==null){ ?>
					[<a style="color:#259FD3;text-decoration: none;" href="#" onClick="popup_form('<?php echo base_url('tab_ikrar_akta_cerai_c/edit_tanda_terima_akta_cerai/'.$enc.'/2');?>')">Edit Tanggal Terima Akta Cerai <?php echo $this->nativesession->getStatusPihak(10,$idalurperkara,2,$this->session->userdata('jenis_pengadilan'),$idjenisperkara);?></a>]
				<?php }else{ ?>
					[<a style="color:#259FD3;text-decoration: none;" href="#" onClick="popup_form('<?php echo base_url('tab_ikrar_akta_cerai_c/edit_tanda_terima_akta_cerai/'.$enc.'/2');?>')">Tambah Tanggal Terima Akta Cerai <?php echo $this->nativesession->getStatusPihak(10,$idalurperkara,2,$this->session->userdata('jenis_pengadilan'),$idjenisperkara);?></a>]
				
				<?php } ?>
				<div name="table_pihak2" class="cssTable">
								<table class="table_pihak2" id="tableinfo" style="margin:0px;padding:0px;">
									<col width="5%">
									<col width="35%">
									<col width="45%">
									<?php
									if($tgl_penyerahan_akta_cerai_pihak2!==null){
										echo '<col width="15%">';
									}
									?>
									<tbody>
										<tr>
											<td>No</td>
											<td>Nama</td>
											<td>Alamat</td>
											<td>Tanggal Penyerahan</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($tgl_penyerahan_akta_cerai_pihak2!==null){
											echo '<td align="center" style="cursor:pointer;">';
												echo $tgl_penyerahan_akta_cerai_pihak2;
											echo "</td>";
										}else{
											echo '<td align="center" style="cursor:pointer;">';
												echo "Belum Diambil";
											echo "</td>";
										}
									echo "</tr>";
									$i++;

								}?>
									</tbody>
								</table>
						</div>
				</td>
            </tr>
        </tbody>
    </table>
</div>
<script type="text/javascript">
    closeLoading();
    function cetak_akta_cerai(){
        var blangko = $("#blangko").val();
        window.open('<?php echo base_url("c_template_akta_cerai_agama/cetak_akta_cerai/".$enc);?>'+'/'+blangko,'_self');
    }
	function cetak_akta_cerai_tandaterima(){
        window.open('<?php echo base_url("c_template_tanda_terima_akta_cerai_agama/cetak_akta_cerai/".$enc);?>','_self');
    }
</script>

