<?php
	$canEditDataKasasi = $this->authorization->HasRuleEditDataKasasi($alur_perkara_id, $perkaraid);
	$canEditDataPutusanKasasi = $this->authorization->HasRuleEditPutusanDataKasasi($alur_perkara_id, $perkaraid);
	$canCetakDokumen = $this->authorization->HasRuleCetakDokumenUpayaHukum($alur_perkara_id, $perkaraid);
	$canEditPemberitahuanPutusan = $this->authorization->HasRuleEditPemberitahuanPutusanKasasi($alur_perkara_id, $perkaraid);
	if($infokasasi!=''){
		if($infokasasi->num_rows>0){
			foreach ($infokasasi->result() as $row) {
				$noperkarapn = $row->nomor_perkara_pn;
				$tglputusanpn = $this->tanggalhelper->convertDayDate($row->putusan_pn);
				$nokirimberkara = $row->nomor_surat_pengiriman_berkas_kasasi;
				$tglpengiriman = $this->tanggalhelper->convertDayDate($row->pengiriman_berkas_kasasi);
				$tglputusanpt = $this->tanggalhelper->convertDayDate($row->putusan_kasasi);
				$terimaberkas = $this->tanggalhelper->convertDayDate($row->penerimaan_berkas_kasasi);
				$minutasipt = $this->tanggalhelper->convertDayDate($row->minutasi_kasasi);
				$noperkarakasasi = $row->nomor_perkara_kasasi;
				$noputusankasasi = $row->nomor_putusan_kasasi;
				$statusputusankasasi = $row->status_putusan_kasasi_text;
				$majelis = $row->majelis_hakim_kasasi;
				$panitera = $row->panitera_pengganti_kasasi;
				$amar = $row->amar_putusan_kasasi;
			}
			$tahapanid = base64_encode($this->encrypt->encode(30));
		}
	}else{
		echo json_encode(array('st'=>0,'msg'=>'data kasasi kosong'));
			return;
	}
	
	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'];
				$jenis_putusan = $row['amar'];
				$bht = $row['bht'];
			}
			$tahapanid = base64_encode($this->encrypt->encode(30));
		}
	      else {
					echo json_encode(array('st'=>0,'msg'=>'data kasasi kosong'));
						return;
	   }
	
	
	$idjenisperkara = $this->tanggalhelper->getIDJenisPerkara($perkaraid);
	$url = base_url("hapusKasasi/".$enc);

	
?>


