<?php
	$canEditDataPK = $this->authorization->HasRuleEditDataPK($alur_perkara_id, $perkaraid);
	$canEditDataPutusanPK = $this->authorization->HasRuleEditDataPutusanPK($alur_perkara_id, $perkaraid);
	$canCetakDokumen = $this->authorization->HasRuleCetakDokumenUpayaHukum($alur_perkara_id, $perkaraid);
	$canEditPemberitahuanPutusan = $this->authorization->HasRuleEditPemberitahuanPutusanPK($alur_perkara_id, $perkaraid);
	if($infopk!=''){
		if($infopk->num_rows>0){
			foreach ($infopk->result() as $row) {
				$noperkarapn = $row->nomor_perkara_pn;
				$tglputusanpn = $this->tanggalhelper->convertDayDate($row->putusan_pn);
				$nokirimberkara = $row->nomor_surat_pengiriman_berkas_pk;
				$tglpengiriman = $this->tanggalhelper->convertDayDate($row->pengiriman_berkas_pk);
				$tglputusanpt = $this->tanggalhelper->convertDayDate($row->putusan_pk);
				$terimaberkas = $this->tanggalhelper->convertDayDate($row->penerimaan_berkas_pk);
				$minutasipt = $this->tanggalhelper->convertDayDate($row->minutasi_pk);
				$noperkarapk = $row->nomor_perkara_pk;
				$noputusanpk = $row->nomor_putusan_pk;
				$statusputusanpk = $row->status_putusan_pk_text;
				$majelis = $row->majelis_hakim_pk;
				$panitera = $row->panitera_pengganti_pk;
				$amar = $row->amar_putusan_pk;
				$tgl_penetapan = $this->tanggalhelper->convertDayDate($row->penetapan_pemeriksaan_pk);
				$tgl_penetapan_hakim_pemeriksa = $this->tanggalhelper->convertDayDate($row->penetapan_majelis_hakim_pk);
				$cek_penetapan_hakim = (!empty($row->penetapan_majelis_hakim_pk) ? $row->penetapan_majelis_hakim_pk : "");
				$cek_penetapan_sidang = (!empty($row->penetapan_pemeriksaan_pk) ? $row->penetapan_pemeriksaan_pk : "");
				$majelis_hakim_pemeriksa = $row->hakim_nama_pk;
				$tgl_pemeriksaan = $this->tanggalhelper->convertDayDate($row->pemeriksaan_pk);
				$tgl_jaksa = $this->tanggalhelper->convertDayDate($row->pendapat_jaksa);
				$tgl_hakim = $this->tanggalhelper->convertDayDate($row->pendapat_hakim);
				$jaksa =$row->isi_pendapat_jaksa;
				$hakim =$row->isi_pendapat_hakim;
				$tgl_sumpah =$this->tanggalhelper->convertDayDate($row->tanggal_penyumpahan);
			}
			$tahapanid = base64_encode($this->encrypt->encode(40));
		}
	}else{
		show_404();
	}

	if(count($dirput) > 0){
			foreach ($dirput as $row) {
				$tgl_register = $this->tanggalhelper->convertDayDate($row['tanggal_register']);
				$majelis2 = $row['hakim'];
				$ganti=array('Hakim Ketua','Ketua Majelis Hakim',':');
				$hakim_ketua = str_replace($ganti,'',$row['hakim_ketua']);
				$ganti2=array('Hakim Anggota',':');
				$hakim_anggota = str_replace($ganti2,'',$row['hakim_anggota']);
				$catatan_amar = $row['catatan_amar'];
				$catatan_amar_banding = $row['catatan_amar_banding'];
				$catatan_amar_kasasi = $row['catatan_amar_kasasi'];
				$jenis_putusan = $row['amar'];
				$bht = $row['bht'];
			}
			$tahapanid = base64_encode($this->encrypt->encode(30));
		}
	      else {
					echo json_encode(array('st'=>0,'msg'=>'data PK kosong'));
						return;
	   }





	$idjenisperkara = $this->tanggalhelper->getIDJenisPerkara($perkaraid);
	$url = base_url("hapusPK/".$enc);
?>
<hr class="thick-line" style="clear:both;">
<div style="font-size:14px;padding-top:0px;padding-left:5px;" id="detilpk">
	<table id='infoPerkara' style="font-size:14px;width:100%;">
		<col width="25%">
		<col width="75%">
		<tbody>
			<tr>
				<td><a href="##" id='goback' class="btn btn-default btn-sm"><i class="fa fa-reply-all"></i> Kembali</a></td>
				<td style="text-align:right;text-decoration: none;color:#e74c3c;" colspan="2">
					<?php 
					if ($this->authorization->HasRuleHapusDataUpayaHukum($alur_perkara_id)){
						echo '<a style="color:white" href="##"" onclick="popup_form(\''.$url.'\')" class="btn btn-danger btn-sm">Hapus</a>';
					}?>
				</td>
			</tr>
			<tr >
				<td style="background-color:#A3DBA8;padding:5px;"><strong>Data Perkara Tingkat Pertama</td>
			</tr>
			<tr>
				<td style="padding:1px;"></td>
			</tr>
			<tr>
				<td id="first-child">Nomor Perkara</td>
				<td><?php echo (!empty($noperkarapn) ? $noperkarapn : '');?></td>
			</tr>
			<tr>
				<td id="first-child">Tanggal Register</td>
				<td><?php echo (!empty($tgl_register) ? $tgl_register : '-');?></td>
			</tr>
			<tr>
				<td id="first-child">Tanggal Putusan</td>
				<td><?php echo (!empty($tglputusanpn) ? $tglputusanpn : '');?></td>
			</tr>
			<!-- data direktori Putusan -->
								<tr>
					<td id="first-child">Hakim</td>
					<td style="padding:0px;padding-left:5px;">
						<?php
						  if ($majelis2 == 1) {
						  echo 'Majelis hakim'; } else {
						  echo 'Hakim tunggal';
						}
						?>
					</td>
				</tr>
				<tr>
					<td id="first-child">Hakim Ketua</td>
					<td style="padding:0px;padding-left:5px;">
						<?php echo (!empty($hakim_ketua) ? $hakim_ketua : '');?>
					</td>
				</tr>
					<tr>
					<td id="first-child">Hakim Anggota</td>
					<td style="padding:0px;padding-left:5px;">
					<?php echo (!empty($hakim_anggota) ? $hakim_anggota : '');?>
					</td>
				</tr>
			<tr>
					<td id="first-child">Jenis Putusan Tk 1</td>
					<td>
						<?php echo (!empty($jenis_putusan) ? $jenis_putusan : '');?>
					</td>
				</tr>
				<td  id="first-child" style=" vertical-align: top;">Catatan Amar</td>
					<td>
						<?php echo $this->ckeditor->editor("amar_putusan",!empty($catatan_amar) ? $catatan_amar : '-'); ?>
					</td>
			<tr >

			     <td  id="first-child" style=" vertical-align: top;">Catataan Amar Banding</td>
					<td>
					    <?php echo $this->ckeditor->editor("amar_banding",!empty($catatan_amar_banding) ? $catatan_amar_banding : '-'); ?>
					</td>
				</tr>
				<tr>
				 <td  id="first-child" style=" vertical-align: top;">Catataan Amar Kasasi</td>
					<td>
					    <?php echo $this->ckeditor->editor("amar_kasasi",!empty($catatan_amar_kasasi) ? $catatan_amar_kasasi : '-'); ?>
					</td>
				</tr>

				<td></td>
			</tr>
			<tr>
				<td colspan="3"></td>
			</tr>
		</tbody>
	</table>
