first commit
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
$riwayat_kegiatan_id=$_POST['riwayat_kegiatan_id'];
|
||||
?>
|
||||
|
||||
<form id="fr_cv" name="fr_cv" class="form-inline" method="post" onsubmit="return false;" enctype="multipart/form-data">
|
||||
<div class="btn-group btn-group-justified">
|
||||
<a class="btn btn-default waves-effect waves-light" role="button" id="btn_load_cv"><i class="fa fa-folder-open"></i> Load PDF</a>
|
||||
<a class="btn btn-danger waves-effect waves-light" role="button" id="btn_upl_cv"><i class="fa fa-upload"></i> Upload</a>
|
||||
</div>
|
||||
<input type="hidden" value="<?php echo $riwayat_kegiatan_id; ?>" name="riwayat_kegiatan_id">
|
||||
<input type="file" name="input_load_cv" class="filestyle" accept=".pdf" style="display:none" data-buttonbefore="true" id="input_load_cv">
|
||||
</form>
|
||||
<div id="tabel_upl_cv"></div><br>
|
||||
<button type="button" class="btn btn-primary btn-block" id="kirim_pdf_spt">Simpan</button>
|
||||
|
||||
<script>
|
||||
var riwayat_kegiatan_id=$('#riwayat_kegiatan_id').val();
|
||||
$("#btn_upl_cv").hide();
|
||||
$("#kirim_pdf_spt").hide();
|
||||
$('#tabel_upl_cv').load("app/cekpeserta/peserta/tabel_upl_cv.php",{riwayat_kegiatan_id:riwayat_kegiatan_id});
|
||||
|
||||
|
||||
$('#btn_load_cv').click(function(){
|
||||
$('#input_load_cv').trigger('click');
|
||||
});
|
||||
|
||||
$('#input_load_cv').change(function(e){
|
||||
var fileName = e.target.files[0].name;
|
||||
$("#btn_upl_cv").show();
|
||||
});
|
||||
|
||||
$('#btn_upl_cv').click(function(){
|
||||
$("#fr_cv").trigger('submit');
|
||||
});
|
||||
|
||||
$("#fr_cv").on('submit',(function(e) {
|
||||
e.preventDefault();
|
||||
$.ajax({
|
||||
url: "app/cekpeserta/peserta/upl_cv.php",
|
||||
type: "POST",
|
||||
data: new FormData(this),
|
||||
contentType: false,
|
||||
cache: false,
|
||||
processData:false,
|
||||
success: function(data) {
|
||||
var riwayat_kegiatan_id = $('#riwayat_kegiatan_id').val();
|
||||
$('#tabel_upl_cv').load("app/cekpeserta/peserta/tabel_upl_cv.php",{riwayat_kegiatan_id:riwayat_kegiatan_id});
|
||||
$("#btn_upl_cv").hide();
|
||||
$("#kirim_pdf_spt").show();
|
||||
}
|
||||
});
|
||||
}));
|
||||
|
||||
$('#kirim_pdf_spt').click(function(){
|
||||
alert('Tersimpan..');
|
||||
$('#modal_spt').modal('hide');
|
||||
$('body').removeClass('modal-open');
|
||||
$('.modal-backdrop').remove();
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user