<hr class="thick-line" style="clear:both;">
<div style="font-size:14px;padding-left:5px;" id="detilkasasi">
	<table id='infoPerkara' style="font-size:14px;width:100%;" border="0">
		<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>				
				<?php if ($this->authorization->HasRuleHapusDataUpayaHukum($alur_perkara_id)){ ?>
				<td style="text-align:right;" colspan="2"><a style="color:white" href='##' onclick="popup_form('<?php echo $url;?>')" class="btn btn-danger btn-sm">Hapus</a></td>
				<?php } ?>
			</tr>
			<tr >
				<td style="background-color:#A3DBA8;padding:5px;" colspan="2"><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>		
		
				<td></td>
			</tr>
		</tbody>
	</table>
		<div style="padding:5px;"></div>
	<?php
	if($surat_pengantar!=''){
		if($surat_pengantar->num_rows>0){
			$data_surat=$surat_pengantar->row();
			//echo $data_surat->path_filename; 
			//exit();
			$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
		  {
			  
			$pengajuan=0;  
			  
		  }
	

}	
	?>
	<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 xxx</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 ($canEditDataKasasi){
					$idpihak = base64_encode($this->encrypt->encode(3));
				 $urls='editpengantar/3';
				?>
                <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=_self 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=_self 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_kasasi/'.$perkaraid).'>[Upload pengajuan Kasasi]</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 ($canEditDataKasasi){ ?>
			<col width="5%" />
			<?php } ?>
			<tbody>
				<tr>
					<td>No</td>
					<td>Status</td>
					<td>Nama</td>
					<td>Diwakili</td>
					<td>Diwakili Oleh</td>
					<?php if ($canEditDataKasasi){ ?>
					<td></td>
					<?php }?>					
				</tr>
				<?php
				if($infokasasidetil!=''){
					if($infokasasidetil->num_rows>0){
						$i=1;
						foreach ($infokasasidetil->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.' '.$this->templatehelper->converToAngkaRomawi($row->urutan_kasasi).' ('.$row->pihak_asal_text.')</td>';
								echo '<td>'.$row->pihak_nama.'</td>';
								echo '<td style="text-align:center">'.$diwakili.'</td>';
								echo '<td>'.$pemohon.'</td>';
								if($canEditDataKasasi){
									if($edit==TRUE){
										$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('editkasasi/'.$idpihak.'/'.$enc_id).'\')">[EDIT]</a></td>';
									}else{
										echo "<td></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 Kasasi</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="40%" />
			<col width="15%" />
			<?php if (($alur_perkara_id==='15' OR $alur_perkara_id==='111' OR $alur_perkara_id==9 OR $alur_perkara_id==120) && $canCetakDokumen && $this->session->userdata('idgroup')!=600) {?>
			<col width="15%" />
			<?php } 
			if ($canEditDataKasasi){?>
			<col width="15%" />
			<?php } ?>
			<tbody>
				<tr>
					<td>Tanggal Permohonan</td>
					<td>Pemohon kasasi</td>
					<td>Keterangan</td>
					<?php 
					if (($alur_perkara_id==='15' OR $alur_perkara_id==='111' OR $alur_perkara_id==9 OR $alur_perkara_id==120)  && $canCetakDokumen && $this->session->userdata('idgroup')!=600) {
						echo '<td>Cetak Dokumen Akta</td>';
					} 
					if ($canEditDataKasasi){?>
					<td></td>
					<?php } ?>
				</tr>
				<?php
				if($infokasasidetil!=''){
					if($infokasasidetil->num_rows>0){
						foreach ($infokasasidetil->result() as $row) {
							$diwakili = ($row->pihak_diwakili=='Y')? 'Ya':'Tidak';
							if($diwakili=='Y'){
								$pemohon = $row->pemohon_kasasi;
							}else{
								$pemohon = $row->pemohon_nama.'<br>'.$row->pekerjaan.'<br>'.$row->pemohon_alamat;
							}
							$editable = TRUE;														
							if(!empty($row->tanggal_cabut)){
								$status = 'Permohonan kasasi Telah Dicabut Pada '.$this->tanggalhelper->convertDayDate($row->tanggal_cabut);
								$editable = FALSE;
								$keterangan=$status.'<br>Keterangan: '.$row->catatan_putusan_kasasi;
								$centering='style="text-align:left"';
							}elseif(!empty($row->tidak_memenuhi_syarat)){
								$status = 'Permohonan kasasi TMS Pada '.$this->tanggalhelper->convertDayDate($row->tidak_memenuhi_syarat);
								$editable = FALSE;
								$keterangan=$status.'<br>Keterangan: '.$row->catatan_putusan_kasasi;
								$centering='style="text-align:left"';
							}else{
								$keterangan = '-';
								$centering='style="text-align:center"';
							}

							if(!empty($row->tidak_memenuhi_syarat)){
								$status = 'Permohonan kasasi Telah Dinyatakan Tidak Memenuhi Syarat Pada '.$this->tanggalhelper->convertDayDate($row->tidak_memenuhi_syarat);
								$editable = FALSE;
							}

							if(!empty($row->permohonan_kasasi)){
								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_kasasi).'</td>';
									echo '<td>'.$pemohon.'</td>';
									echo '<td '.$centering.'>'.$keterangan.'</td>';
									if (($alur_perkara_id==='15' OR $alur_perkara_id==='111' OR $alur_perkara_id==9 OR $alur_perkara_id==120)  && $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 Akta</option>
														<option value="<?php echo base_url("c_template_akta_permohonan_kasasi_pid/popup_akta_permohonan_kasasi/".$enc."/".$pihakasal."/".$encpemohon."/1");?>">Akta Permohonan Kasasi</option>
														<option value="<?php echo base_url("c_template_akta_permohonan_kasasi_pid/popup_cabut_kasasi/".$enc."/".$pihakasal."/".$encpemohon);?>">Akta Pencabutan Kasasi</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_akta_permintaan_kasasi2/popup_tun_akta_akta_cabut_kasasi/".$enc."/".$pihakasal."/".$encpemohon);?>')">
													<img src="<?php echo base_url();?>resources/img/nm_icon_doc.gif"></a>
											<?php } else { ?>
													<a href="#" onClick="popup_form('<?php echo base_url("c_template_tun_akta_permintaan_kasasi2/popup_tun_pemberitahuan_kasasi/".$enc."/".$pihakasal."/".$encpemohon."/1");?>')">
													<img src="<?php echo base_url();?>resources/img/nm_icon_doc.gif"></a>
											<?php } ?>
										<?php
										}
										elseif ($alur_perkara_id==15) {?>
											<?php if(!empty($row->tanggal_cabut)){ ?>
													<a href="#" onClick="popup_form('<?php echo base_url("c_template_agama_kasasi/popup_akta_kasasi/".$enc."/".$pihakasal."/".$encpemohon."/2");?>')">
													<img src="<?php echo base_url();?>resources/img/nm_icon_doc.gif"></a>
											<?php } elseif(!empty($row->tidak_memenuhi_syarat)) { ?>
													<a href="#" onClick="popup_form('<?php echo base_url("c_template_agama_kasasi/popup_akta_kasasi/".$enc."/".$pihakasal."/".$encpemohon."/3");?>')">
													<img src="<?php echo base_url();?>resources/img/nm_icon_doc.gif"></a>											
											<?php } else { ?>
													<a href="#" onClick="popup_form('<?php echo base_url("c_template_agama_kasasi/popup_akta_kasasi/".$enc."/".$pihakasal."/".$encpemohon."/1");?>')">
													<img src="<?php echo base_url();?>resources/img/nm_icon_doc.gif"></a>
											<?php } ?>
										<?php
										}
										elseif ($alur_perkara_id==120){ 
											$encpemohon = base64_encode($this->encrypt->encode($row->pemohon_id));
											?>
												<span class="custom-dropdown custom-dropdown--emerald">
													<select onchange="pilih_cetak(this)" style="width:150px;z-index:99999" class="custom-dropdown__select custom-dropdown__select--white">
														<option value='1'>Pilih Dokumen</option>
													<?php if(empty($row->tanggal_cabut) and empty($row->tidak_memenuhi_syarat)){ ?>
														<option value="<?php echo base_url("c_template_mil_akta_penerimaan_memori_kasasi_terdakwa/popup_akta_permohonan_kasasi/".$enc."/".$pihakasal."/".$encpemohon."/1");?>">Akta Permohonan Kasasi</option>
														<option value="<?php echo base_url("c_template_mil_akta_penerimaan_memori_kasasi_terdakwa/popup_akta_permohonan_kasasi/".$enc."/".$pihakasal."/".$encpemohon."/8");?>">Akta Terlambat Mengajukan Kasasi</option>
													<?php }
													if(!empty($row->tanggal_cabut)){ ?>
														<option value="<?php echo base_url("c_template_mil_akta_penerimaan_memori_kasasi_terdakwa/popup_akta_permohonan_kasasi/".$enc."/".$pihakasal."/".$encpemohon."/1c");?>">Akta Pencabutan Permohonan Kasasi</option>
														<option value="<?php echo base_url("c_template_mil_akta_penerimaan_memori_kasasi_terdakwa/popup_akta_permohonan_kasasi/".$enc."/".$pihakasal."/".$encpemohon."/1pc");?>">Akta Pemberitahuan Pencabutan Permohonan Kasasi</option>
													<?php }
														if(!empty($row->tidak_memenuhi_syarat)){ ?>
														<option value="<?php echo base_url("c_template_mil_akta_penerimaan_memori_kasasi_terdakwa/popup_akta_permohonan_kasasi/".$enc."/".$pihakasal."/".$encpemohon."/13");?>">Penetapan Permohonan Kasasi Tidak Dapat Diterima</option>
													<?php } ?>
													</select>
												</span>
										<?php
										}else{
											echo "Tanggal kosong, belum dapat cetak dokumen";
										}
										echo "</td>";
									}
								    if ($canEditDataKasasi){
								    	echo '<td align="center" style="cursor:pointer;">';
								    	if ($editable && $canEditDataKasasi){
											$enc = base64_encode($this->encrypt->encode($row->perkara_id));
											$enc_id = base64_encode($this->encrypt->encode($row->id));
											echo '<a href="##" onClick="popup_form(\''.base_url('cabutpermohonankasasi/'.$enc.'/'.$enc_id).'\')">[CABUT]</a>||<a href="#" onClick="popup_form(\''.base_url('editpermohonankasasi/'.$enc.'/'.$enc_id).'\')">[EDIT]</a>||<a href="#" onClick="popup_form(\''.base_url('tmspermohonankasasi/'.$enc.'/'.$enc_id).'\')">[TMS]</a></td>';
										}
										echo '</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) {
						$nama_mediator 				= $row->mediator_text;
						$mediator_text 				= $row->mediator_text;
						$status_mediator 			= $row->status_mediator;
						$keterangan 				= $row->catatan_mediasi;
						$tgl_kesepakatan 			= $this->tanggalhelper->convertDayDate($row->tgl_kesepakatan_perdamaian);
						$tgl_pengajuan_kesepakatan 	= $this->tanggalhelper->convertDayDate($row->tgl_pengajuan_kesepakatan);
						$tgl_pengiriman_kesepakatan = $this->tanggalhelper->convertDayDate($row->tgl_kirim_kesepakatan_ke_ptma);
						$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 ($canEditDataKasasi){
							echo '<a href="##" onClick="popup_form(\''.base_url('editmediasibanding/'.$enc.$enc_id).'\')">[Edit - 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($mediator_text!=''){
                    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($mediator_text,"<br/>");
		                            $mediator_text  = explode("<br/>",$mediator_text);
		                            $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>
			</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 Kasasi</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="15%" />
			<col width="45%" />
			<col width="12%" />
			<?php if (($alur_perkara_id=='111' OR $alur_perkara_id=='9' or $alur_perkara_id=='120' or $alur_perkara_id=='15') && $canCetakDokumen) {?>
			<col width="18%" />
			<?php } 
			if ($canEditDataKasasi){?>
			<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' or $alur_perkara_id=='120' or $alur_perkara_id=='15') && $canCetakDokumen) {?>
					<td>Cetak Dokumen Relaas</td>
					<?php } 
					if ($canEditDataKasasi){?>
					<td></td>
					<?php } ?>
				</tr>
				<?php
				if($infokasasidetil!=''){
					if($infokasasidetil->num_rows>0){
						$i=1;
						foreach ($infokasasidetil->result() as $row) {
							if($row->status_pihak_id>1){
								if(!empty($row->pihak_asal) AND !empty($row->pihak_id)){
									$pihakasal = $row->pihak_asal;								
								}
								if($row->pihak_diwakili=='Y')
									$pemohon = $row->pemohon_kasasi;
								else
									$pemohon = $row->pihak_nama;
								$encpihak = base64_encode($this->encrypt->encode($row->pihak_id));
								$encpemohon = base64_encode($this->encrypt->encode($row->pemohon_id));
								echo '<tr>';
									echo '<td align="center">'.$i.'</td>';
									echo '<td>'.$row->status_pihak_text.' '.$this->templatehelper->converToAngkaRomawi($row->urutan_kasasi).' ('.$row->pihak_asal_text.')</td>';
									echo '<td>'.$pemohon.'</td>';
									echo '<td align="center">'.$this->tanggalhelper->convertDayDate($row->pemberitahuan_kasasi).'</td>';
									if (($alur_perkara_id=='111' OR $alur_perkara_id=='9' or $alur_perkara_id=='120' or $alur_perkara_id=='15') && $canCetakDokumen){
										echo "<td align='center'>";
										if (!empty($row->pemberitahuan_kasasi)){
											if ($alur_perkara_id==='111') {?>
												<a href="#" onClick="popup_form('<?php echo base_url("c_template_relaas_pidana_kasasi/popup_relaas_kasasi/".$enc."/".$pihakasal."/".$encpihak."/1");?>')">
												<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_akta_permintaan_kasasi2/popup_tun_pemberitahuan_kasasi/".$enc."/".$pihakasal."/".$encpihak."/1");?>')">
												<img src="<?php echo base_url();?>resources/img/nm_icon_doc.gif"></a>
											<?php 
											} elseif ($alur_perkara_id==120) {?>
												<a href="#" onClick="popup_form('<?php echo base_url("c_template_mil_akta_penerimaan_memori_kasasi_terdakwa/popup_akta_permohonan_kasasi/".$enc."/".$pihakasal."/".$encpemohon."/2");?>')">
												<img src="<?php echo base_url();?>resources/img/nm_icon_doc.gif"></a>
											<?php 
											}elseif ($alur_perkara_id==15) {?>
												<a href="#" onClick="popup_form('<?php echo base_url("c_template_agama_kasasi_tri/popup_relaas_kasasi/".$enc."/".$pihakasal."/".$encpihak."/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 ($canEditDataKasasi){
										$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('edittanggalkasasi/'.$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 Kasasi</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="15%" />
			<col width="45%" />
			<col width="12%" />
			<?php if (($alur_perkara_id==15 OR $alur_perkara_id==111 OR $alur_perkara_id==120)&& $canCetakDokumen && $this->session->userdata('idgroup')!=600) {?>
			<col width="18%" />
			<?php } 
			if ($canEditDataKasasi){?>
			<col width="5%" />
			<?php } ?>
			<tbody>
				<tr>
					<td>No</td>
					<td>Status</td>
					<td>Nama</td>
					<td>Tanggal</td>
					<?php if (($alur_perkara_id==15 OR $alur_perkara_id==111 OR $alur_perkara_id==120) && $canCetakDokumen && $this->session->userdata('idgroup')!=600) {?>
					<td>Cetak Dokumen Akta</td>
					<?php } 
					if ($canEditDataKasasi){?>
					<td></td>
					<?php } ?>
				</tr>
				<?php
				if($infokasasidetil!=''){
					if($infokasasidetil->num_rows>0){
						$i=1;
						foreach ($infokasasidetil->result() as $row) {
							if($row->status_pihak_id==5 OR $row->status_pihak_id==2 OR $row->status_pihak_id==1){
								/*didik*/
								if(!empty($row->pihak_asal) AND !empty($row->pihak_id)){
									$pihakasal = $row->pihak_asal;
								if($row->pihak_diwakili=='Y')
									$pemohon = $row->pemohon_kasasi;
								else
									$pemohon = $row->pihak_nama;								
								}
								$encpihak = base64_encode($this->encrypt->encode($row->pihak_id));/**/
								$encpemohon = base64_encode($this->encrypt->encode($row->pemohon_id));
								echo '<tr>';
									echo '<td align="center">'.$i.'</td>';
									echo '<td>'.$row->status_pihak_text.' '.$this->templatehelper->converToAngkaRomawi($row->urutan_kasasi).' ('.$row->pihak_asal_text.')</td>';
									echo '<td>'.$pemohon.'</td>';
									echo '<td align="center">'.$this->tanggalhelper->convertDayDate($row->penerimaan_memori_kasasi).'</td>';
									if (($alur_perkara_id==15 OR $alur_perkara_id==111 OR $alur_perkara_id==120) && $canCetakDokumen && $this->session->userdata('idgroup')!=600) {
										echo "<td align='center'>";
										if (!empty($row->penerimaan_memori_kasasi)){
											if ($alur_perkara_id==111) {?>
													<a href="#" onClick="popup_form('<?php echo base_url("c_template_akta_penerimaan_memori_kasasi_terdakwa/popup_akta_penerimaan_memori_kasasi/".$enc."/".$pihakasal);?>')">
													<img src="<?php echo base_url();?>resources/img/nm_icon_doc.gif"></a>
											<?php
											}elseif ($alur_perkara_id==15) {?>
													<a href="#" onClick="popup_form('<?php echo base_url("c_template_agama_kasasi/popup_akta_kasasi/".$enc."/".$pihakasal."/".$encpemohon."/4");?>')">
													<img src="<?php echo base_url();?>resources/img/nm_icon_doc.gif"></a>
											<?php
											}elseif ($alur_perkara_id==120) {
											?>
													<span class="custom-dropdown custom-dropdown--emerald">
														<select onchange="pilih_cetak(this)" style="width:150px;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_mil_akta_penerimaan_memori_kasasi_terdakwa/popup_akta_permohonan_kasasi/".$enc."/".$pihakasal."/".$encpemohon."/3");?>">Akta Peneriman Memori Kasasi</option>
													<?php if ($pihakasal==1){ ?>
															<option value="<?php echo base_url("c_template_mil_akta_penerimaan_memori_kasasi_terdakwa/popup_akta_permohonan_kasasi/".$enc."/".$pihakasal."/".$encpemohon."/9");?>">Akta Penerimaan Risalah Kasasi</option>
													<?php } ?>
															<option value="<?php echo base_url("c_template_mil_akta_penerimaan_memori_kasasi_terdakwa/popup_akta_permohonan_kasasi/".$enc."/".$pihakasal."/".$encpemohon."/10");?>">Akta Tidak Menyerahkan Memori Kasasi</option>
														</select>
													</span>
											<?php 
											}								    
										}else{
											echo "Tanggal kosong, belum dapat cetak dokumen";
										}
										echo "</td>";
									}
								    if ($canEditDataKasasi){
										$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('edittanggalkasasi/'.$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 Kasasi</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="15%" />
			<col width="45%" />
			<col width="12%" />
			<?php if (($alur_perkara_id=='111' OR $alur_perkara_id==9 OR $alur_perkara_id==120 OR $alur_perkara_id==15) && $canCetakDokumen) {?>
			<col width="18%" />
			<?php } 
			if ($canEditDataKasasi){?>
			<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  OR $alur_perkara_id==120 OR $alur_perkara_id==15) && $canCetakDokumen) {?>
					<td>Cetak Dokumen Relaas</td>
					<?php } 
					if ($canEditDataKasasi){?>
					<td></td>
					<?php } ?>
				</tr>
				<?php
				if($infokasasidetil!=''){
					if($infokasasidetil->num_rows>0){
						$i=1;
						foreach ($infokasasidetil->result() as $row) {
							if($row->status_pihak_id>1){
								/*didik*/
								if(!empty($row->pihak_asal) AND !empty($row->pihak_id)){
									$pihakasal = $row->pihak_asal;								
								}
								if($row->pihak_diwakili=='Y')
									$pemohon = $row->pemohon_kasasi;
								else
									$pemohon = $row->pihak_nama;
									$encpihak = base64_encode($this->encrypt->encode($row->pihak_id));/**/
								echo '<tr>';
									echo '<td align="center">'.$i.'</td>';
									echo '<td>'.$row->status_pihak_text.' '.$this->templatehelper->converToAngkaRomawi($row->urutan_kasasi).' ('.$row->pihak_asal_text.')</td>';
									echo '<td>'.$pemohon.'</td>';
									echo '<td align="center">'.$this->tanggalhelper->convertDayDate($row->penyerahan_memori_kasasi).'</td>';
									if (($alur_perkara_id==='111' OR $alur_perkara_id==9  OR $alur_perkara_id==120 OR $alur_perkara_id==15) && $canCetakDokumen){
										echo "<td align='center'>";
										if (!empty($row->penyerahan_memori_kasasi)){
											if ($alur_perkara_id==='111') {?>
													<a href="#" onClick="popup_form('<?php echo base_url("c_template_relaas_pidana_kasasi/popup_relaas_kasasi/".$enc."/".$pihakasal."/".$encpihak."/2");?>')">
													<img src="<?php echo base_url();?>resources/img/nm_icon_doc.gif">
											<?php
											}elseif ($alur_perkara_id==9) {?>
													<a href="#" onClick="popup_form('<?php echo base_url("c_template_tun_akta_permintaan_kasasi2/popup_tun_pemberitahuan_memori_kasasi/".$enc."/".$pihakasal."/".$encpihak);?>')">
													<img src="<?php echo base_url();?>resources/img/nm_icon_doc.gif"></a>
											<?php 
											}
											elseif ($alur_perkara_id==120) {
													$encpihak = base64_encode($this->encrypt->encode($row->pemohon_id)); ?>
													<a href="#" onClick="popup_form('<?php echo base_url("c_template_mil_akta_penerimaan_memori_kasasi_terdakwa/popup_akta_permohonan_kasasi/".$enc."/".$pihakasal."/".$encpihak."/12");?>')"><img src="<?php echo base_url();?>resources/img/nm_icon_doc.gif"></a>
											<?php 
											}elseif($alur_perkara_id==15){ ?>
												<a href="#" onClick="popup_form('<?php echo base_url("c_template_agama_kasasi_tri/popup_relaas_kasasi/".$enc."/".$pihakasal."/".$encpihak."/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 ($canEditDataKasasi){
										$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('edittanggalkasasi/'.$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 Kasasi</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="15%" />
			<col width="45%" />
			<col width="12%" />
			<?php if (($alur_perkara_id==15 OR $alur_perkara_id==111 OR $alur_perkara_id==120) && $canCetakDokumen && $this->session->userdata('idgroup')!=600) {?>
			<col width="18%" />
			<?php } 
			if ($canEditDataKasasi){?>
			<col width="5%" />
			<?php } ?>
			<tbody>
				<tr>
					<td>No</td>
					<td>Status</td>
					<td>Nama</td>
					<td>Tanggal</td>
					<?php if (($alur_perkara_id==15 OR $alur_perkara_id==111 OR $alur_perkara_id==120) && $canCetakDokumen && $this->session->userdata('idgroup')!=600) {?>
					<td>Cetak Dokumen Akta</td>
					<?php } 
					if ($canEditDataKasasi){?>
					<td></td>
					<?php } ?>
				</tr>
				<?php
				if($infokasasidetil!=''){
					if($infokasasidetil->num_rows>0){
						$i=1;
						foreach ($infokasasidetil->result() as $row) {
							if($row->status_pihak_id==4 OR $row->status_pihak_id==2 OR $row->status_pihak_id==5){
								/*didik*/
								if(!empty($row->pihak_asal) AND !empty($row->pihak_id)){
									$pihakasal = $row->pihak_asal;
								}
								if($row->pihak_diwakili=='Y')
									$pemohon = $row->pemohon_kasasi;
								else
									$pemohon = $row->pihak_nama;
								$encpihak = base64_encode($this->encrypt->encode($row->pihak_id));
								$encpemohon = base64_encode($this->encrypt->encode($row->pemohon_id));
								echo '<tr>';
									echo '<td style="text-align:center">'.$i.'</td>';
									echo '<td>'.$row->status_pihak_text.' '.$this->templatehelper->converToAngkaRomawi($row->urutan_kasasi).' ('.$row->pihak_asal_text.')</td>';
									echo '<td>'.$pemohon.'</td>';
									echo '<td style="text-align:center">'.$this->tanggalhelper->convertDayDate($row->penerimaan_kontra_kasasi).'</td>';
									if (($alur_perkara_id==15 OR $alur_perkara_id==111 OR $alur_perkara_id==120) && $canCetakDokumen && $this->session->userdata('idgroup')!=600) {
										echo "<td align='center'>";
										if (!empty($row->penerimaan_kontra_kasasi)){
											if ($alur_perkara_id==111) {
												?>
													<a href="#" onClick="popup_form('<?php echo base_url("c_template_akta_penerimaan_kontra_memori_kasasi/popup_akta_penerimaan_kontra_memori_kasasi/".$enc."/".$pihakasal);?>')">
													<img src="<?php echo base_url();?>resources/img/nm_icon_doc.gif"></a>
											<?php 
											}elseif ($alur_perkara_id==15) {?>
													<a href="#" onClick="popup_form('<?php echo base_url("c_template_agama_kasasi/popup_akta_kasasi/".$enc."/".$pihakasal."/".$encpihak."/5");?>')">
													<img src="<?php echo base_url();?>resources/img/nm_icon_doc.gif"></a>
											<?php
											} elseif ($alur_perkara_id==120) {
											?>
													<a href="#" onClick="popup_form('<?php echo base_url("c_template_mil_akta_penerimaan_memori_kasasi_terdakwa/popup_akta_permohonan_kasasi/".$enc."/".$pihakasal."/".$encpemohon."/4");?>')">
													<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 ($canEditDataKasasi){
										$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('edittanggalkasasi/'.$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 Kasasi</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="15%" />
			<col width="45%" />
			<col width="12%" />
			<?php if (($alur_perkara_id=='111' OR $alur_perkara_id==9 OR $alur_perkara_id==120 OR $alur_perkara_id==15) && $canCetakDokumen) {?>
			<col width="18%" />
			<?php } 
			if ($canEditDataKasasi){?>
			<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 OR $alur_perkara_id==120 OR $alur_perkara_id==15) && $canCetakDokumen) {?>
					<td>Cetak Dokumen Relaas</td>
					<?php } 
					if ($canEditDataKasasi){?>
					<td></td>
					<?php } ?>
				</tr>
				<?php
				if($infokasasidetil!=''){
					if($infokasasidetil->num_rows>0){
						$i=1;
						foreach ($infokasasidetil->result() as $row) {
							if($row->status_pihak_id==1 OR $row->status_pihak_id==2 OR $row->status_pihak_id==5){
								/*didik*/
								if(!empty($row->pihak_asal) AND !empty($row->pihak_id)){
									$pihakasal = $row->pihak_asal;								
								}
								if($row->pihak_diwakili=='Y')
									$pemohon = $row->pemohon_kasasi;
								else
									$pemohon = $row->pihak_nama;
								$encpihak = base64_encode($this->encrypt->encode($row->pihak_id));								
								echo '<tr>';
									echo '<td align="center">'.$i.'</td>';
									echo '<td>'.$row->status_pihak_text.' '.$this->templatehelper->converToAngkaRomawi($row->urutan_kasasi).' ('.$row->pihak_asal_text.')</td>';
									echo '<td>'.$pemohon.'</td>';
									echo '<td align="center">'.$this->tanggalhelper->convertDayDate($row->penyerahan_kontra_kasasi).'</td>';
									if (($alur_perkara_id=='111' OR $alur_perkara_id==9 OR $alur_perkara_id==120 OR $alur_perkara_id==15) && $canCetakDokumen){
										echo "<td align='center'>";
										if (!empty($row->penyerahan_kontra_kasasi)){
											if ($alur_perkara_id==='111') {?>
													<a href="#" onClick="popup_form('<?php echo base_url("c_template_relaas_pidana_kasasi/popup_relaas_kasasi/".$enc."/".$pihakasal."/".$encpihak."/3");?>')">
													<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_akta_permintaan_kasasi2/popup_tun_pemberitahuan_kontra_memori_kasasi/".$enc."/".$pihakasal."/".$encpihak);?>')">
													<img src="<?php echo base_url();?>resources/img/nm_icon_doc.gif"></a>
											<?php 
											}
											elseif ($alur_perkara_id==120) {
												$encpemohon = base64_encode($this->encrypt->encode($row->pemohon_id)); ?>
												<span class="custom-dropdown custom-dropdown--emerald">
													<select onchange="pilih_cetak(this)" style="width:150px;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_mil_akta_penerimaan_memori_kasasi_terdakwa/popup_akta_permohonan_kasasi/".$enc."/".$pihakasal."/".$encpemohon."/5");?>">Akta Penyerahan Kontra Memori Kasasi</option>
														<option value="<?php echo base_url("c_template_mil_akta_penerimaan_memori_kasasi_terdakwa/popup_akta_permohonan_kasasi/".$enc."/".$pihakasal."/".$encpemohon."/11");?>">Akta Tidak Menyerahkan Kontra Memori Kasasi</option>
													</select>
												</span>											
											<?php }elseif ($alur_perkara_id==='15') {?>
												<a href="#" onClick="popup_form('<?php echo base_url("c_template_agama_kasasi_tri/popup_relaas_kasasi/".$enc."/".$pihakasal."/".$encpihak."/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 ($canEditDataKasasi){
										$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('edittanggalkasasi/'.$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%;" border="0">
		<col width="25%">
		<col width="">
		<col width="270px">
		<tbody>
			<tr >
				<td style="background-color:#A3DBA8;padding:5px;" colspan="3"><strong>Pengiriman Berkas Kasasi</td>
			</tr>
			<tr>
				<td style="padding:1px;"></td>
			</tr>
			<tr>
				<td id="first-child">Tanggal Pengiriman Berkas kasasi</td>
				<td><?php echo $tglpengiriman;?></td>
				<td style="text-align:right">
				<?php
				if ($canEditDataKasasi){
					$idpihak = base64_encode($this->encrypt->encode(3));
					echo '<a href="#" onClick="popup_form(\''.base_url('edittanggalkasasi/'.$idpihak.'/'.$enc).'/7\')">[Edit - Tanggal Pengiriman Berkas Kasasi]</a>';
				}
				?>
				</td>
			</tr>
			<tr>
				<td id="first-child">Nomor Surat Pengiriman Berkas kasasi</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%;" border="0">
		<col width="25%">
		<col width="50%">
		<col width="25%">
		<tbody>
			<tr >
				<td style="background-color:#A3DBA8;padding:5px;" colspan="3"><strong>Putusan Kasasi</td>
			</tr>
			<tr>
				<td style="padding:1px;"></td>
			</tr>
			<tr>
				<td id="first-child">Tanggal Putusan kasasi</td>
				<td><?php echo $tglputusanpt;?></td>
				<td style="text-align:right">
				<?php
				if ($canEditDataPutusanKasasi){
					echo '<a href="#" onClick="popup_form(\''.base_url('editputusankasasi/'.$enc).'\')">[Edit - Putusan Kasasi]</a>';
                                        //print_r($putusankasasi);exit;
                                        
                                } ?><br>
                                        <?php if(!$putusankasasi == null){ ?>
                                    <a href="<?php echo base_url('api/Putusan/download_file/'.$perkaraid.'/3');?>" id="noLoading">[UNDUH - Dokumen Putusan Kasasi]</a>
                                        <?php }else{ 
                                            echo "<a href=".base_url('api/Putusan/cekstatus/'.$perkaraid.'/3')." id=noLoading target=_blank>[SYNC - Status Berkas Kasasi]</a>";
                                        }?>
                                </td>
			</tr>
			<tr>
				<td id="first-child">Nomor Perkara kasasi</td>
				<td colspan="2"><?php echo $noperkarakasasi;?></td>
			</tr>
			<tr>
				<td id="first-child">Status Putusan kasasi</td>
				<td colspan="2"><?php echo $statusputusankasasi;?></td>
			</tr>
			<tr>
				<td id="first-child">Amar Putusan kasasi</td>
				<td colspan="2"><?php echo $amar;?></td>
			</tr>
			<tr>
				<td id="first-child">Majelis Hakim kasasi</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 kasasi</td>
				<td colspan="2"><?php echo $terimaberkas;?></td>
			</tr>
			<tr>
				<td id="first-child">Tanggal Pengarsipan kasasi</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 Kasasi</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-size:14px;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 OR $alur_perkara_id==120) && $canCetakDokumen) {?>
			<col width="13%" />
			<?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 OR $alur_perkara_id==120) && $canCetakDokumen) {?>
					<td>Cetak Dokumen Relaas</td>
					<?php } 
					if ($canEditPemberitahuanPutusan){?>
					<td></td>
					<?php } ?>
				</tr>
				<?php
				if($infokasasidetil!=''){
					if($infokasasidetil->num_rows>0){
						$i=1;
						foreach ($infokasasidetil->result() as $row) {
							/*didik*/
							if(!empty($row->pihak_asal) AND !empty($row->pihak_id)){
								$pihakasal = $row->pihak_asal;		
								$encpihakasal = base64_encode($this->encrypt->encode($row->pihak_asal));								
							}
							if($row->pihak_diwakili=='Y')
									$pemohon = $row->pemohon_kasasi;
								else
									$pemohon = $row->pihak_nama;
							$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.' '.$this->templatehelper->converToAngkaRomawi($row->urutan_kasasi).' ('.$row->pihak_asal_text.')</td>';
								echo '<td>'.$pemohon.'</td>';
								echo '<td style="text-align:center">'.$this->tanggalhelper->convertDayDate($row->pemberitahuan_putusan_kasasi).'</td>';
								if (($alur_perkara_id==='111' OR $alur_perkara_id==9 OR $alur_perkara_id==120) && $canCetakDokumen){
									echo "<td align='center'>";
									if (!empty($row->pemberitahuan_putusan_kasasi)){
										if ($alur_perkara_id==='111') {?>
												<a href="#" onClick="popup_form('<?php echo base_url("c_template_relaas_pidana_kasasi/popup_relaas_kasasi/".$enc."/".$pihakasal."/".$encpihak."/4");?>')">
												<img src="<?php echo base_url();?>resources/img/nm_icon_doc.gif">
										<?php 
										}elseif ($alur_perkara_id==9) {?>
												<a href="#" onClick="popup_form('<?php echo base_url("c_template_tun_akta_permintaan_kasasi2/popup_tun_pemberitahuan_put_kasasi/".$enc."/".$pihakasal."/".$encpihak);?>')">
												<img src="<?php echo base_url();?>resources/img/nm_icon_doc.gif"></a>
										<?php  
										}elseif ($alur_perkara_id==120) {?>
												<?php 
												if ($pihakasal==2){
													$encpihak = base64_encode($this->encrypt->encode($row->pemohon_id));
												?>
												<span class="custom-dropdown custom-dropdown--emerald">
													<select onchange="pilih_cetak(this)" style="width:150px;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_mil_akta_penerimaan_memori_kasasi_terdakwa/popup_akta_permohonan_kasasi/".$enc."/".$pihakasal."/".$encpihak."/6");?>">Akta Pemberitahuan Putusan</option>
														<option value="<?php echo base_url("c_template_mil_akta_penerimaan_memori_kasasi_terdakwa/popup_akta_permohonan_kasasi/".$enc."/".$pihakasal."/".$encpihak."/7");?>">BA Menolak Menandatangani Akta Pemberitahuan Isi Putusan</option>
													</select>
												</span>
												<?php
												}else{
												?>
												<a href="#" onClick="popup_form('<?php echo base_url("c_template_mil_akta_penerimaan_memori_kasasi_terdakwa/popup_akta_permohonan_kasasi/".$enc."/".$pihakasal."/".$encpihak."/6");?>')">
												<img src="<?php echo base_url();?>resources/img/nm_icon_doc.gif"></a>
												<?php } ?>
										<?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('edittanggalkasasi/'.$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.'/3');?>" 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($infokasasidetil!=''){                   
				     					 
						if($infokasasidetil->num_rows>0){											
							 
							  foreach ($infokasasidetil->result() as $row2) {     				
	                           			
								 $pkr_id=$perkaraid_kas;
								 $jenis_pengadilan = $jenispengadilan_kas;
								 $kasasiids = $row2->kasasi_id;  								
								 $ci =&get_instance();
								 $ci->load->model('api/dirput_model','dirput');
								 $datakass=$ci->dirput->ambil_dokumen($pkr_id,$jenis_pengadilan,3,$kasasiids,$alur_perkara_id);		     
                                 ?>                          
						     
								<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_kasasi;
															else
																echo $pemohon = $row2->pihak_nama;										   
										    ?>
											</td>
											</tr>								
                <?php          
                        if ($datakass->num_rows>0) {
								foreach ($datakass -> result() as $datakas ) {
                                  $urls='upload_dirput/tampil_edit/3/'.$kasasiids;				
				?>             						
										
										<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 (($datakas->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 echo base_url('api/Putusan/add_file_pendukung/'.$perkaraid.'/3');?>" id="noLoading" target="_blank">[Kirim - File Pendukung]</a>
                                                                                        <?php }else{ echo "";}?>
                                                                                        </td>
											<?php 
											
											} ?>	</tr>			                   
				                   <?php
										}//end forech2							 					   
									   
									}//end  jika disput > 0   
										   else {
											   
											   if ($doc_referensi->num_rows>0) {
											       $urls='upload_dirput/tampil_edit/3/'.$kasasiids; 
											       foreach($doc_referensi->result() as $docs) {
													  #-------------
										?>			   	<tr >
														<td id="first-child"><?php echo $docs->keterangan_file; ?></td>
														<td>
														<input type="hidden" name="kasasi_id" value="<?php echo $kasasiids;?>">
														-
														</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">

$('#detilkasasi').on('click', '.close_form', function(event) {
	openLoadingDialog();
	window.open('<?php echo $history;?>','_self');	
})
$('#detilkasasi').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>