<div style="padding:5px;"></div>
	<?php
	if($surat_pengantar!=''){
		if($surat_pengantar->num_rows>0){
			$data_surat=$surat_pengantar->row();
			$tgl_surat_pengantar = $this->tanggalhelper->convertDayDate($data_surat->tgl_surat_pengantar);
		    	$nomor_surat_pengantar = $data_surat->nomor_surat_pengantar;
            			$nomor_resi_pos = $data_surat->no_resi_pos;
            			$barcode = $data_surat->barcode;
		}
		  else
		  {
		  	$data_surat="";
			$pengajuan=0;
			$barcode = "";
		  }
	}
	?>
	<table id='infoPerkara' style="font-size:14px;width:100%;" border="0">
		<col width="25%">
		<col width="50%">
		<col width="25%">
		<tbody>
			<tr >
				<td style="background-color:#A3DBA8;padding:5px;" colspan="3"><strong>Surat Pengantar</td>
			</tr>
			<tr>
				<td style="padding:1px;"></td>
			</tr>
			<tr>
				<td id="first-child">Tanggal Surat Pengantar</td>
				<td><?php echo (!empty($tgl_surat_pengantar) ? $tgl_surat_pengantar : '-');?></td>
				<td style="text-align:right">
				<?php
				if ($canEditDataPK){
					$idpihak = base64_encode($this->encrypt->encode(3));
				 $urls='editpengantar/4';
				?>
                <a href="#" onClick="popup_form('<?php echo base_url($urls) ;?>')">[Edit surat pengantar]</a>
				<?php
				}
                                if(!empty($pengajuan[0]['barcode'])){
                                        echo '<br><a id=noLoading target=_blank href='.base_url('upload_dirput/print_barcode/'.$pengajuan[0]['barcode']).'>[Cetak BARCODE]</a>';
                                    }elseif(!empty($pengajuan[0]['pengajuan_guid'])){
                                        echo '<br><a id=noLoading target=_blank href='.base_url('upload_dirput/pengajuan_detail/'.$pengajuan[0]['pengajuan_guid']).'>[Cetak BARCODE]</a>';
                                    }else{
                                  if ($pengajuan!==0) {
								  echo '<br><a id=noLoading target=_self href='.base_url('upload_dirput/pengajuan_pk/'.$perkaraid).'>[Upload pengajuan PK]</a>'; }
                                }
                                    ?>
				</td>
			</tr>
			<tr>
				<td id="first-child">Nomor Surat Pengantar</td>
				<td><?php echo (!empty($nomor_surat_pengantar) ? $nomor_surat_pengantar : '-');?></td>
			</tr>
			<tr>
					<td id="first-child">File Surat Pengantar</td>
					<td>
					<?php if (trim($data_surat->filename)!='') {
					?>
					 <a id="noLoading" target="_blank" href="<?php echo base_url($data_surat->path_filename);?>">Unduh Dokumen</a>
					<?php
					} else { echo '-' ;}
					if (trim($barcode)<>'')
					 {
					?>
					<a id="noLoading" target="_blank" href="<?php echo base_url($data_surat->barcode);?>">Unduh Dokumen</a>

					 <?php } else { echo '-'; } ?>
					</td>
				</tr>
                <tr>
				<td id="first-child">Nomor resi PT. Pos</td>
				<td><?php echo (!empty($nomor_resi_pos) ? $nomor_resi_pos : '-');?></td>
			</tr>
		</tbody>
	</table>
