<style type="text/css">
#first-child{
	color:#fff;
}
</style>
<?php
if ($idalur==1) {
	$sumber="Asal";
	$namaDelegasi="MASUK";
	$namapn=$pn_asal_text;
}else{
	$sumber="Tujuan";
	$namaDelegasi="KELUAR";
	$namapn=$pn_tujuan_text;
}
if ($delegasi_proses!=NULL){
		$hak_akses = $this->session->userdata('idgroup');					
		if($this->authorization->HasRuleDelegasiJurusita($this->encrypt->decode(base64_decode($p_enc_delegasi))) AND $hak_akses!=410 AND $hak_akses!=420){ 											
			if ($idalur==1 AND $status_kirim==0){
				if ($delegasi_proses!=NULL) {
					echo '<td align="right">[<a href="'.base_url('manage_delegasi_perkara/update_pelaksanaan/'.$p_enc_delegasi.'/'.$p_enc_pn_asal.'/'.$p_enc_pn_tujuan.'/edit').'">Edit Pelaksanaan Delegasi</a>]</td>';
				}else{
					echo '<td align="right">[<a href="'.base_url('manage_delegasi_perkara/update_pelaksanaan/'.$p_enc_delegasi.'/'.$p_enc_pn_asal.'/'.$p_enc_pn_tujuan.'/').'"> Update Delegasi</a>]</td>';
				}						
			}
		} 
		?>
		<table id='infoPerkara' style="font-size:12px;width:100%">
			<col width="20%">
			<col width="60%">
			<col width="20%">
			<tbody>			
				<tr>
					<td colspan="3" style="text-align:center;background-color:#A3DBA8;color:#111;"><strong>Penerimaan dan Pelaksanaan Delegasi</strong></td>
				</tr>
				<tr>
					<td id="first-child">Tanggal Berkas Diterima </td>
					<td><?php echo $p_tgl_surat_diterima; ?></td>
					
				</tr>
				<tr>
					<td id="first-child">Nomor Relaas</td>
					<td colspan="2"><?php echo $p_nomor_relaas; ?></td>
				</tr>
				<tr>
					<td id="first-child">Tgl Penunjukkan Jurusita</td>
					<td colspan="2"><?php echo $p_tgl_penunjukan_jurusita; ?></td>
				</tr>
				<tr>
					<td id="first-child">Jurusita/Jurusita Pengganti</td>
					<td colspan="2"><?php echo $p_jurusita_nama; ?></td>
				</tr>
				<tr>
					<td id="first-child">Tanggal Pelaksanaan Delegasi</td>
					<td colspan="2"><?php echo $p_tgl_relaas; ?></td>
				</tr>
				<tr>
					<td id="first-child">Status Delegasi</td>
					<td colspan="2"><?php echo $p_status_delegasi; ?></td>
				</tr>
				<tr>
					<td id="first-child">Catatan Status Delegasi</td>
					<td colspan="2"><?php echo $p_catatan; ?></td>
				</tr>
			</tbody>
		</table>
		<table id="infoPerkara" style="font-size:12px;width:100%">
			<col width="20%">
			<col width="80%">
			<tbody>
				<tr>
					<td colspan="2" style="text-align:center;background-color:#A3DBA8;color:#111;"><strong>Pengiriman Berkas Kembali</strong></td>
				</tr>
				<tr>
					<td id="first-child">Nomor Surat</td>
					<td><?php echo $p_nomor_surat_pengantar_relaas; ?></td>
				</tr>
				<tr>
					<td id="first-child">Tanggal Pengiriman (Tanggal Resi)</td>
					<td><?php echo $p_tgl_pengiriman_relaas; ?></td>
				</tr>
				<tr>
					<td id="first-child">Nomor Resi Pengiriman</td>
					<td><?php echo $p_nomor_resi; ?></td>
				</tr>
				<tr>
					<td id="first-child">Biaya Pelaksanaan</td>
					<?php 
					if (intval($p_biaya)>0) {
						$biaya=number_format(strval($p_biaya),0,",",".");
						$terbilang=$this->templatehelper->Terbilang(intval(number_format(strval($p_biaya),0,".","")));
					}else{
						$biaya=0;
						$terbilang="";
					}
					?>
					<td><?php echo $biaya.' ('.$terbilang.' rupiah )'; ?></td>

				</tr>


				<tr><td colspan="2"></td></tr>
				<input type="hidden" id="idalur" name="idalur" value="<?php echo base64_encode($this->encrypt->encode($idalur));?>">
				<input type="hidden" id="delegasi_id_proses" name="delegasi_id_proses" value="<?php echo $p_enc_delegasi;?>">
				<input type="hidden" id="id_pn_asal" name="id_pn_asal"value="<?php echo $p_enc_pn_asal;?>">
				<input type="hidden" id="id_pn_tujuan" name="id_pn_tujuan"value="<?php echo $p_enc_pn_tujuan;?>">
			</tbody>
		</table>
<?php
}else{
		?>
		<table id='infoPerkara' style="font-size:12px;width:100%">
			<col width="20%">
			<col width="80%">
			<tbody>
				<tr>
					<?php 
					if ($idalur==1){
						echo '<td>[<a href="'.base_url('update_delegasi/'.base64_encode($this->encrypt->encode($idalur)).'/'.base64_encode($this->encrypt->encode($delegasi_id)).'/'.base64_encode($this->encrypt->encode($id_pn_asal)).'/'.base64_encode($this->encrypt->encode($id_pn_tujuan))).'"> Update Delegasi </a>]</td>';
					}else{
						echo '<td colspan="2" id="first-child" style="font-size:14px;">PERMOHONAN DELEGASI BELUM DIPROSES OLEH PENGADILAN TUJUAN</td>';
					}
					?>
				</tr>
				<tr>
				</tr>
			</tbody>
		</table>
<?php } ?>
<script type="text/javascript">

$('#download').click(function(){
	var idalur=$('#idalur').val();
	var delegasi_id_proses=$('#delegasi_id_proses').val();
	var id_pn_asal=$('#id_pn_asal').val();
	var id_pn_tujuan=$('#id_pn_tujuan').val();
	window.open("<?php echo base_url()?>downloadFileProses/downloadFileProses/"+idalur+'/'+delegasi_id_proses+'/'+id_pn_asal+'/'+id_pn_tujuan);
	closeLoading();
});
</script>
