<?php
	$canEditDataBanding = $this->authorization->HasRuleEditDataBanding($alur_perkara_id, $perkaraid);
	$canEditDataPutusanBanding = $this->authorization->HasRuleEditDataPutusanBanding($alur_perkara_id, $perkaraid);
	$canEditPemberitahuanPutusan = $this->authorization->HasRuleEditPemberitahuanPutusanBanding($alur_perkara_id, $perkaraid);
	$canCetakDokumen = $this->authorization->HasRuleCetakDokumenUpayaHukum($alur_perkara_id, $perkaraid);
	if($infobanding!=''){
		if($infobanding->num_rows>0){
			foreach ($infobanding->result() as $row) {
				$noperkarapn = $row->nomor_perkara_pn;
				$tglputusanpn = $this->tanggalhelper->convertDayDate($row->putusan_pn);
				$nokirimberkara = $row->nomor_surat_pengiriman_berkas_banding;
				$tglpengiriman = $this->tanggalhelper->convertDayDate($row->pengiriman_berkas_banding);

				$tglputusanpt = $this->tanggalhelper->convertDayDate($row->putusan_banding);
				$terimaberkas = $this->tanggalhelper->convertDayDate($row->penerimaan_kembali_berkas_banding);
				$minutasipt = $this->tanggalhelper->convertDayDate($row->minutasi_banding);

				$noperkarabanding = $row->nomor_perkara_banding;
				$noputusanbanding = $row->nomor_putusan_banding;

				$majelis = $row->majelis_hakim_banding;
				$panitera = $row->panitera_pengganti_banding;
				$amar = $row->amar_putusan_banding;

								
			}
			$tahapanid = base64_encode($this->encrypt->encode(20));
		}
	}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'];				
				$jenis_putusan = $row['amar'];
				$bht = $row['bht'];
			}
			$tahapanid = base64_encode($this->encrypt->encode(20));
		}
	      else {
					//echo json_encode(array('st'=>0,'msg'=>'data banding kosong'));
						//return;
	   }
	
	
	
	
	$idjenisperkara = $this->tanggalhelper->getIDJenisPerkara($perkaraid);
	$url = base_url("hapusBanding/".$enc);
