<div class="templatepopcentering" style="width:540px;margin-top: 1%;">
    <div id='pop' style="border: 1px solid #ffffff;">
		<div class="detil" style="padding: 2px;background-color: white;">
			<form id="frm_upload_file" style="background:white;margin:0;" method="post" enctype="multipart/form-data" action="<?php echo base_url().'fileupload_c/dummy';?>">
			<table id="tableDetilPerkara" style="padding:0;width:100%">              
            <tr>
				<td colspan="2" class="" style="background:white;border:0px;font-size: 20px;color: #648C03; text-align:center;height:50px">
				Kelola Dokumen Elektronik (E-Doc)
				</td>
			</tr>
			<tr>
				<td id="first-child" style="height:40px;">
				File Tersimpan
				</td>
				<td>
				<?php 
				if (isset($namadoktersimpan) && !empty($namadoktersimpan)){
					$dokumen=explode('/',$namadoktersimpan);
					$maxsegment=count($dokumen);
					$namadoktersimpan=$dokumen[$maxsegment-1];
					echo "<span style='color:orange;font-weight:bold'>".$namadoktersimpan."</span>"; 
				}else{
					echo "<span style='color:red;font-weight:bold'>Dokumen Belum Ada</span>";
				}?>
				</td>
			</tr>
			<tr>
				<td id="first-child" style="height:40px">
				Upload E-Doc
				</td>
				<td>
				<input type="file" name="fileform" id="fileform">
				</td>
			</tr>
			<tr>
				<td style="background:white;border:0px;text-align:right;" colspan="2">
				<hr class="thick-line" style="clear:both;">
				<input type="hidden" name="enc" id="enc" value="<?php echo $enc; ?>">
				<input type="hidden" name="enc1" id="enc1" value="<?php echo $enc1; ?>">
				<input type="hidden" name="from" id="from" value="<?php echo $from; ?>">
				<input type="hidden" name="urutan" id="urutan" value="<?php echo $urutan; ?>">
				<input type="button" id='close_form' value="Kembali" class="btn">
				<?php if (isset($namadoktersimpan) && !empty($namadoktersimpan)){?>
				<input type="button" id="hapus" value="Hapus" style="text-decoration:none" class="btn btn-danger">
				<?php }?>
				<input type="submit" id="simpan" value="Simpan" class="btn">
				</td>
			</tr>
			</table>
			</form>
		</div>
	</div>
</div>
<script type="text/javascript">
$('#simpan').hide();
$("#fileform").change(function(){
	$('#simpan').show();
});
$('#frm_upload_file').SubmitHandling({
	refresh:'1',
	setRefresh:1,
	divRef:'#konten',
	clicked:1,
	btnClicked:'#close_form',
	whenStatus:1,
	upload:1,
	urlUpload:"<?php echo base_url('fileupload_c/validatePost');?>"
});
$('#hapus').ButtonClickHandling({
	refresh:'1',
	setRefresh:1,
	divRef:'#konten',
	clicked:1,
	btnClicked:'#close_form',
	whenStatus:1,
	actions:'<?php echo base_url()?>fileupload_c/validateDocDelete/<?php echo $enc; ?>/<?php echo $from; ?>/<?php echo $enc1; ?>',
	formName:'#frm_upload_file',
	actionName:'Hapus Data'
});
$('#close_form').closingFormWin();
</script>