<div style="padding:5px;"></div>
	<table id='infoPerkara' style="font-size:14px;width:100%;">
		<col width="15%">
		<col width="85%">
		<tbody>
			<tr>
				<td style="background-color:#A3DBA8;padding:5px;" colspan="2"><strong>Data Para Pihak</td>
			</tr>
		</tbody>
	</table>
	<div style="padding:1px;"></div>
	<div class="cssTable" style="margin:0px;padding:0px;">
		<table id="tableinfo" style="font-size:14px;width:100%;">
			<col width="5%" />
			<col width="20%" />
			<col width="35%" />
			<col width="10%" />
			<col width="25%" />
			<?php if ($canEditDataPK){ ?>
			<col width="5%" />
			<?php } ?>
			<tbody>
				<tr>
					<td>No</td>
					<td>Status</td>
					<td>Nama</td>
					<td>Diwakili</td>
					<td>Diwakili Oleh</td>
					<?php if ($canEditDataPK){ ?>
					<td></td>
					<?php } ?>
				</tr>
				<?php
				if($infopkdetil!=''){
					if($infopkdetil->num_rows>0){
						$i=1;
						foreach ($infopkdetil->result() as $row) {
							$diwakili = ($row->pihak_diwakili=='Y')? 'Ya':'Tidak';
							if($row->pihak_diwakili=='Y'){
								$pemohon = $row->pemohon_nama.'<br> Pekerjaan:'.$row->pemohon_pekerjaan.'<br> Alamat:'.$row->pemohon_alamat;
							}else{
								$pemohon = '';
							}
							$edit = FALSE;
							if($row->alur_perkara_id<100){
								$edit = TRUE;
							}else{
								if($row->pihak_asal==2){
									$edit = TRUE;
								}
							}

							echo '<tr>';
								echo '<td style="text-align:center">'.$i.'</td>';
								echo '<td>'.$row->status_pihak_text.'('.$row->pihak_asal_text.')</td>';
								echo '<td>'.$row->pihak_nama.'</td>';
								echo '<td style="text-align:center">'.$diwakili.'</td>';
								echo '<td>'.$pemohon.'</td>';
								if($edit==TRUE && $canEditDataPK){
									$idpihak = base64_encode($this->encrypt->encode($row->pihak_id));
									$enc_id = base64_encode($this->encrypt->encode($row->id));
									echo '<td align="center" style="cursor:pointer;"><a href="#" onClick="popup_form(\''.base_url('editpk/'.$idpihak.'/'.$enc_id).'\')">[Edit]</a></td>';
								}
							echo '</tr>';
							$i++;
						}
					}
				}
				?>
			</tbody>
		</table>
	</div>
	<div style="padding:5px;"></div>
	<table id='infoPerkara' style="font-size:14px;width:100%;">
		<col width="15%">
		<col width="85%">
		<tbody>
			<tr>
				<td style="background-color:#A3DBA8;padding:5px;" colspan="2"><strong>Data Permohonan PK</td>
			</tr>
		</tbody>
	</table>
	<div style="padding:1px;"></div>
	<div class="cssTable" style="margin:0px;padding:0px;">
		<table id="tableinfo" style="font-size:14px;width:100%;">
			<col width="15%" />
			<col width="35%" />
			<col width="20%" />
			<?php
			if (($alur_perkara_id==='111' OR $alur_perkara_id==9 OR $alur_perkara_id==120 OR $alur_perkara_id==='15' OR $alur_perkara_id==='16') && $canCetakDokumen && $this->session->userdata('idgroup')!=600) {
				echo '<col width="16%" />';
			}
			if ($canEditDataPK){ ?>
			<col width="10%" />
			<?php } ?>
			<tbody>
				<tr>
					<td>Tanggal Permohonan</td>
					<td>Pemohon PK</td>
					<td>Keterangan</td>
					<?php
					if (($alur_perkara_id==='111' OR $alur_perkara_id==9 OR $alur_perkara_id==120 OR $alur_perkara_id==='15' OR $alur_perkara_id==='16') && $canCetakDokumen && $this->session->userdata('idgroup')!=600) {
						echo '<td>Cetak Dokumen Akta</td>';
					}
					if ($canEditDataPK){?>
					<td></td>
					<?php } ?>
				</tr>
				<?php
				if($infopkdetil!=''){
					if($infopkdetil->num_rows>0){
						foreach ($infopkdetil->result() as $row) {
							$diwakili = ($row->pihak_diwakili=='Y')? 'Ya':'Tidak';
							if($diwakili=='Y'){
								$pemohon = $row->pemohon_pk;
							}else{
								$pemohon = $row->pemohon_nama.'<br>'.$row->pekerjaan.'<br>'.$row->pemohon_alamat;
							}
							if(!empty($row->tanggal_cabut)){
								$status = 'Permohonan pk Telah Dicabut Pada '.$this->tanggalhelper->convertDayDate($row->tanggal_cabut);
								$keterangan=$status.'<br>Keterangan: '.$row->keterangan;
								$centering='style="text-align:left"';
							}else{
								$keterangan = '-';
								$centering='style="text-align:center"';
							}
							if(!empty($row->permohonan_pk)){
								if(!empty($row->pihak_asal) AND !empty($row->pihak_id)){
									$pihakasal = $row->pihak_asal;
								}
								$encpemohon = base64_encode($this->encrypt->encode($row->pemohon_id));
								echo '<tr>';
									echo '<td style="text-align:center">'.$this->tanggalhelper->convertDayDate($row->permohonan_pk).'</td>';
									echo '<td>'.$pemohon.'</td>';
									echo '<td '.$centering.'>'.$keterangan.'</td>';
									if (($alur_perkara_id==='111' OR $alur_perkara_id==9 OR $alur_perkara_id==120 OR $alur_perkara_id=='15' OR $alur_perkara_id=='16') && $canCetakDokumen && $this->session->userdata('idgroup')!=600){
										echo "<td align='center'>";
										if ($alur_perkara_id==='111') {?>
												<span class="custom-dropdown custom-dropdown--emerald">
													<select onchange="pilih_cetak(this)" style="width:180px;z-index:99999" class="custom-dropdown__select custom-dropdown__select--white">
														<option value="1">Pilih Dokumen</option>
														<option value="<?php echo base_url("c_template_akta_permintaan_pk/popup_akta_permintaan_pk/".$enc."/".$pihakasal."/".$encpemohon);?>">Akta Permintaan Peninjauan Kembali</option>
														<option value="<?php echo base_url("c_template_akta_cabut_pk/popup_akta_cabut_pk/".$enc."/".$pihakasal."/".$encpemohon);?>">Akta Pencabutan Peninjauan Kembali</option>
													</select>
												</span>
										<?php
										}elseif ($alur_perkara_id==9) {?>
												<?php if(!empty($row->tanggal_cabut)){	?>
													<a href="#" onClick="popup_form('<?php echo base_url("c_template_tun_peninjauan_kembali/popup_tun_akta_permintaan_pk/".$enc."/".$pihakasal."/".$encpemohon."/2");?>')">
													<img src="<?php echo base_url();?>resources/img/nm_icon_doc.gif">
												<?php } else { ?>
													<a href="#" onClick="popup_form('<?php echo base_url("c_template_tun_peninjauan_kembali/popup_tun_akta_permintaan_pk/".$enc."/".$pihakasal."/".$encpemohon."/1");?>')">
													<img src="<?php echo base_url();?>resources/img/nm_icon_doc.gif">
												<?php }?>

										<?php
										}elseif ($alur_perkara_id==='120') {?>
												<span class="custom-dropdown custom-dropdown--emerald">
													<select onchange="pilih_cetak(this)" style="width:180px;z-index:99999" class="custom-dropdown__select custom-dropdown__select--white">
														<option value="1">Pilih Dokumen</option>
														<option value="<?php echo base_url("c_template_akta_permintaan_pk_mil/popup_akta_pk/".$enc."/".$pihakasal."/".$encpemohon);?>">Akta Permintaan Peninjauan Kembali</option>
														<!-- <option value="<?php //echo base_url("c_template_akta_cabut_pk/popup_akta_cabut_pk/".$enc."/".$pihakasal."/".$encpemohon);?>">Akta Pencabutan Peninjauan Kembali</option> -->
													</select>
												</span>
										<?php
										}elseif ($alur_perkara_id==='120') {?>
												<span class="custom-dropdown custom-dropdown--emerald">
													<select onchange="pilih_cetak(this)" style="width:180px;z-index:99999" class="custom-dropdown__select custom-dropdown__select--white">
														<option value="1">Pilih Dokumen</option>
														<option value="<?php echo base_url("c_template_akta_permintaan_pk_mil/popup_akta_permintaan_pk/".$enc."/".$pihakasal."/".$encpemohon);?>">Akta Permintaan Peninjauan Kembali</option>
														<!-- <option value="<?php //echo base_url("c_template_akta_cabut_pk/popup_akta_cabut_pk/".$enc."/".$pihakasal."/".$encpemohon);?>">Akta Pencabutan Peninjauan Kembali</option> -->
													</select>
												</span>
										<?php
										}elseif ($alur_perkara_id==='15' || $alur_perkara_id==='16') {?>
												<a href="#" onClick="popup_form('<?php echo base_url("c_template_agama_pk/popup_akta_pk/".$enc."/".$pihakasal."/".$encpemohon."/1");?>')">
													<img src="<?php echo base_url();?>resources/img/nm_icon_doc.gif"></a>
										<?php
										}else{echo "Tanggal kosong, belum dapat cetak dokumen";}
										echo "</td>";
									}
								    if ($canEditDataPK){
										$enc = base64_encode($this->encrypt->encode($row->perkara_id));
										$enc_id = base64_encode($this->encrypt->encode($row->id));
										echo '<td align="center" style="cursor:pointer;"><a href="##" onClick="popup_form(\''.base_url('cabutpermohonanpk/'.$enc.'/'.$enc_id).'\')">[Cabut]</a>|<a href="#" onClick="popup_form(\''.base_url('editpermohonanpk/'.$enc.'/'.$enc_id).'\')">[Edit]</a></td>';
									}
								echo '</tr>';
							}
						}
					}
				}
				?>
			</tbody>
		</table>
	</div>
	<?php
	if($alur_perkara_id<100 AND $alur_perkara_id!=9 AND $alur_perkara_id!=10 AND $alur_perkara_id!=11 AND $alur_perkara_id!=2 AND $alur_perkara_id!=16){
		$jenispkr = array('624','139','140','141','344','359','360');
    	if(!in_array($idjenisperkara, $jenispkr)){
	?>
		<div style="padding:5px;"></div>
		<table id='infoPerkara' style="font-size:14px;width:100%;" border="0" >
			<col width="20%">
			<col width="">
			<col width="200px">
			<?php
			$enc_id = '/'.$tahapanid.'/tambah';
			$tgl_kesepakatan = '';
			$tgl_pengajuan_kesepakatan = '';
			$nama_mediator = '';
			$tgl_pengiriman_kesepakatan = '';
			if($infomediasi!=''){
				if($infomediasi->num_rows>0){
					foreach ($infomediasi->result() as $row) {
						$tgl_kesepakatan=$this->tanggalhelper->convertDayDate($row->tgl_kesepakatan_perdamaian);
						$tgl_pengajuan_kesepakatan=$this->tanggalhelper->convertDayDate($row->tgl_pengajuan_kesepakatan);
						$nama_mediator=$row->mediator_text;
						$status_mediator=$row->status_mediator;
						$tgl_pengiriman_kesepakatan = $this->tanggalhelper->convertDayDate($row->tgl_kirim_kesepakatan_ke_ptma);
						$keterangan=$row->catatan_mediasi;
						$enc_id='/'.$tahapanid.'/edit/'.base64_encode($this->encrypt->encode($row->mediasi_id));
					}
				}
			}
			echo'<tbody>
				<tr><td colspan="3" style="background-color:#A3DBA8;padding:5px;"><strong>Data Mediasi</td></tr>
				<tr><td style="padding:1px;"></td></tr>
				<tr><td id="first-child">Tanggal Kesepakatan Perdamaian</td>
					<td>'.(!empty($tgl_kesepakatan) ? $tgl_kesepakatan : '-').'</td>
					<td style="text-align:right">';
						if($canEditDataPK){
							echo '<a href="##" onClick="popup_form(\''.base_url('editmediasibanding/'.$enc.$enc_id).'\')">'.(!empty($nama_mediator) ?'[Edit - Data Mediasi]' :'[Tambah - Data Mediasi]').'</a>';
						}
			  echo'</td>
				</tr>
				<tr>
					<td id="first-child">Tanggal Pengajuan Kesepakatan Perdamaian</td>
					<td colspan="2">'.(!empty($tgl_pengajuan_kesepakatan) ? $tgl_pengajuan_kesepakatan : '-').'</td>
				</tr>
				<tr><td id="first-child">Mediator</td>
					<td colspan="2">';
					if($nama_mediator!=''){
                    echo'<div class="cssTable" style="">
                        <table id="tableinfo" style="margin:0px;padding:0px;">
                            <col style="width:5%">
                            <col style="width:75%">
                            <col style="width:20%">
                            <tbody>
                                <tr>
                                    <td>No</td>
                                    <td>Nama</td>
                                    <td>Status Mediator</td>
                                </tr>';
		                            $jumlah         = substr_count($nama_mediator ,"<br/>");
		                            $mediator_text  = explode("<br/>",$nama_mediator );
		                            $status         = explode(",",$status_mediator);
		                            $total          = $jumlah+1;
		                            for($i=0; $i<$total; $i++){
										$no = $i+1;
										$status_med=substr_replace(",",$status[$i]."<br>",0);
										if($status[$i]=='H'){
											$status_text='Hakim';
		                                }elseif($status[$i]=='N'){
											$status_text='Non-Hakim';
										}elseif($status[$i]=='P'){
											$status_text='Pegawai';
		                                }else{
											$status_text="-";
		                                }
										echo "<tr>
											<td style='text-align:center; vertical-align:top'>".$no."</td>
											<td style='text-align:left; vertical-align:top;'>".substr_replace("<br/>",$mediator_text[$i]."<br>",0)."</td>
											<td style='text-align:left; vertical-align:top'>".$status_text."</td>
											<tr>";
									}
							echo'</tbody>
							</table>
						</div>';
					}else{
						echo'-';
					}
					echo'</td>
				</tr>
				<tr><td id="first-child">Tanggal Pengiriman Kesepakatan ke MA</td>
					<td colspan="2">'.(!empty($tgl_pengiriman_kesepakatan) ? $tgl_pengiriman_kesepakatan : '-').'</td>
				</tr>
				<tr><td id="first-child">Keterangan</td>
					<td colspan="2">'.(!empty($keterangan) ? $keterangan : '-').'</td>
				</tr>
				<tr><td colspan="2"></td></tr>
			</tbody>
		</table>';
		}
	}
	?>
	<div style="padding:5px;"></div>
	<table id='infoPerkara' style="font-size:14px;width:100%;">
		<col width="15%">
		<col width="85%">
		<tbody>
			<tr>
				<td style="background-color:#A3DBA8;padding:5px;" colspan="2"><strong>Tanggal Pemberitahuan Permohonan PK</td>
			</tr>
		</tbody>
	</table>
	<div style="padding:1px;"></div>
	<div class="cssTable" style="margin:0px;padding:0px;">
		<table id="tableinfo" style="font-size:14px;width:100%;">
			<col width="5%" />
			<col width="20%" />
			<col width="35%" />
			<col width="15%" />
			<?php if (($alur_perkara_id==='120' OR $alur_perkara_id==9 OR $alur_perkara_id==15 OR $alur_perkara_id==16) && $canCetakDokumen) {
				echo '<col width="10%" />';
			}
			if ($canEditDataPK){?>
			<col width="5%" />
			<?php } ?>
			<tbody>
				<tr>
					<td>No</td>
					<td>Status</td>
					<td>Nama</td>
					<td>Tanggal</td>
					<?php
					if (($alur_perkara_id==='120' OR $alur_perkara_id==9 OR $alur_perkara_id==15 OR $alur_perkara_id==16) && $canCetakDokumen) {
						echo '<td>Cetak Dokumen Relaas</td>';
					}
					if ($canEditDataPK){?>
					<td></td>
					<?php } ?>
				</tr>
				<?php
				if($infopkdetil!=''){
					if($infopkdetil->num_rows>0){
						$i=1;
						foreach ($infopkdetil->result() as $row) {
							if($row->status_pihak_id>1){
								$idpihak = base64_encode($this->encrypt->encode($row->pihak_id));
								$pihakasal = base64_encode($this->encrypt->encode($row->pihak_asal));
								echo '<tr>';
									echo '<td style="text-align:center">'.$i.'</td>';
									echo '<td>'.$row->status_pihak_text.'('.$row->pihak_asal_text.')</td>';
									echo '<td>'.$row->pihak_nama.'</td>';
									echo '<td style="text-align:center">'.$this->tanggalhelper->convertDayDate($row->pemberitahuan_pk).'</td>';
									if (($alur_perkara_id==='120' OR $alur_perkara_id==9 OR $alur_perkara_id==15 OR $alur_perkara_id==16) && $canCetakDokumen) {
										echo "<td align='center'>";
										if (!empty($row->pemberitahuan_pk)){
											if ($alur_perkara_id==='120') {?>
													<a onclick="popup_form('<?php echo base_url("c_template_akta_permintaan_pk_mil/cetak_pemberitahuan/".$enc."/".$row->status_pihak_id."/".$idpihak);?>')">
													<img src="<?php echo base_url();?>resources/img/nm_icon_doc.gif"></a>
											<?php
											}elseif ($alur_perkara_id==9) {?>
													<a href="#" onClick="popup_form('<?php echo base_url("c_template_tun_peninjauan_kembali/popup_tun_pemberitahuan_pk/".$enc."/".$pihakasal."/".$idpihak."/1");?>')">
													<img src="<?php echo base_url();?>resources/img/nm_icon_doc.gif"></a>
											<?php
											}elseif ($alur_perkara_id==15 OR $alur_perkara_id==16) {?>
													<a href="#" onClick="popup_form('<?php echo base_url("c_template_agama_pk/popup_relaas_pk/".$enc."/".$pihakasal."/".$idpihak."/1");?>')">
													<img src="<?php echo base_url();?>resources/img/nm_icon_doc.gif"></a>
											<?php
											}
										}else{echo "Tanggal kosong, belum dapat cetak dokumen";}
										echo "</td>";
									}
									if ($canEditDataPK){
										$enc_id = base64_encode($this->encrypt->encode($row->id));
										echo '<td align="center" style="cursor:pointer;"><a href="#" onClick="popup_form(\''.base_url('edittanggalpk/'.$idpihak.'/'.$enc_id).'/1\')">[Edit]</a></td>';
									}
								echo '</tr>';
								$i++;
							}
						}
					}
				}
				?>
			</tbody>
		</table>
	</div>
	<div style="padding:5px;"></div>
	<table id='infoPerkara' style="font-size:14px;width:100%;">
		<col width="15%">
		<col width="85%">
		<tbody>
			<tr>
				<td style="background-color:#A3DBA8;padding:5px;" colspan="2"><strong>Tanggal Penerimaan Memori PK</td>
			</tr>
		</tbody>
	</table>
	<div style="padding:1px;"></div>
	<div class="cssTable" style="margin:0px;padding:0px;">
		<table id="tableinfo" style="font-size:14px;width:100%;">
			<col width="5%" />
			<col width="20%" />
			<col width="35%" />
			<col width="15%" />
			<?php if (($alur_perkara_id==='15' || $alur_perkara_id==='16') && $canCetakDokumen && $this->session->userdata('idgroup')!=600) {
				echo '<col width="10%" />';
			}
			if ($canEditDataPK){?>
			<col width="5%" />
			<?php } ?>
			<tbody>
				<tr>
					<td>No</td>
					<td>Status</td>
					<td>Nama</td>
					<td>Tanggal</td>
					<?php
					if (($alur_perkara_id==='15' || $alur_perkara_id==='16') && $canCetakDokumen && $this->session->userdata('idgroup')!=600) {
						echo '<td>Cetak Dokumen Akta</td>';
					}
					if ($canEditDataPK){?>
					<td></td>
					<?php } ?>
				</tr>
				<?php
				if($infopkdetil!=''){
					if($infopkdetil->num_rows>0){
						$i=1;
						foreach ($infopkdetil->result() as $row) {
							if($row->status_pihak_id==1 OR $row->status_pihak_id==2 OR $row->status_pihak_id==5){
								if(!empty($row->permohonan_pk)){

									$encpihak = base64_encode($this->encrypt->encode($row->pihak_id));

									echo '<tr>';
									echo '<td style="text-align:center">'.$i.'</td>';
									echo '<td>'.$row->status_pihak_text.'('.$row->pihak_asal_text.')</td>';
									echo '<td>'.$row->pihak_nama.'</td>';
									echo '<td style="text-align:center">'.$this->tanggalhelper->convertDayDate($row->penerimaan_memori_pk).'</td>';
									if (($alur_perkara_id==='15' || $alur_perkara_id==='16') && $canCetakDokumen && $this->session->userdata('idgroup')!=600) {
										echo "<td align='center'>";
										if (!empty($row->penerimaan_memori_pk)){
				?>
													<a href="#" onClick="popup_form('<?php echo base_url("c_template_agama_pk/popup_akta_pk/".$enc."/".$pihakasal."/".$encpemohon."/2");?>')">
													<img src="<?php echo base_url();?>resources/img/nm_icon_doc.gif"></a>
											<?php
										}else{echo "Tanggal kosong, belum dapat cetak dokumen";}
										echo "</td>";
									}
									if ($canEditDataPK){
										$idpihak = base64_encode($this->encrypt->encode($row->pihak_id));
										$enc_id = base64_encode($this->encrypt->encode($row->id));
										echo '<td align="center" style="cursor:pointer;"><a href="#" onClick="popup_form(\''.base_url('edittanggalpk/'.$idpihak.'/'.$enc_id).'/2\')">[Edit]</a></td>';
									}
								}
								echo '</tr>';
								$i++;
							}
						}
					}
				}
				?>
			</tbody>
		</table>
	</div>
	<div style="padding:5px;"></div>
	<table id='infoPerkara' style="font-size:14px;width:100%;">
		<col width="15%">
		<col width="85%">
		<tbody>
			<tr>
				<td style="background-color:#A3DBA8;padding:5px;" colspan="2"><strong>Tanggal Penyerahan Memori PK</td>
			</tr>
		</tbody>
	</table>
	<div style="padding:1px;"></div>
	<div class="cssTable" style="margin:0px;padding:0px;">
		<table id="tableinfo" style="font-size:14px;width:100%;">
			<col width="5%" />
			<col width="20%" />
			<col width="35%" />
			<col width="15%" />
			<?php if (($alur_perkara_id==='120' || $alur_perkara_id==='15' || $alur_perkara_id==='16') && $canCetakDokumen && $this->session->userdata('idgroup')!=600) {
				echo '<col width="10%" />';
			}
			if ($canEditDataPK){?>
			<col width="5%" />
			<?php } ?>
			<tbody>
				<tr>
					<td>No</td>
					<td>Status</td>
					<td>Nama</td>
					<td>Tanggal</td>
					<?php
					if (($alur_perkara_id==='120' || $alur_perkara_id==='15' || $alur_perkara_id==='16') && $canCetakDokumen && $this->session->userdata('idgroup')!=600) {
						echo '<td>Cetak Dokumen Relaas</td>';
					}
					if ($canEditDataPK){?>
					<td></td>
					<?php } ?>
				</tr>
				<?php
				if($infopkdetil!=''){
					if($infopkdetil->num_rows>0){
						$i=1;
						foreach ($infopkdetil->result() as $row) {
							if($row->status_pihak_id>1){
								$idpihak = base64_encode($this->encrypt->encode($row->pihak_id));
								$pihakasal = base64_encode($this->encrypt->encode($row->pihak_asal));
								echo '<tr>';
									echo '<td style="text-align:center">'.$i.'</td>';
									echo '<td>'.$row->status_pihak_text.'('.$row->pihak_asal_text.')</td>';
									echo '<td>'.$row->pihak_nama.'</td>';
									echo '<td style="text-align:center">'.$this->tanggalhelper->convertDayDate($row->penyerahan_memori_pk).'</td>';
									if (($alur_perkara_id==='120' || $alur_perkara_id==='15' || $alur_perkara_id==='16') && $canCetakDokumen && $this->session->userdata('idgroup')!=600){
										echo "<td align='center'>";
										if ($alur_perkara_id==='120') {?>
											  <a onclick="popup_form('<?php //echo base_url("c_template_akta_permintaan_pk_mil/cetak_pemberitahuan/".$enc."/".$row->status_pihak_id."/".$idpihak);?>')"><img src="<?php echo base_url();?>resources/img/nm_icon_doc.gif"></a> -->
										<?php
										}elseif ($alur_perkara_id==='15' || $alur_perkara_id==='16') {?>
											   <a href="#" onClick="popup_form('<?php echo base_url("c_template_agama_pk/popup_relaas_pk/".$enc."/".$pihakasal."/".$idpihak."/2");?>')">
											   <img src="<?php echo base_url();?>resources/img/nm_icon_doc.gif"></a>
										<?php
										}else{echo "Tanggal kosong, belum dapat cetak dokumen (template belum jadi)";}
										echo "</td>";
									}
									if ($canEditDataPK){
										$idpihak = base64_encode($this->encrypt->encode($row->pihak_id));
										$enc_id = base64_encode($this->encrypt->encode($row->id));
										echo '<td align="center" style="cursor:pointer;"><a href="#" onClick="popup_form(\''.base_url('edittanggalpk/'.$idpihak.'/'.$enc_id).'/3\')">[Edit]</a></td>';
									}
								echo '</tr>';
								$i++;
							}
						}
					}
				}
				?>
			</tbody>
		</table>
	</div>
	<div style="padding:5px;"></div>
	<table id='infoPerkara' style="font-size:14px;width:100%;">
		<col width="15%">
		<col width="85%">
		<tbody>
			<tr>
				<td style="background-color:#A3DBA8;padding:5px;" colspan="2"><strong>Tanggal Penerimaan Kontra Memori PK</td>
			</tr>
		</tbody>
	</table>
	<div style="padding:1px;"></div>
	<div class="cssTable" style="margin:0px;padding:0px;">
		<table id="tableinfo" style="font-size:14px;width:100%;">
			<col width="5%" />
			<col width="20%" />
			<col width="35%" />
			<col width="15%" />
			<?php if (($alur_perkara_id==='120' || $alur_perkara_id==='15' || $alur_perkara_id==='16') && $canCetakDokumen && $this->session->userdata('idgroup')!=600) {
				echo '<col width="10%" />';
			}
			if ($canEditDataPK){ ?>
			<col width="5%" />
			<?php } ?>
			<tbody>
				<tr>
					<td>No</td>
					<td>Status</td>
					<td>Nama</td>
					<td>Tanggal</td>
					<?php
					if (($alur_perkara_id==120 || $alur_perkara_id==15 || $alur_perkara_id==16) && $canCetakDokumen && $this->session->userdata('idgroup')!=600) {
						echo '<td>Cetak Dokumen Akta</td>';
					}
					if ($canEditDataPK){ ?>
					<td></td>
					<?php } ?>
				</tr>
				<?php
				if($infopkdetil!=''){
					if($infopkdetil->num_rows>0){
						$i=1;
						foreach ($infopkdetil->result() as $row) {
							if($row->status_pihak_id>1 AND $row->status_pihak_id<=5){
								if(!empty($row->pihak_asal) AND !empty($row->pihak_id)){
										$pihakasal = $row->pihak_asal;
									}
								echo '<tr>';
									echo '<td style="text-align:center">'.$i.'</td>';
									echo '<td>'.$row->status_pihak_text.'('.$row->pihak_asal_text.')</td>';
									echo '<td>'.$row->pihak_nama.'</td>';
									echo '<td style="text-align:center">'.$this->tanggalhelper->convertDayDate($row->penerimaan_kontra_pk).'</td>';
									if (($alur_perkara_id==120 || $alur_perkara_id==15 || $alur_perkara_id==16) && $canCetakDokumen && $this->session->userdata('idgroup')!=600) {
										echo "<td align='center'>";
										if (!empty($row->penerimaan_kontra_pk)){
											if ($alur_perkara_id==15 OR $alur_perkara_id==16) {?>
												<a href="#" onClick="popup_form('<?php echo base_url("c_template_agama_pk/popup_akta_pk/".$enc."/".$pihakasal."/".$encpemohon."/3");?>')">
												<img src="<?php echo base_url();?>resources/img/nm_icon_doc.gif"></a>
											<?php
											}
										}else{echo "Tanggal kosong, belum dapat cetak dokumen";}
										echo "</td>";
									}
									if ($canEditDataPK){
										$idpihak = base64_encode($this->encrypt->encode($row->pihak_id));
										$enc_id = base64_encode($this->encrypt->encode($row->id));
										echo '<td align="center" style="cursor:pointer;"><a href="#" onClick="popup_form(\''.base_url('edittanggalpk/'.$idpihak.'/'.$enc_id).'/4\')">[Edit]</a></td>';
									}
								echo '</tr>';
								$i++;
							}
						}
					}
				}
				?>
			</tbody>
		</table>
	</div>
	<div style="padding:5px;"></div>
	<table id='infoPerkara' style="font-size:14px;width:100%;">
		<col width="15%">
		<col width="85%">
		<tbody>
			<tr>
				<td style="background-color:#A3DBA8;padding:5px;" colspan="2"><strong>Tanggal Penyerahan Kontra Memori PK</td>
			</tr>
		</tbody>
	</table>
	<div style="padding:1px;"></div>
	<div class="cssTable" style="margin:0px;padding:0px;">
		<table id="tableinfo" style="font-size:14px;width:100%;">
			<col width="5%" />
			<col width="20%" />
			<col width="35%" />
			<col width="15%" />
			<?php if (($alur_perkara_id==='120' OR $alur_perkara_id==9 OR $alur_perkara_id==15 OR $alur_perkara_id==16) && $canCetakDokumen && $this->session->userdata('idgroup')!=600) {
				echo '<col width="10%" />';
			}
			if ($canEditDataPK){?>
			<col width="5%" />
			<?php } ?>
			<tbody>
				<tr>
					<td>No</td>
					<td>Status</td>
					<td>Nama</td>
					<td>Tanggal</td>
					<?php
					if (($alur_perkara_id==='120' OR $alur_perkara_id==9 OR $alur_perkara_id==15 OR $alur_perkara_id==16) && $canCetakDokumen && $this->session->userdata('idgroup')!=600) {
						echo '<td>Cetak Dokumen Relaas</td>';
					}
					if ($canEditDataPK){?>
					<td></td>
					<?php } ?>
				</tr>
				<?php
				if($infopkdetil!=''){
					if($infopkdetil->num_rows>0){
						$i=1;
						foreach ($infopkdetil->result() as $row) {
							if($row->status_pihak_id!=3){
								$idpihak = base64_encode($this->encrypt->encode($row->pihak_id));
								$pihakasal = base64_encode($this->encrypt->encode($row->pihak_asal));
								echo '<tr>';
									echo '<td style="text-align:center">'.$i.'</td>';
									echo '<td>'.$row->status_pihak_text.'('.$row->pihak_asal_text.')</td>';
									echo '<td>'.$row->pihak_nama.'</td>';
									echo '<td style="text-align:center">'.$this->tanggalhelper->convertDayDate($row->penyerahan_kontra_pk).'</td>';
									if (($alur_perkara_id==='120' OR $alur_perkara_id==9 OR $alur_perkara_id==15 OR $alur_perkara_id==16) && $canCetakDokumen && $this->session->userdata('idgroup')!=600){
										echo "<td align='center'>";
										if (!empty($row->penyerahan_kontra_pk)){
											if ($alur_perkara_id==='120') {?>
													<a onclick="popup_form('<?php echo base_url("c_template_akta_permintaan_pk_mil/cetak_pemberitahuan/".$enc."/".$row->status_pihak_id."/".$idpihak);?>')">
													<img src="<?php echo base_url();?>resources/img/nm_icon_doc.gif"></a>
											<?php
											}elseif ($alur_perkara_id==9) {?>
													<a href="#" onClick="popup_form('<?php echo base_url("c_template_tun_peninjauan_kembali/popup_tun_pemberitahuan_pk/".$enc."/".$pihakasal."/".$idpihak."/2");?>')">
													<img src="<?php echo base_url();?>resources/img/nm_icon_doc.gif"></a>
											<?php
											}elseif ($alur_perkara_id==='15' || $alur_perkara_id==='16') {?>
											   <a href="#" onClick="popup_form('<?php echo base_url("c_template_agama_pk/popup_relaas_pk/".$enc."/".$pihakasal."/".$idpihak."/3");?>')">
											   <img src="<?php echo base_url();?>resources/img/nm_icon_doc.gif"></a>
											<?php
											}
										}else{echo "Tanggal kosong, belum dapat cetak dokumen";}
										echo "</td>";
									}

									if ($canEditDataPK){
										$idpihak = base64_encode($this->encrypt->encode($row->pihak_id));
										$enc_id = base64_encode($this->encrypt->encode($row->id));
										echo '<td align="center" style="cursor:pointer;"><a href="#" onClick="popup_form(\''.base_url('edittanggalpk/'.$idpihak.'/'.$enc_id).'/5\')">[Edit]</a></td>';
									}
								echo '</tr>';
								$i++;
							}
						}
					}
				}
				?>
			</tbody>
		</table>
	</div>
	<div style="padding:5px;"></div>
	<table id='infoPerkara' style="font-size:14px;width:100%;">
		<col width="20%">
		<col width="">
		<col width="300px">
		<tbody>
			<?php
			if ($this->session->userdata('jenis_pengadilan')!=3){
			?>
			<tr >
				<td style="background-color:#A3DBA8;padding:5px;" colspan="3"><strong>Pemeriksaan Alasan Peninjauan Kembali<?php echo $alur_perkara_id<9?'-Dalam Hal Bukti Baru (Novum)':''?></td>
			</tr>
			<tr>
				<td style="padding:1px;"></td>
			</tr>
			<tr>
				<td id="first-child">Tanggal Penetapan <?php echo $alur_perkara_id>100?'Majelis':''; ?> Hakim</td>
				<td colspan="2">
					<div class="cssTable" style="margin:0px;padding:0px;">
						<table id="tableinfo" style="font-size:14px;width:100%;">
							<col width="20%" />
							<col width="50%" />
							<col width="10%" />
							<?php if ($canEditDataPK){ ?>
							<col width="15%" />
							<?php } ?>
							<tbody>
							<tr>
								<td>Tanggal Penetapan</td>
								<td><?php echo $alur_perkara_id>100?'Majelis':''; ?> Hakim</td>
								<td>Cetak</td>
								<?php if ($canEditDataPK){ ?>
								<td></td>
								<?php } ?>
							</tr>
							<tr>
								<td><div align="center"><?php echo $tgl_penetapan_hakim_pemeriksa; ?></div></td>
								<td><?php echo $majelis_hakim_pemeriksa; ?></td>
								<td><div align="center">
									<?php
									if(!empty($cek_penetapan_hakim)) {
									/*if ($alur_perkara_id==111){
										echo '<a href="#" onClick="popup_form(\''.base_url('c_template_penetapan/cetak_penetapan_majelis_pk/'.$enc).'\')">Cetak </a>';
									 }elseif($alur_perkara_id==120){
									 	echo '<a href="#" onClick="popup_form(\'' .base_url('c_template_pk_pemeriksaan/penetapan_majelis_hakim_pemeriksaan_pk/'.$enc.'/1').'\')">Cetak</a>|';
										echo '<a href="#" onClick="cetakTapsidPkMil()">Cetak Sidang Pertama</a>';
									 }else{*/
									 	echo 'Template belum ada';
									 // }
									}
									?>
								</div></td>
								<?php if ($canEditDataPK){ ?>
								<td>
									<div align="center">
									<?php if(empty($cek_penetapan_hakim)) { 
										echo '<a href="#" onClick="popup_form(\''.base_url('detil_pk/penetapan_majelis_pemeriksa/'.$perkaraid).'\')">Tambah</a>';
									 } else { 
										echo '<a href="#" onClick="popup_form(\''.base_url('detil_pk/penetapan_majelis_pemeriksa/'.$perkaraid).'\')">Edit</a>';
									} ?>
									</div>
								</td>
								<?php } ?>
								
							</tr>
							
							</tbody>
						</table>
					</div>
				</td>
			</tr>
			
					
			<tr>
				<td id="first-child">Penetapan Pemeriksaan PK</td>
				<td colspan="2">
					<div class="cssTable" style="margin:0px;padding:0px;">
						<table id="tableinfo" style="font-size:14px;width:100%;">
							<col width="20%" />
							<col width="50%" />
							<col width="10%" />
							<?php if ($canEditDataPK){ ?>
							<col width="15%" />
							<?php } ?>
							<tbody>
							<tr>
								<td>Tanggal Penetapan</td>
								<td>Tanggal Sidang</td>
								<td>Cetak</td>
								<?php if ($canEditDataPK){ ?>
								<td></td>
								<?php } ?>
							</tr>
							<tr>
								<td><div align="center"><?php echo $tgl_penetapan; ?></div></td>
								<td><?php echo $tgl_pemeriksaan; ?></td>
								<td><div align="center">
									<?php
									if(!empty($cek_penetapan_sidang)) { 
									 	/*if ($alur_perkara_id==111){
									 		echo '<a href="#" onClick="popup_form(\''.base_url('c_template_penetapan/cetak_phs_pk/'.$enc).'\')">Cetak </a>';
									 	}else{*/
									 		echo 'Template belum ada';
									 	// }
								 	}
									?>
								</div></td>
								<?php if ($canEditDataPK){ ?>
								<td>
									<div align="center">
									<?php if(($jumlah_pemeriksaan==1)|| ($jumlah_pemeriksaan==0)){ 
										echo '<a href="#" onClick="popup_form(\''.base_url('penetapan_pemeriksaan_pk/'.$perkaraid).'\')">Edit</a>';
									 } else { 
										echo "";
									} ?>
									</div>
								</td>
								<?php } ?>
								
							</tr>
							
							</tbody>
						</table>
					</div>
				</td>
			</tr>
			<tr>
				<td id="first-child">Pemeriksaan PK</td>
				<td colspan="2">
					<div class="cssTable" style="margin:0px;padding:0px;">
						<table id="tableinfo" style="font-size:14px;width:100%;">
							<col width="5%" />
							<col width="20%" />
							<col width="20%" />
							<col width="30%" />
							<?php if ($canEditDataPK){ ?>
							<col width="15%" />
							<?php } ?>
							<tbody>
							<tr>
								<td>No</td>
								<td>Tanggal / Waktu</td>
								<td>Tempat</td>
								<td>Agenda</td>
								<?php if ($canEditDataPK){ ?>
								<td></td>
								<?php } ?>
							</tr>
							<tr>
							<?php 
							$a = 0;
							foreach ($jadwal_pemeriksaan->result() as $row) { $a++;
							?>
								<td><div align="center"><?php echo $a; ?></div></td>
								<td><div align="center"><?php echo $this->tanggalhelper->convertDayDate($row->tanggal_pemeriksaan); ?><br/><?php echo substr($row->mulai_jam,0,5); ?> s/d <?php echo substr($row->sampai_jam,0,5); ?></div></td>
								<td><?php echo $row->ruangan; ?> </td>
								<td><?php echo $row->agenda; ?></td>
								<?php if ($canEditDataPK){ ?>
								<td><div align="center">
									<?php if($a==$urutan_jadwal){ ?>
									<input type="submit" onClick="popup_form('<?php echo base_url();?>edit_jadwal_pemeriksaan/<?php echo $row->perkara_id; ?>/<?php echo $row->urutan; ?>');" value="Edit" id="cetak_reg" class="btn"></input>
									<input type="submit" onClick="popup_form('<?php echo base_url();?>tunda_jadwal_pemeriksaan/<?php echo $row->perkara_id; ?>/<?php echo $row->urutan; ?>');" value="Tunda" id="cetak_reg" class="btn"></input>
									<?php } ?>
									</div>
								</td>
								<?php } ?>
							</tr>
							<?php }  ?>
							</tbody>
						</table>
					</div>
				</td>

				
			</tr>
			
			<?php
	  		if($alur_perkara_id>100){
	  		?>
	  		<tr>
				<td id="first-child"></td>
				<td colspan="2" style="text-align:right">
					<?php if ($canEditDataPK){
						echo '<a href="#" onClick="popup_form(\''.base_url('detil_pk/edit_pendapat_pu/'.$perkaraid).'\')">[Edit - Pendapat Penuntut Umum]</a>';
					}
				?>
				</td>
			</tr>
			<tr>
				<td id="first-child">Tanggal Pendapat  <?php echo $this->nativesession->getStatusPihak(10,$alur_perkara_id,1);?></td>
				<td colspan="2"><?php echo $tgl_jaksa;?></td>
			</tr>

			<tr>
				<td id="first-child">Isi Pendapat <?php echo $this->nativesession->getStatusPihak(10,$alur_perkara_id,1);?>	</td>
				<td colspan="2"><?php echo $jaksa;?></td>
			</tr>
			<tr>
				<td id="first-child"></td>
				<td colspan="2" style="text-align:right">
					<?php if ($canEditDataPK){
						echo '<a href="#" onClick="popup_form(\''.base_url('detil_pk/edit_pendapat_hakim/'.$perkaraid).'\')">[Edit - Pendapat Hakim]</a>';
					}
				?>
				</td>
			</tr>
			<tr>
				<td id="first-child">Tanggal Pendapat Hakim</td>
				<td colspan="2"><?php echo $tgl_hakim;?></td>
			</tr>
			<tr>
				<td id="first-child">Isi Pendapat Hakim</td>
				<td colspan="2"><?php echo $hakim;?></td>
			</tr>
			<?php
			}
			if($alur_perkara_id<100){
			?>
			<tr>
				<td id="first-child">Tanggal Sumpah</td>
				<td colspan="2"><?php echo $tgl_sumpah;?></td>
			</tr>
			<?php
			}
			if($tgl_pemeriksaan != null){
			?>
			<tr>
				<td id="first-child">Cetak Dokumen<font color="red">*</font></td>
				<td  colspan="2" style="padding:0px;padding-left:5px;">
				<?php
				 	   if ($alur_perkara_id==120) {
				 		?>
						<a href="#" onClick=cetakBAPPkMil();><img src="<?php echo base_url();?>resources/img/nm_icon_doc.gif">Cetak Berita Acara Pemerikasaan (BAP)</a>
				 		<?php
						}else{
						?>
						<a href="#">Template belum ada</a>
				<?php } ?>
				</td>
			</tr>
			<?php }
			}
			?>
		</tbody>
	</table>

	<div style="padding:5px;"></div>
	<table id='infoPerkara' style="font-size:14px;width:100%;">
		<col width="20%">
		<col width="">
		<col width="300px">
		<tbody>
			<tr >
				<td style="background-color:#A3DBA8;padding:5px;" colspan="3"><strong>Tanggal Pengiriman Berkas PK</td>
			</tr>
			<tr>
				<td style="padding:1px;"></td>
			</tr>
			<tr>
				<td id="first-child">Tanggal Pengiriman Berkas PK</td>
				<td><?php echo $tglpengiriman;?></td>
				<td style="text-align:right">
				<?php
				$idpihak = base64_encode($this->encrypt->encode(3));
				if ($canEditDataPK){
					echo '<a href="#" onClick="popup_form(\''.base_url('edittanggalpk/'.$idpihak.'/'.$enc).'/7\')">[Edit - Tanggal Pengiriman Berkas PK]</a>';
				}
				?>
				</td>
			</tr>
			<tr>
				<td id="first-child">Nomor Surat Pengiriman Berkas PK</td>
				<td colspan="2"><?php echo $nokirimberkara;?></td>
			</tr>
		</tbody>
	</table>
	<div style="padding:5px;"></div>
	<table id='infoPerkara' style="font-size:14px;width:100%;">
		<col width="20%">
		<col width="">
		<col width="150px">
		<tbody>
			<tr >
				<td style="background-color:#A3DBA8;padding:5px;" colspan="3"><strong>Putusan PK</td>
			</tr>
			<tr>
				<td style="padding:1px;"></td>
			</tr>
			<tr>
				<td id="first-child">Tanggal Putusan PK</td>
				<td><?php echo $tglputusanpt;?></td>
				<td style="text-align:right">
				<?php
				if ($canEditDataPutusanPK){
					echo '<a href="#" onClick="popup_form(\''.base_url('editputusanpk/'.$enc).'\')">[Edit - Putusan PK]</a>';
				}
				?><br>
                                        <?php if(!$putusanpk == null){ ?>
                                    <a href="<?php echo base_url('api/Putusan/download_file/'.$perkaraid.'/3');?>" id="noLoading">[UNDUH - Dokumen Putusan PK]</a>
                                        <?php }else{ 
                                            echo "<a href=".base_url('api/Putusan/cekstatus/'.$perkaraid.'/3')." id=noLoading target=_blank>[SYNC - Status Berkas PK]</a>";
                                        }?>
                                </td>
			</tr>
			<tr>
				<td id="first-child">Nomor Putusan PK</td>
				<td colspan="2"><?php echo $noperkarapk;?></td>
			</tr>
			<tr>
				<td id="first-child">Status Putusan PK</td>
				<td colspan="2"><?php echo $statusputusanpk;?></td>
			</tr>
			<tr>
				<td id="first-child">Amar Putusan PK</td>
				<td colspan="2"><?php echo $amar;?></td>
			</tr>
			<tr>
				<td id="first-child">Majelis Hakim PK</td>
				<td colspan="2"><?php echo $majelis;?></td>
			</tr>
			<tr>
				<td id="first-child">Panitera</td>
				<td colspan="2"><?php echo $panitera;?></td>
			</tr>
			<tr>
				<td id="first-child">Tanggal Penerimaan Kembali Berkas PK</td>
				<td colspan="2"><?php echo $terimaberkas;?></td>
			</tr>
			<tr>
				<td id="first-child">Tanggal Pengarsipan PK</td>
				<td colspan="2"><?php echo $minutasipt;?></td>
			</tr>
		</tbody>
	</table>
	<div style="padding:5px;"></div>
	<table id='infoPerkara' style="font-size:14px;width:100%;">
		<tbody>
			<tr>
				<td style="background-color:#A3DBA8;padding:5px;" colspan="2"><strong>Tanggal Pemberitahuan Putusan PK</td>
			</tr>
		</tbody>
	</table>
	<div style="padding:1px;"></div>
	<input type="hidden" id='close_form' class='close_form' value="Kembali" class="btn">
	<div class="cssTable" style="margin:0px;padding:0px;">
		<table id="tableinfo" style="font-size14px"; width:100%;">
			<col width="5%" />
			<col width="15%" />
			<col width="50%" />
			<col width="12%" />
			<?php if (($alur_perkara_id==='111' or $alur_perkara_id=='9') && $canCetakDokumen) {?>
			<col width="10%" />
			<?php }
			if ($canEditPemberitahuanPutusan){?>
			<col width="5%" />
			<?php } ?>
			<tbody>
				<tr>
					<td>No</td>
					<td>Status</td>
					<td>Nama</td>
					<td>Tanggal</td>
					<?php if (($alur_perkara_id==='111' or $alur_perkara_id=='9') && $canCetakDokumen) {?>
					<td>Cetak Dokumen</td>
					<?php }
					if ($canEditPemberitahuanPutusan){?>
					<td></td>
					<?php } ?>
				</tr>
				<?php
				if($infopkdetil!=''){
					if($infopkdetil->num_rows>0){
						$i=1;
						foreach ($infopkdetil->result() as $row) {
							if(!empty($row->pihak_asal) AND !empty($row->pihak_id)){
								$idpihak = base64_encode($this->encrypt->encode($row->pihak_id));
								$pihakasal = base64_encode($this->encrypt->encode($row->pihak_asal));
							}
							echo '<tr>';
								echo '<td style="text-align:center">'.$i.'</td>';
								echo '<td>'.$row->status_pihak_text.'('.$row->pihak_asal_text.')</td>';
								echo '<td>'.$row->pihak_nama.'</td>';
								echo '<td style="text-align:center">'.$this->tanggalhelper->convertDayDate($row->pemberitahuan_putusan_pk).'</td>';
								if (($alur_perkara_id==='111' or $alur_perkara_id=='9') && $canCetakDokumen){
									echo "<td align='center'>";
									if (!empty($row->pemberitahuan_putusan_pk)){
										if ($alur_perkara_id==='111') {?>
											<a href="#" onClick="popup_form('<?php echo base_url("c_template_relaas_pemberitahuan_permintaan_pk/popup_relass_pemberitahuan_pk/".$enc."/".$pihakasal);?>')">
											<img src="<?php echo base_url();?>resources/img/nm_icon_doc.gif"></a>
										<?php }
										if ($alur_perkara_id==='9') {?>
											<a href="#" onClick="popup_form('<?php echo base_url("c_template_tun_peninjauan_kembali/popup_tun_pemberitahuan_pk/".$enc."/".$pihakasal."/".$idpihak."/3");?>')">
											<img src="<?php echo base_url();?>resources/img/nm_icon_doc.gif"></a>
										<?php }
									}else{echo "Tanggal kosong, belum dapat cetak dokumen";}
									echo "</td>";
								}
									if ($canEditPemberitahuanPutusan){
										$idpihak = base64_encode($this->encrypt->encode($row->pihak_id));
										$enc_id = base64_encode($this->encrypt->encode($row->id));
										echo '<td align="center" style="cursor:pointer;"><a href="#" onClick="popup_form(\''.base_url('edittanggalpk/'.$idpihak.'/'.$enc_id).'/8\')">[Edit]</a></td>';
									}
							echo '</tr>';
							$i++;
						}
					}
				}
				?>
			</tbody>
		</table>
	</div>
		<div style="padding:5px;"></div>
	<table id='infoPerkara' style="font-size:14px;width:100%;">
		<col width="25%">
		<col width="50%">
        <col width="25%">
		<tbody>
		<tr >
				<td style="background-color:#A3DBA8;padding:5px;" colspan="3"><strong>Upload dokumen elektronik
				<br><?php if (trim($datakas->filename)!='') { ?>
                               <a href="<?php echo base_url('api/Putusan/add_file_pendukung/'.$perkaraid.'/4');?>" id="noLoading" target="_blank">[Kirim - File Pendukung]</a>
                               <?php }else{ echo "";}?>
                              </td>
			</tr>
				<tr>
				<td style="padding:1px;"></td>
			</tr>
			<!-- mulai form dinamis -->
     <?php
												if($infopkdetil!=''){

		    if($infopkdetil->num_rows>0){
						foreach ($infopkdetil->result() as $row2) {

				 $pkr_id=$perkaraid_pk;
				 $jenis_pengadilan = $jenispengadilan_pk;
				 $pkids = $row2->pk_id;
				 $ci =&get_instance();
				 $ci->load->model('api/dirput_model','dirput');
				 $datakass=$ci->dirput->ambil_dokumen($pkr_id,$jenis_pengadilan,4,$pkids,$alur_perkara_id);
         //echo"<pre>";
				 //print_r($datakass->result());exit;
			 ?>

				<tr >
							<td colspan="3" id="first-child">
							<?php
								echo $row2->status_pihak_text.' '.$this->templatehelper->converToAngkaRomawi($row2->urutan_kasasi).' ('.$row2->pihak_asal_text.') : ';
								if($row2->pihak_diwakili=='Y')
												echo $pemohon = $row2->pemohon_pk;
											else
												echo $pemohon = $row2->pihak_nama;
								//echo ' idupyadetil :'+$pkids;
								?>
							</td>
							</tr>
				<?php
								if ($datakass->num_rows>0) {
									$urutan=1;
				        foreach ($datakass -> result() as $datakas ) {
   						$urls='upload_dirput/tampil_edit/4/'.$pkids;
        ?>

						<tr >
							<td id="first-child"><?php echo $datakas->keterangan_file; ?></td>
							<td>
							<input type="hidden" name="kasasi_id" value="<?php echo $datakas->pihak_detil_id;?>">
							<?php
							if (trim($datakas->filename)!='') {
							?>
							 <a id="noLoading" target="_self" href="<?php echo base_url($datakas->path_filename);?>">Unduh Dokumen</a>
							<?php } else { echo '-' ;}

							?>
							</td>
							<?php
							if ($urutan==1) { ?>
							<td style="text-align:right">
							<a href="#" onClick="popup_form('<?php echo base_url($urls) ;?>')">[Upload dokumen elektronik]</a>
                                                        <br>
                                                        <?php 										
											if (trim($datakas->filename)!='') { 
											?>
                                                        <a href="<?php base_url('api/Putusan/add_file_pendukung/'.$perkaraid.'/4');?>" id="noLoading" target="_blank">[Kirim - File Pendukung]</a>
                                                                                        <?php }else{ echo "";}?>
                                                        </td>
							<?php
              $urutan=0;
							} ?>	</tr>
									 <?php
						}//end forech2

					}//end  jika disput > 0
							 else {

								 if ($doc_referensi->num_rows>0) {
										 // echo"<pre>";
									 // print_r($doc_referensi->result());exit;
									 $urls='upload_dirput/tampil_edit/4/'.$pkids;
										 foreach($doc_referensi->result() as $docs) {
										#-------------
						?>			   	<tr >
										<td id="first-child"><?php echo $docs->keterangan_file; ?></td>
										<td>
										<input type="hidden" name="upayapihak_id" value="<?php echo $pkids;?>">
										-
										</td>
										<?php
										if (($docs->urutan)==1) { ?>
										<td style="text-align:right">
										<a href="#" onClick="popup_form('<?php echo base_url($urls) ;?>')">[Upload dokumen elektronik]</a>
										</td>
										<?php

										} ?>	</tr>


							<?php
											#------------------
									 }


								 }


							 }//end dirput <0



				 }//end forach info kasasi


			 }//jika infokaasi >0
		}
?>

<!-- selesai -->
			</tbody>
			</table>
</div>
<script type="text/javascript">
function cetakTapsidPkMil(){
	    window.open('<?php echo base_url("c_template_pk_pemeriksaan/cetakTapsidPkMil/".$enc."/2");?>','_self');
}

function cetakBAPPkMil(){
	    window.open('<?php echo base_url("c_template_pk_pemeriksaan/cetakBAPPkMil/".$enc."/1");?>','_self');
}

function cetakBAPendapat(){
	    window.open('<?php echo base_url("c_template_pk_pemeriksaan/cetakBAPendapat/".$enc."/1");?>','_self');
}

$('#detilpk').on('click', '.close_form', function(event) {
	openLoadingDialog();
	window.open('<?php echo $history;?>','_self');
})

$('#detilpk').on('click', '#goback', function(event) {
	openLoadingDialog();
	window.open('<?php echo $main_history;?>','_self');
	closeLoading()
})
    function pilih_cetak(ele){
        if (ele.value!=1) {
            popup_form(ele.value);
            $(ele).val('1');
        }
    }
</script>