?>
<hr class="thick-line" style="clear:both;">
<div style="font-size:14px;padding-top:0px;padding-left:5px;" id="detilbanding">
	<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>
				<?php if($alur_perkara_id==9){ ?>
					[ <a href="#" id="cetakSurat" name="cetakSurat">Surat Keterangan Lewat Waktu Banding</a> ]
					<?php } 
					if($alur_perkara_id==120){ ?>
					<span class="custom-dropdown custom-dropdown--emerald">
						<select onchange="pilih_cetak(this)" style='width:280px;' name="jenistemplate" id="jenistemplate" class="custom-dropdown__select custom-dropdown__select--white">
							<option value="1">-- Pilih Pengumuman Putusan Terdakwa --</option>
							<option value="cetakPengumumanPertama()">Pengumuman Pertama</option>
							<option value="cetakPengumumanTerakhir()">Pengumuman Terakhir</option>
							<option value="cetakBeritaAcara()">Berita Acara Pengumuman Putusan</option>
						</select>
                    </span>
					<?php
					}
					?>
				</td>				
				<?php if ($this->authorization->HasRuleHapusDataBanding($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</td>
				<?php }else{echo "<td></td>";} ?>
			</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 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
		  {
			  
			$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</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 ($canEditDataBanding){
					$idpihak = base64_encode($this->encrypt->encode(3));
				 $urls='editpengantar/2';
				?>
                <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_banding/'.$perkaraid).'>[Upload pengajuan Banding]</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="_self" href="<?php echo base_url($data_surat->path_filename);?>">Unduh Dokumen</a>
					<?php 
					} else { echo '-' ;} 
					if (trim($barcode)<>'') 
					 {					
					?> 										
					<a id="noLoading" target="_self" 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="25%" />
			<col width="30%" />
			<col width="10%" />
			<col width="25%" />
			<?php
			if($canEditDataBanding==TRUE){
				echo '<col width="5%" />';
			}
			?>
			<tbody>
				<tr>
					<td>No</td>
					<td>Status</td>
					<td>Nama</td>
					<td>Diwakili</td>
					<td>Diwakili Oleh</td>
					<?php
					if($canEditDataBanding==TRUE){
						echo '<td></td>';
					}
					?>
				</tr>
				<?php
				if($infobandingdetil!=''){
					if($infobandingdetil->num_rows>0){
						$i=1;
						foreach ($infobandingdetil->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_banding).' ('.$row->pihak_asal_text.')</td>';
								echo '<td>'.$row->pihak_nama.'</td>';
								echo '<td style="text-align:center">'.$diwakili.'</td>';
								echo '<td>'.$pemohon.'</td>';
								if($canEditDataBanding){
									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('editbanding/'.$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 Banding</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="10%" />
			<?php if ((($alur_perkara_id==9)||($alur_perkara_id==15)||($alur_perkara_id==111) || ($alur_perkara_id==120) || ($alur_perkara_id==121)) && $canCetakDokumen && $this->session->userdata('idgroup')!=600) {?>
			<col width="20%" />
			<?php } ?>
			<?php
			if($canEditDataBanding==TRUE){
				echo '<col width="10%"/>';
			}
			?>
			<tbody>
				<tr>
					<td>Tanggal Permohonan</td>
					<td>Pemohon Banding</td>
					<td>Keterangan</td>
					<?php 
					if ((($alur_perkara_id==9)||($alur_perkara_id==15)||($alur_perkara_id==111) || ($alur_perkara_id==120) || ($alur_perkara_id==121)) && $canCetakDokumen && $this->session->userdata('idgroup')!=600) {?>
					<td>Cetak Dokumen Akta</td>
					<?php } ?>
					<?php
					if($canEditDataBanding==TRUE){
						echo '<td></td>';
					}
					?>
				</tr>
				<?php
				if($infobandingdetil!=''){
					if($infobandingdetil->num_rows>0){
						foreach ($infobandingdetil->result() as $row) {
							$diwakili = ($row->pihak_diwakili=='Y')? 'Ya':'Tidak';
							if($diwakili=='Y'){
								$pemohon = $row->pemohon_banding;
							}else{
								$pemohon = $row->pemohon_nama.'<br>'.$row->pekerjaan.'<br>'.$row->pemohon_alamat;
							}
							$editable = TRUE;
							if(!empty($row->tanggal_cabut)){
								$status = 'Permohonan Banding Telah Dicabut Pada '.$this->tanggalhelper->convertDayDate($row->tanggal_cabut);
								$editable = FALSE;
								$keterangan=$status.'<br>Keterangan: '.$row->keterangan;
								$centering='style="text-align:left"';
							}else{
								$keterangan = '-';
								$centering='style="text-align:center"';
							}
							/*didik*/
							if(!empty($row->pihak_asal) AND !empty($row->pihak_id)){
								$pihakasal = $row->pihak_asal;								
							}														
							if(!empty($row->permohonan_banding)){
								$encpemohon = base64_encode($this->encrypt->encode($row->pemohon_id));/*end*/
								echo '<tr>';
									echo '<td style="text-align:center">'.$this->tanggalhelper->convertDayDate($row->permohonan_banding).'</td>';
									echo '<td>'.$pemohon.'</td>';
									echo '<td '.$centering.'>'.$keterangan.'</td>';
									if ((($alur_perkara_id==9)||($alur_perkara_id==15)||($alur_perkara_id==111) || ($alur_perkara_id==120) || ($alur_perkara_id==121)) && $canCetakDokumen && $this->session->userdata('idgroup')!=600){
										echo "<td align='center'>";
										if ((($alur_perkara_id==='120') || ($alur_perkara_id==='121'))) {?>									
											<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>
														<?php if(!empty($row->tanggal_cabut)){ ?>
														<option value="<?php echo base_url("c_template_mil_akta_banding_pidana/popup_mil_cabut_banding/".$enc."/".$pihakasal."/".$encpemohon."/2");?>">Akta Pencabutan Banding</option>
														<option value="<?php echo base_url("c_template_mil_akta_banding_pidana/popup_mil_pemberitahuan_cabut_banding/".$enc."/".$pihakasal."/".$encpemohon."/2");?>">Akta Pemberitahuan Pencabutan Banding</option>
														<?php }else{ ?>
														<option value="<?php echo base_url("c_template_mil_akta_banding_pidana/popup_mil_akta_banding/".$enc."/".$pihakasal."/".$encpemohon."/1");?>">Akta Permintaan Banding</option>
														<option value="<?php echo base_url("c_template_mil_akta_banding_pidana/popup_mil_tolak_banding/".$enc."/".$pihakasal."/".$encpemohon."/2");?>">Akta Penolakan Banding</option>
														<?php }
														?>											   
												</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_banding/popup_cabut_banding/".$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_banding/popup_akta_banding/".$enc."/".$pihakasal."/".$encpemohon."/1");?>')">
												<img src="<?php echo base_url();?>resources/img/nm_icon_doc.gif"></a>
											<?php } 
										}
										elseif($alur_perkara_id==='15'){ ?>								    
											<?php if(!empty($row->tanggal_cabut)){ ?>
												<a href="#" onClick="popup_form('<?php echo base_url("c_template_agama_banding/popup_akta_banding/".$enc."/".$pihakasal."/".$encpemohon."/4");?>')">
												<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_banding/popup_akta_banding/".$enc."/".$pihakasal."/".$encpemohon."/1");?>')">
												<img src="<?php echo base_url();?>resources/img/nm_icon_doc.gif"></a>
											<?php } 
										}
										elseif($alur_perkara_id==='111'){ ?>
											<?php if(!empty($row->tanggal_cabut)){ ?>
												<a href="#" onClick="popup_form('<?php echo base_url("c_template_akta_banding_pidana/popup_cabut_banding/".$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_akta_banding_pidana/popup_akta_banding/".$enc."/".$pihakasal."/".$encpemohon."/1");?>')">
												<img src="<?php echo base_url();?>resources/img/nm_icon_doc.gif"></a>
											<?php }
										}
										echo "</td>";
									}									
									$enc = base64_encode($this->encrypt->encode($row->perkara_id));
									$enc_id = base64_encode($this->encrypt->encode($row->id));																										
									if($canEditDataBanding){
										echo '<td align="center" style="cursor:pointer;">';
										if($editable && $canEditDataBanding){
											echo '<a href="#" onClick="popup_form(\''.base_url('cabutpermohonanbanding/'.$enc.'/'.$enc_id).'\')">[CABUT]</a>||';
											echo '<a href="#" onClick="popup_form(\''.base_url('editpermohonanbanding/'.$enc.'/'.$enc_id).'\')">[EDIT]</a>';
										}
										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!=12 AND $alur_perkara_id!=13 AND $alur_perkara_id!=14){
		$jenispkr = array('624','139','140','141','344','359','360');
    	if(!in_array($idjenisperkara, $jenispkr)){
			echo'<div style="padding:5px;"></div>
			<table id="infoPerkara" style="font-size:14px;width:100%;" border="0">
				<col width="25%">
				<col width="">
				<col width="200px">';
				$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);
							$mediator_text 				= $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 ($canEditDataBanding){
							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>';
					echo'<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="-";
											}
											if($infomediasi->num_rows>0){
												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>";
											}else{
												echo"<tr><td style='text-align:center' colspan='3'>Data tidak ditemukan</td><tr>";
											}
										}
								echo'</tbody>
							</table>';
							}else{
								echo "-";
							}
						echo'</div>
						</td>
					</tr>
					<tr>
						<td id="first-child">Tanggal Pengiriman Kesepakatan ke Tingkat Banding</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 Banding</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="3%" />
			<col width="20%" />
			<col width="47%" />
			<col width="12%" />
			<?php if ((($alur_perkara_id==='9')||($alur_perkara_id==='15')||($alur_perkara_id==='111')||($alur_perkara_id==='120')||($alur_perkara_id==='121')) && $canCetakDokumen) {?>
			<col width="13%" />
			<?php } ?>
			<?php
			if($canEditDataBanding==TRUE){
				echo '<col width="5%" />';
			}
			?>
			<tbody>
				<tr>
					<td>No</td>
					<td>Status</td>
					<td>Nama</td>
					<td>Tanggal</td>
					<?php if ((($alur_perkara_id==='9')||($alur_perkara_id==='15')||($alur_perkara_id==='111')||($alur_perkara_id==='120')||($alur_perkara_id==='121')) && $canCetakDokumen) {?>
					<td>Cetak Dokumen Relaas</td>
					<?php } ?>
					<?php
					if($canEditDataBanding==TRUE){
						echo '<td></td>';
					}
					?>
				</tr>
				<?php
				if($infobandingdetil!=''){
					if($infobandingdetil->num_rows>0){
						$i=1;
						foreach ($infobandingdetil->result() as $row) {
							if($row->status_pihak_id>1){
								if(!empty($row->pihak_asal) AND !empty($row->pihak_id)){
									$pihakasal = $row->pihak_asal;								
								}
								$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_banding).' ('.$row->pihak_asal_text.')</td>';
									echo '<td>'.$row->pihak_nama.'</td>';
									echo '<td align="center">'.$this->tanggalhelper->convertDayDate($row->pemberitahuan_permohonan_banding).'</td>';
									if ((($alur_perkara_id==='9')||($alur_perkara_id==='15')||($alur_perkara_id==='111')||($alur_perkara_id==='120')||($alur_perkara_id==='121')) && $canCetakDokumen){
										echo "<td align='center'>";
										if ($row->pemberitahuan_permohonan_banding!=''){
											if (($alur_perkara_id==='121') || ($alur_perkara_id==='120')){ ?>
												<a href="#" onClick="popup_form('<?php echo base_url("c_template_mil_akta_banding_pidana/popup_mil_relaas_banding/".$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_banding/popup_relaas_banding/".$enc."/".$pihakasal."/".$encpihak."/1");?>')">
												<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_banding/popup_relaas_banding/".$enc."/".$pihakasal."/".$encpihak."/1");?>')">
												<img src="<?php echo base_url();?>resources/img/nm_icon_doc.gif"></a>
											<?php }
										}elseif($alur_perkara_id!=111){
											echo "Tanggal kosong, belum dapat cetak dokumen";
										}
										if ($alur_perkara_id==='111') {?>
												<a href="#" onClick="popup_form('<?php echo base_url("c_template_akta_banding_pidana/popup_relaas_banding/".$enc."/".$pihakasal."/".$encpihak."/1");?>')">
												<img src="<?php echo base_url();?>resources/img/nm_icon_doc.gif"></a>																																 
								  <?php }
										echo "</td>";
									}
									
									if ($canEditDataBanding){
										$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('edittanggalbanding/'.$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 Banding</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="3%" />
			<col width="20%" />
			<col width="47%" />
			<col width="12%" />
			<?php if ((($alur_perkara_id==15) || ($alur_perkara_id==111) || ($alur_perkara_id==120) || ($alur_perkara_id==121)) && $canCetakDokumen) {?>
			<col width="13%" />
			<?php } 
			if($canEditDataBanding){
				echo '<col width="5%" />';
			}
			?>
			<tbody>
				<tr>
					<td>No</td>
					<td>Status</td>
					<td>Nama</td>
					<td>Tanggal</td>
					<?php if ((($alur_perkara_id==15) || ($alur_perkara_id==111) || ($alur_perkara_id==120) || ($alur_perkara_id==121)) && $canCetakDokumen) {?>
					<td>Cetak Dokumen Akta</td>
					<?php } ?>
					<?php
					if($canEditDataBanding){
						echo '<td></td>';
					}
					?>
				</tr>				
				<?php
				if($infobandingdetil!=''){
					if($infobandingdetil->num_rows>0){						
						$i=1;
						foreach ($infobandingdetil->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;								
								}
								$encpemohon = 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_banding).' ('.$row->pihak_asal_text.')</td>';
									echo '<td>'.$row->pihak_nama.'</td>';
									echo '<td align="center">'.$this->tanggalhelper->convertDayDate($row->penerimaan_memori_banding).'</td>';
									if ((($alur_perkara_id==15) || ($alur_perkara_id==111) || ($alur_perkara_id==120) || ($alur_perkara_id==121)) && $canCetakDokumen){
											echo "<td align='center'>";
											if (!empty($row->penerimaan_memori_banding)){
												if ($alur_perkara_id==111) {?>
													<a href="#" onClick="popup_form('<?php echo base_url("c_template_akta_banding_pidana/popup_akta_banding/".$enc."/".$pihakasal."/".$encpemohon."/2");?>')">
													<img src="<?php echo base_url();?>resources/img/nm_icon_doc.gif"></a>
												<?php }elseif (($alur_perkara_id==121) || ($alur_perkara_id==120)){ ?>
													<a href="#" onClick="popup_form('<?php echo base_url("c_template_mil_akta_banding_pidana/popup_mil_relaas_banding/".$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_banding/popup_akta_banding/".$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 dokumens";
											}
										echo "</td>";
									}
									
									if ($canEditDataBanding){								
										$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('edittanggalbanding/'.$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 Banding</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="3%" />
			<col width="20%" />
			<col width="47%" />
			<col width="12%" />
			<?php if ((($alur_perkara_id==='9')||($alur_perkara_id==='15')||($alur_perkara_id==='111') || ($alur_perkara_id==='120') || ($alur_perkara_id==='121')) && $canCetakDokumen) {?>
				<col width="13%" />
			<?php } ?>
			<?php
			if($canEditDataBanding==TRUE){
				echo '<col width="5%" />';
			}
			?>
			<tbody>
				<tr>
					<td>No</td>
					<td>Status</td>
					<td>Nama</td>
					<td>Tanggal</td>
					<?php if ((($alur_perkara_id==='9')||($alur_perkara_id==='15')||($alur_perkara_id==='111') || ($alur_perkara_id==='120') || ($alur_perkara_id==='121')) && $canCetakDokumen) {?>
					<td>Cetak Dokumen Relaas</td>
					<?php } ?>
					<?php
					if($canEditDataBanding==TRUE){
						echo '<td></td>';
					}
					?>
				</tr>
				<?php
				if($infobandingdetil!=''){
					if($infobandingdetil->num_rows>0){
						$i=1;
						foreach ($infobandingdetil->result() as $row) {
							if($row->status_pihak_id>1){
								/*didik*/
								if(!empty($row->pihak_asal) AND !empty($row->pihak_id)){
									$pihakasal = $row->pihak_asal;								
								}
								$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_banding).' ('.$row->pihak_asal_text.')</td>';
									echo '<td>'.$row->pihak_nama.'</td>';
									echo '<td align="center">'.$this->tanggalhelper->convertDayDate($row->penyerahan_memori_banding).'</td>';
									if ((($alur_perkara_id==='9')||($alur_perkara_id==='15')||($alur_perkara_id==='111') || ($alur_perkara_id==='120') || ($alur_perkara_id==='121')) && $canCetakDokumen){
										echo "<td align='center'>";
										if ($row->penyerahan_memori_banding!=''){
											if ((($alur_perkara_id==='121') || ($alur_perkara_id=='120'))){ ?>
												<a href="#" onClick="popup_form('<?php echo base_url("c_template_mil_akta_banding_pidana/popup_mil_relaas_banding/".$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_banding/popup_relaas_banding/".$enc."/".$pihakasal."/".$encpihak."/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_banding/popup_relaas_banding/".$enc."/".$pihakasal."/".$encpihak."/2");?>')">
												<img src="<?php echo base_url();?>resources/img/nm_icon_doc.gif"></a>
											<?php } 
										}elseif($alur_perkara_id!=111){
											echo "Tanggal kosong, belum dapat cetak dokumen";
										}
										if (($alur_perkara_id==='111')) {?>
												<a href="#" onClick="popup_form('<?php echo base_url("c_template_akta_banding_pidana/popup_relaas_banding/".$enc."/".$pihakasal."/".$encpihak."/2");?>')">
												<img src="<?php echo base_url();?>resources/img/nm_icon_doc.gif"></a>
								  <?php }
										echo "</td>";
									}
									
									if ($canEditDataBanding){									
										$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('edittanggalbanding/'.$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 Banding</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="3%" />
			<col width="20%" />
			<col width="47%" />
			<col width="12%" />
			<?php if ((($alur_perkara_id==15) || ($alur_perkara_id==111) || ($alur_perkara_id==120) || ($alur_perkara_id==121)) && $canCetakDokumen) {?>
			<col width="13%" />
			<?php } ?>
			<?php
			if($canEditDataBanding==TRUE){
				echo '<col width="5%" />';
			}
			?>
			<tbody>
				<tr>
					<td>No</td>
					<td>Status</td>
					<td>Nama</td>
					<td>Tanggal</td>
					<?php if ((($alur_perkara_id==15) || ($alur_perkara_id==111) || ($alur_perkara_id==120) || ($alur_perkara_id==121)) && $canCetakDokumen) {?>
					<td>Cetak Dokumen Akta</td>
					<?php } ?>
					<?php
					if($canEditDataBanding==TRUE){
						echo '<td></td>';
					}
					?>
				</tr>
				<?php
				if($infobandingdetil!=''){
					if($infobandingdetil->num_rows>0){						
						$i=1;
						foreach ($infobandingdetil->result() as $row) {
							if($row->status_pihak_id==2 OR $row->status_pihak_id==4 OR $row->status_pihak_id==5){
								/*didik*/
								if(!empty($row->pihak_asal) AND !empty($row->pihak_id)){
									$pihakasal = $row->pihak_asal;								
								}								
								$encpemohon = 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_banding).' ('.$row->pihak_asal_text.')</td>';
									echo '<td>'.$row->pihak_nama.'/'.$row->pihak_id.'</td>';
									echo '<td align="center">'.$this->tanggalhelper->convertDayDate($row->penerimaan_kontra_banding).'</td>';
									if ((($alur_perkara_id==15) || ($alur_perkara_id==111) || ($alur_perkara_id==120) || ($alur_perkara_id==121)) && $canCetakDokumen){
										echo "<td align='center'>";
										if ($row->penerimaan_kontra_banding!=''){
											if ($alur_perkara_id==111) {?>
												<a href="#" onClick="popup_form('<?php echo base_url("c_template_akta_banding_pidana/popup_akta_banding/".$enc."/".$pihakasal."/".$encpemohon."/3");?>')">
												<img src="<?php echo base_url();?>resources/img/nm_icon_doc.gif"></a>
											<?php }elseif (($alur_perkara_id==121) || ($alur_perkara_id==120)){ ?>
												<a href="#" onClick="popup_form('<?php echo base_url("c_template_mil_akta_banding_pidana/popup_mil_relaas_banding/".$enc."/".$pihakasal."/".$encpemohon."/4");?>')">
												<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_banding/popup_akta_banding/".$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 ($canEditDataBanding){
										$idpihak = base64_encode($this->encrypt->encode($row->pihak_id));
										$enc_id = base64_encode($this->encrypt->encode($row->id));
										$url = base_url('edittanggalbanding/'.$idpihak.'/'.$enc_id.'/4');
										echo '<td align="center" style="cursor:pointer;"><a href="#" onClick="popup_form(\''.$url.'\')">[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 Banding</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="3%" />
			<col width="20%" />
			<col width="47%" />
			<col width="12%" />
			<?php if ((($alur_perkara_id==='9')||($alur_perkara_id==='15')||($alur_perkara_id==='111') || ($alur_perkara_id==='120') || ($alur_perkara_id==='121')) && $canCetakDokumen) {?>
			<col width="13%" />
			<?php } ?>
			<?php
			if($canEditDataBanding==TRUE){
				echo '<col width="5%" />';
			}
			?>
			<tbody>
				<tr>
					<td>No</td>
					<td>Status</td>
					<td>Nama</td>
					<td>Tanggal</td>
					<?php if ((($alur_perkara_id==='9') || ($alur_perkara_id==='15')||($alur_perkara_id==='111') || ($alur_perkara_id==='120') || ($alur_perkara_id==='121')) && $canCetakDokumen) {?>
					<td>Cetak Dokumen Relaas</td>
					<?php } ?>
					<?php
					if($canEditDataBanding==TRUE){
						echo '<td></td>';
					}
					?>
				</tr>
				<?php
				if($infobandingdetil!=""){
					if($infobandingdetil->num_rows>0){
						$i=1;
						foreach ($infobandingdetil->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;								
								}
								$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_banding).' ('.$row->pihak_asal_text.')</td>';
									echo '<td>'.$row->pihak_nama.'</td>';
									echo '<td style="text-align:center">'.$this->tanggalhelper->convertDayDate($row->penyerahan_kontra_banding).'</td>';
									if ((($alur_perkara_id==='9') || ($alur_perkara_id==='15')||($alur_perkara_id==='111') || ($alur_perkara_id==='120') || ($alur_perkara_id==='121')) && $canCetakDokumen){
										echo "<td align='center'>";
										if ($row->penyerahan_kontra_banding!=''){
											if (($alur_perkara_id==='121') || ($alur_perkara_id==='120')){ ?>
												<a href="#" onClick="popup_form('<?php echo base_url("c_template_mil_akta_banding_pidana/popup_mil_relaas_banding/".$enc."/".$pihakasal."/".$encpihak."/5");?>')">
												<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_banding/popup_relaas_banding/".$enc."/".$pihakasal."/".$encpihak."/3");?>')">
												<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_banding/popup_relaas_banding/".$enc."/".$pihakasal."/".$encpihak."/3");?>')">
												<img src="<?php echo base_url();?>resources/img/nm_icon_doc.gif"></a>
										<?php } 
										}elseif($alur_perkara_id!=111){
											echo "Tanggal kosong, belum dapat cetak dokumen";
										}
										if ($alur_perkara_id==='111') {?>
												<a href="#" onClick="popup_form('<?php echo base_url("c_template_akta_banding_pidana/popup_relaas_banding/".$enc."/".$pihakasal."/".$encpihak."/3");?>')">
												<img src="<?php echo base_url();?>resources/img/nm_icon_doc.gif"></a>
								  <?php }
										echo "</td>";
									}										
									if ($canEditDataBanding){
											$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('edittanggalbanding/'.$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="15%">
		<col width="85%">
		<tbody>
			<tr>
				<td style="background-color:#A3DBA8;padding:5px;" colspan="2"><strong>Tanggal Pemberitahuan Inzage</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="3%" />
			<col width="20%" />
			<col width="47%" />
			<col width="12%" />
			<?php if ((($alur_perkara_id==='9') ||($alur_perkara_id==='15') || ($alur_perkara_id==='111') || ($alur_perkara_id==='120') || ($alur_perkara_id==='121')) && $canCetakDokumen) {?>
			<col width="13%" />
			<?php } ?>
			<?php
			if($canEditDataBanding==TRUE){
				echo '<col width="5%" />';
			}
			?>
			<tbody>
				<tr>
					<td>No</td>
					<td>Status</td>
					<td>Nama</td>
					<td>Tanggal</td>
					<?php if ((($alur_perkara_id==='9')||($alur_perkara_id==='15') ||($alur_perkara_id==='111') || ($alur_perkara_id==='120') || ($alur_perkara_id==='121')) && $canCetakDokumen) {?>
					<td>Cetak Dokumen Relaas</td>
					<?php } ?>
					<?php
					if($canEditDataBanding==TRUE){
						echo '<td></td>';
					}
					?>
				</tr>
				<?php
				if($infobandingdetil!=''){
					if($infobandingdetil->num_rows>0){
						$i=1;
						foreach ($infobandingdetil->result() as $row) {
							#if($row->status_pihak_id!=5){
								/*didik*/
								if(!empty($row->pihak_asal) AND !empty($row->pihak_id)){
									$pihakasal = $row->pihak_asal;								
								}
								$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_banding).' ('.$row->pihak_asal_text.')</td>';
									echo '<td>'.$row->pihak_nama.'</td>';
									echo '<td align="center">'.$this->tanggalhelper->convertDayDate($row->pemberitahuan_inzage).'</td>';
									if ((($alur_perkara_id==='9')||($alur_perkara_id==='15') ||($alur_perkara_id==='111') || ($alur_perkara_id==='120') || ($alur_perkara_id==='121')) && $canCetakDokumen){
										echo "<td align='center'>";
										if ($row->pemberitahuan_inzage!=''){
											if (($alur_perkara_id==='121') || ($alur_perkara_id==='120')){ ?>
												<a href="#" onClick="popup_form('<?php echo base_url("c_template_mil_akta_banding_pidana/popup_mil_relaas_banding/".$enc."/".$pihakasal."/".$encpihak."/6");?>')">
												<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_banding/popup_relaas_banding/".$enc."/".$pihakasal."/".$encpihak."/4");?>')">
												<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_banding/popup_relaas_banding/".$enc."/".$pihakasal."/".$encpihak."/4");?>')">
												<img src="<?php echo base_url();?>resources/img/nm_icon_doc.gif"></a>
											<?php } 
										}elseif($alur_perkara_id!=111){
											echo "Tanggal kosong, belum dapat cetak dokumen";
										}
										if ($alur_perkara_id==='111') {?>
												<a href="#" onClick="popup_form('<?php echo base_url("c_template_akta_banding_pidana/popup_relaas_banding/".$enc."/".$pihakasal."/".$encpihak."/4");?>')">
												<img src="<?php echo base_url();?>resources/img/nm_icon_doc.gif"></a>
								  <?php }
										echo "</td>";
									}
									
									if ($canEditDataBanding){
											$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('edittanggalbanding/'.$idpihak.'/'.$enc_id).'/6\')">[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="">
		<col width="300px">
		<tbody>
			<tr >
				<td style="background-color:#A3DBA8;padding:5px;" colspan="3"><strong>Tanggal Pengiriman Berkas Banding</td>
			</tr>
			<tr>
				<td style="padding:1px;"></td>
			</tr>
			<tr>
				<td id="first-child">Tanggal Pengiriman Berkas Banding</td>
				<td><?php echo (!empty($tglpengiriman) ? $tglpengiriman : '');?></td>
				<td style="text-align:right">
				<?php			
				if ($canEditDataBanding){
					$idpihak = base64_encode($this->encrypt->encode(3));
					echo '<a href="#" onClick="popup_form(\''.base_url('edittanggalbanding/'.$idpihak.'/'.$enc).'/7\')">[Edit - Tanggal Pengiriman Berkas Banding]</a>';				
				}
				?>				
				</td>
			</tr>
			<tr>
				<td id="first-child">Nomor Surat Pengiriman Berkas Banding</td>
				<td colspan="2"><?php echo (!empty($nokirimberkara) ? $nokirimberkara : '');?></td>
			</tr>
		</tbody>
	</table>
	<div style="padding:5px;"></div>
	<table id='infoPerkara' style="font-size:14px;width:100%;">
		<col width="25%">
		<col width="">
		<col width="250px">
		<tbody>
			<tr >
				<td style="background-color:#A3DBA8;padding:5px;" colspan="3"><strong>Putusan Banding</td>
			</tr>
			<tr>
				<td style="padding:1px;"></td>
			</tr>
			<tr>
				<td id="first-child">Tanggal Putusan Banding</td>
				<td><?php echo (!empty($tglputusanpt) ? $tglputusanpt : '');?></td>
				<td style="text-align:right">
				<?php			
				if($this->session->userdata('idgroup')==10){
					echo '<a href="#" onClick="popup_form(\''.base_url('editputusanbanding/'.$enc.'/1').'\')">[Edit - Putusan Banding]</a>';				
				}
				if(!empty($amar) OR !empty($noputusanbanding)){
					if($canEditDataPutusanBanding AND $this->session->userdata('idgroup')!=10){
						echo '<a href="#" onClick="popup_form(\''.base_url('editputusanbanding/'.$enc.'/2').'\')">[Edit - Penerimaan Berkas Banding]</a>';				
					} 
				}
				?><br>
                                        <?php if(!$putusanbanding == null){ ?>
                                    <a href="<?php echo base_url('api/Putusan/download_file/'.$perkaraid.'/2');?>" id="noLoading">[UNDUH - Dokumen Putusan Banding]</a>
                                        <?php }else{echo "";}?>
                                </td>
			</tr>
			<tr>
				<td id="first-child">Nomor Putusan Banding</td>
				<td colspan="2"><?php echo (!empty($noputusanbanding) ? $noputusanbanding : '');?></td>
			</tr>
			<tr>
				<td id="first-child">Amar Putusan Banding</td>
				<td colspan="2"><?php echo (!empty($amar) ? $amar : '');?></td>
			</tr>
			<tr>
				<td id="first-child">Majelis Hakim Banding</td>
				<td colspan="2"><?php echo (!empty($majelis) ? $majelis : '');?></td>
			</tr>
			<tr>
				<td id="first-child">Panitera Pengganti</td>
				<td colspan="2"><?php echo (!empty($panitera) ? $panitera : '');?></td>
			</tr>
			<tr>
				<td id="first-child">Tanggal Penerimaan Kembali Berkas Banding</td>
				<td colspan="2"><?php echo (!empty($terimaberkas) ? $terimaberkas : '');?></td>
			</tr>
			<tr>
				<td id="first-child">Tanggal Pengarsipan Banding</td>
				<td colspan="2"><?php echo (!empty($minutasipt) ? $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 Banding</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="3%" />
			<col width="20%" />
			<col width="47%" />
			<col width="12%" />
			<?php if ((($alur_perkara_id==='9')||($alur_perkara_id==='111') || ($alur_perkara_id==='120') || ($alur_perkara_id==='121')) && $canCetakDokumen) {?>
			<col width="13%" />
			<?php } ?>
			<?php
			if($canEditPemberitahuanPutusan){
				echo '<col width="5%" />';
			}
			?>
			<tbody>
				<tr>
					<td>No</td>
					<td>Status</td>
					<td>Nama</td>
					<td>Tanggal</td>
					<?php if ((($alur_perkara_id==='9')||($alur_perkara_id==='111') || ($alur_perkara_id==='120') || ($alur_perkara_id==='121')) && $canCetakDokumen) {?>
					<td>Cetak Dokumen Pemberitahuan</td>
					<?php } ?>
					<?php
					if($canEditPemberitahuanPutusan){
						echo '<td></td>';
					}
					?>
				</tr>
				<?php
				if($infobandingdetil!=''){
					if($infobandingdetil->num_rows>0){
						$i=1;
						foreach ($infobandingdetil->result() as $row) {
							/*didik*/
							if(!empty($row->pihak_asal) AND !empty($row->pihak_id)){
								$pihakasal = $row->pihak_asal;								
							}
							$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_banding).' ('.$row->pihak_asal_text.')</td>';
								echo '<td>'.$row->pihak_nama.'</td>';
								echo '<td style="text-align:center">'.$this->tanggalhelper->convertDayDate($row->pemberitahuan_putusan_banding).'</td>';
								if ((($alur_perkara_id==='9')||($alur_perkara_id==='111') || ($alur_perkara_id==='120') || ($alur_perkara_id==='121')) && $canCetakDokumen){
									echo "<td align='center'>";
									if ($row->pemberitahuan_putusan_banding!=''){
										if (($alur_perkara_id==='121') || ($alur_perkara_id==='120')){ ?>
											<a href="#" onClick="popup_form('<?php echo base_url("c_template_mil_akta_banding_pidana/popup_mil_relaas_banding/".$enc."/".$pihakasal."/".$encpihak."/7");?>')">
											<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_banding/popup_relaas_banding/".$enc."/".$pihakasal."/".$encpihak."/5");?>')">
											<img src="<?php echo base_url();?>resources/img/nm_icon_doc.gif"></a>
										<?php } 
									}elseif($alur_perkara_id!=111){
										echo "Tanggal kosong, belum dapat cetak dokumen";
									}
									if ($alur_perkara_id==='111') {?>
											<a href="#" onClick="popup_form('<?php echo base_url("c_template_akta_banding_pidana/popup_relaas_banding/".$enc."/".$pihakasal."/".$encpihak."/5");?>')">
											<img src="<?php echo base_url();?>resources/img/nm_icon_doc.gif"></a>
							  <?php }
									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('edittanggalbanding/'.$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</td>
			</tr>	
				<tr>
				<td style="padding:1px;"></td>
			</tr>
		    <!-- mulai form dinamis -->	
				<?php
                  if($infobandingdetil!=''){                   
				                     				  
						if($infobandingdetil->num_rows>0){											
							 
							  foreach ($infobandingdetil->result() as $row2) {     				
	                           			
								 $pkr_id=$perkaraid_banding;
								 $jenis_pengadilan = $jenispengadilan_banding;
								 $bandingids = $row2->banding_id;  								
								 $ci =&get_instance();
								 $ci->load->model('api/dirput_model','dirput');
                                                                 $datakass=$ci->dirput->ambil_dokumen($pkr_id,$jenis_pengadilan,2,$bandingids,$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_banding;
															else
																echo $pemohon = $row2->pihak_nama;										   
										    ?>
											</td>
											</tr>								
                <?php          
                        if ($datakass->num_rows>0) {
								foreach ($datakass -> result() as $datakas ) {
                                  $urls='upload_dirput/tampil_edit/2/'.$bandingids;				
				?>             						
										
										<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>			
											                                                                                        <?php 										
											if (trim($datakas->filename)!='') { 
                                                                                            ?><br>
                                                                                        <a href="<?php echo base_url('api/Putusan/add_file_pendukung/'.$perkaraid.'/2');?>" 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/2/'.$bandingids; 
                                                                                               //echo"<pre>";
                                                                                               //print_r($doc_referensi->result());
											       foreach($doc_referensi->result() as $docs) {
													  #-------------
										?>			   	<tr >
														<td id="first-child"><?php echo $docs->keterangan_file; ?></td>
														<td>
														<input type="hidden" name="banding_id" value="<?php echo $bandingids;?>">
														-
														</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>
<script type="text/javascript">
$('#detilbanding').on('click', '.close_form', function(event) {
	openLoadingDialog();
	window.open('<?php echo $history;?>','_self');	
})

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

function cetakPengumumanPertama(){
	window.open('<?php echo base_url("c_template_mil_pengumuman_putusan/cetak_pengumuman/".$enc."/1");?>','_self');
}
function cetakPengumumanTerakhir(){
	window.open('<?php echo base_url("c_template_mil_pengumuman_putusan/cetak_pengumuman/".$enc."/2");?>','_self');
}
function cetakBeritaAcara(){
	window.open('<?php echo base_url("c_template_mil_pengumuman_putusan/cetak_pengumuman/".$enc."/3");?>','_self');
}


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