first commit
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
include('../koneksi.php');
|
||||
$key=$_POST['key'];
|
||||
|
||||
if ($key=='simpan_pel_setting') {
|
||||
$id=$_POST['id'];
|
||||
$berkas=$_POST['berkas'];
|
||||
|
||||
$cek_pel_setting=pg_query("SELECT id FROM syarat_pel WHERE id='$id'");
|
||||
$row_pel_setting = pg_fetch_row($cek_pel_setting);
|
||||
if ($row_pel_setting[0] > 0) {
|
||||
$upd_pel_setting = pg_query("UPDATE syarat_pel SET
|
||||
berkas='$berkas'
|
||||
WHERE id=$id");
|
||||
} else {
|
||||
$ins_pel_setting = pg_query("INSERT into syarat_pel (
|
||||
berkas
|
||||
) values(
|
||||
'$berkas'
|
||||
)
|
||||
");
|
||||
}
|
||||
} else
|
||||
if ($key=='delete_pel_setting') {
|
||||
$id=$_POST['id'];
|
||||
$d=pg_query("SELECT file FROM syarat_pel WHERE id='$id'");
|
||||
while($r=pg_fetch_array($d)) {$fil=$r[0];}
|
||||
$path = "pdf/pdf/".$fil;
|
||||
if(file_exists($path)){unlink($path);}
|
||||
$del_pel_setting = pg_query("DELETE FROM syarat_pel WHERE id='$id'");
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,119 @@
|
||||
<style type="text/css">
|
||||
.no-border{
|
||||
border:none;
|
||||
}
|
||||
.modal-backdrop {
|
||||
visibility: hidden !important;
|
||||
}
|
||||
.modal.in {
|
||||
background-color: rgba(0,0,0,0.5);
|
||||
}
|
||||
</style>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<p class="judul_page"><i class="mdi mdi-settings m-r-5"></i>Setting Pelatihan</p>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-2">
|
||||
<button type="button" id="btn_baru_pel_setting" class="btn btn-default waves-effect waves-light" style="font-family:Arial;font-weight:bold;color:black">
|
||||
<i class="fa fa-plus m-r-5"></i>
|
||||
kelengkapan dan persyaratan pelatihan
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div id="tabel_pel_setting"></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="modal_pel_setting" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header no-border">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title" id="myModalLabel">Input</h4>
|
||||
</div>
|
||||
<div class="modal-body" id="modal_body_pel_setting"></div>
|
||||
<div class="modal-footer no-border">
|
||||
<button type="button" class="btn btn-default waves-effect" data-dismiss="modal" id="keluar_pel_setting">Keluar</button>
|
||||
<button type="button" class="btn btn-primary waves-effect waves-light" id="simpan_pel_setting">Simpan</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="modal_file" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header no-border">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title" id="myModalLabel">Upload Contoh Dokumen</h4>
|
||||
</div>
|
||||
<div class="modal-body" id="modal_body_file"></div>
|
||||
<div class="modal-footer no-border">
|
||||
<button type="button" class="btn btn-success btn-block waves-effect" data-dismiss="modal" id="keluar_file">Keluar</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$('#tabel_pel_setting').load("app/pel_setting/tabel.php");
|
||||
|
||||
$('#btn_baru_pel_setting').click(function(){
|
||||
var id = 0;
|
||||
$('#modal_pel_setting').modal('show');
|
||||
$('#modal_body_pel_setting').html("");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "app/pel_setting/modal.php",
|
||||
data: 'id='+id,
|
||||
success: function(data){
|
||||
$('#modal_body_pel_setting').html(data);
|
||||
$('#nama_pel_setting').first().focus().selected();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#simpan_pel_setting').click(function(){
|
||||
var id = $('#syarat_pel_id').val();
|
||||
var berkas = $('#berkas').val();
|
||||
var key = 'simpan_pel_setting';
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "app/pel_setting/crud.php",
|
||||
data: 'id='+id
|
||||
+'&berkas='+berkas
|
||||
+'&key='+key,
|
||||
success: function(data){
|
||||
$('#modal_pel_setting').modal('hide');
|
||||
$('body').removeClass('modal-open');
|
||||
$('.modal-backdrop').remove();
|
||||
alert('tersimpan..');
|
||||
$('#tabel_pel_setting').load("app/pel_setting/tabel.php");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
$("#modal_pel_setting").on("hidden.bs.modal", function () {
|
||||
$(this).off('hidden.bs.modal');
|
||||
});
|
||||
|
||||
$(document).on('hidden.bs.modal', function (event) {
|
||||
if ($('.modal:visible').length) {
|
||||
$('body').addClass('modal-open');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
include ('../koneksi.php');
|
||||
$id=$_POST['id'];
|
||||
$data=pg_query("SELECT * FROM syarat_pel WHERE id=$id");
|
||||
while($row=pg_fetch_array($data)) {
|
||||
$id=$row['id'];
|
||||
$berkas=$row['berkas'];
|
||||
}
|
||||
?>
|
||||
|
||||
<form role="form">
|
||||
<div class="form-group">
|
||||
<label for="exampleInputEmail1">Berkas</label>
|
||||
<input type="hidden" value="<?php echo $id; ?>" id="syarat_pel_id">
|
||||
<input type="text" class="form-control" value="<?php echo $berkas; ?>" id="berkas">
|
||||
</div>
|
||||
</form>
|
||||
@@ -0,0 +1,4 @@
|
||||
php_value upload_max_filesize 900M
|
||||
php_value post_max_size 900M
|
||||
php_value max_execution_time 9000
|
||||
php_value max_input_time 9000
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
include('../../koneksi.php');
|
||||
$key=$_POST['key'];
|
||||
if ($key=='delete_cv') {
|
||||
$id=$_POST['id'];
|
||||
$d=pg_query("SELECT file FROM syarat_pel WHERE id='$id'");
|
||||
while($r=pg_fetch_array($d)) {$fil=$r[0];}
|
||||
$del_pr=pg_query("UPDATE syarat_pel SET file=NULL WHERE id='$id'");
|
||||
$path = "pdf/".$fil;
|
||||
if(file_exists($path)){unlink($path);}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
include('../../koneksi.php');
|
||||
$syarat_pel_id=$_POST['syarat_pel_idzz'];
|
||||
?>
|
||||
<input type="hidden" value="<?php echo $syarat_pel_id; ?>" id="syarat_pel_idxz" style="margin-bottom:6px">
|
||||
<?php
|
||||
$data_pdf=pg_query("SELECT file,id FROM syarat_pel WHERE id='$syarat_pel_id' ORDER BY id DESC");
|
||||
while($rdata_pdf=pg_fetch_array($data_pdf)) {$pdf=$rdata_pdf[0];
|
||||
if (($pdf==NULL) || ($pdf=='')) {/*echo "File PDF belum diupload..";*/} else {
|
||||
?>
|
||||
<div class="thumb" style="background-color:#ece9d8;padding:8px;margin-top:6px">
|
||||
<a href='app/pel_setting/pdf/pdf/<?php echo $pdf; ?>' target='_blank'><?php echo $pdf; ?></a>
|
||||
<!--<embed src="app/kirim/pdf/pdf/<?php echo $pdf; ?>#toolbar=0" width="100%" height="300"></embed>-->
|
||||
<button type="button" name="cv_deletse"
|
||||
style="height:22px;border-radius: 50%"class="btn btn-danger btn-xs pull-right" id="<?php echo $rdata_pdf[1];?>" data-content="Hapus" rel="popover"
|
||||
data-placement="bottom" data-trigger="hover">
|
||||
<i class="fa fa-remove"></i>
|
||||
</button>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<script>
|
||||
$('button[name="cv_deletse"]').click(function(){
|
||||
var x = confirm("Anda yakin ingin menghapus ?");
|
||||
if (x) {
|
||||
var key = "delete_cv";
|
||||
var id = $(this).attr('id');
|
||||
var rowElement = $(this).parent().parent();
|
||||
var syarat_pel_id=$('#syarat_pel_idxz').val();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "app/pel_setting/pdf/crud.php",
|
||||
data: 'id='+id
|
||||
+'&syarat_pel_id='+syarat_pel_id
|
||||
+'&key='+key,
|
||||
success: function(data){
|
||||
var syarat_pel_id=$('#syarat_pel_idxz').val();
|
||||
$('#tabel_upl_cvz').load("app/pel_setting/pdf/tabel_upl_cv.php",{syarat_pel_idzz:syarat_pel_id});
|
||||
}
|
||||
});
|
||||
} else {}
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
print_r($_POST);
|
||||
include("../../koneksi.php");
|
||||
$syarat_pel_id=$_POST['syarat_pel_id_uploadz'];
|
||||
$folder = "pdf";
|
||||
$tmp_name = $_FILES["input_load_cvz"]["tmp_name"];
|
||||
$name = $folder."/".$syarat_pel_id."_".$_FILES["input_load_cvz"]["name"];
|
||||
$name_pdf = $syarat_pel_id."_".$_FILES["input_load_cvz"]["name"];
|
||||
|
||||
move_uploaded_file($tmp_name, $name);
|
||||
$upd=pg_query("UPDATE syarat_pel SET file='$name_pdf' WHERE id=$syarat_pel_id");
|
||||
?>
|
||||
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
<?php
|
||||
include('../koneksi.php');
|
||||
?>
|
||||
|
||||
<script type="text/javascript">$("#tabel_data_pel_setting").DataTable({"stateSave": true,"paging": true,"lengthChange": true,"searching": true,"ordering": false,"info": true,"autoWidth": false,lengthMenu: [
|
||||
[100, -1],
|
||||
[100, 'All']
|
||||
]});</script>
|
||||
<table id="tabel_data_pel_setting" class="table table-striped table-condensed table-bordered" cellpadding="1"
|
||||
style="font-family:'RubReg';font-size:13px"
|
||||
>
|
||||
<thead>
|
||||
<tr style="text-align:center;color:black;font-weight:bold">
|
||||
<td width="30">No</td>
|
||||
<td>Berkas</td>
|
||||
<td width="10px;">#</td>
|
||||
<td align="center" width="70px;">Tools</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody style="color:black">
|
||||
<?php
|
||||
$no=1;
|
||||
$data = pg_query("SELECT id,berkas FROM syarat_pel ORDER BY id ASC");
|
||||
while($row=pg_fetch_array($data)) {
|
||||
?>
|
||||
<tr>
|
||||
<td class="kiri" align="center"><?php echo $no; ?></td>
|
||||
<td><?php echo $row['berkas']; ?></td>
|
||||
<td align="center">
|
||||
<button type="button" name="file_contoh" style="height:22px;"class="btn btn-default btn-xs file_contoh"
|
||||
id="<?php echo $row['id'];?>" data-content="Upload Contoh Dokumen"
|
||||
rel="popover" data-placement="top" data-trigger="hover">
|
||||
<i class="fa fa-file m-r-5"></i>
|
||||
</button>
|
||||
</td>
|
||||
<td class="kanan" align="center">
|
||||
<button type="button" name="edit_pel_setting" style="height:22px;" class="btn btn-teal btn-xs edit_pel_setting" id="<?php echo $row['id'];?>" data-content="Edit Data" rel="popover" data-placement="top" data-trigger="hover">
|
||||
<i class="fa fa fa-pencil"></i>
|
||||
</button>
|
||||
<button type="button" name="delete_pel_setting" style="height:22px;"class="btn btn-danger btn-xs delete_pel_setting" id="<?php echo $row['id'];?>" data-content="Hapus" rel="popover" data-placement="top" data-trigger="hover">
|
||||
<i class="fa fa-remove"></i>
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
$no++;
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
$('button[name="file_contoh"]').popover();
|
||||
$('button[name="edit_pel_setting"]').popover();
|
||||
$('button[name="delete_pel_setting"]').popover();
|
||||
|
||||
$("#tabel_data_pel_setting").on('click','.file_contoh',function(){
|
||||
var syarat_pel_id = $(this).attr('id');
|
||||
var currentRow=$(this).closest("tr");
|
||||
var berkas = currentRow.find("td:eq(1)").text();
|
||||
$('#modal_file').modal('show');
|
||||
$('#modal_body_file').html("");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "app/pel_setting/upd_file.php",
|
||||
data: 'syarat_pel_id='+syarat_pel_id
|
||||
+'&berkas='+berkas,
|
||||
success: function(data){
|
||||
$('#modal_body_file').html(data);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#tabel_data_pel_setting").on('click','.edit_pel_setting',function(){
|
||||
var id = $(this).attr('id');
|
||||
$('#modal_pel_setting').modal('show');
|
||||
$('#modal_body_pel_setting').html("");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "app/pel_setting/modal.php",
|
||||
data: 'id='+id,
|
||||
success: function(data){
|
||||
$('#modal_body_pel_setting').html(data);
|
||||
$('#berkas').first().focus().selected();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$("#tabel_data_pel_setting").on('click','.delete_pel_setting',function(){
|
||||
var x = confirm("Anda yakin ingin menghapus ?");
|
||||
if (x) {
|
||||
var key = "delete_pel_setting";
|
||||
var id = $(this).attr('id');
|
||||
var rowElement = $(this).parent().parent();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "app/pel_setting/crud.php",
|
||||
data: 'id='+id
|
||||
+'&key='+key,
|
||||
success: function(data){
|
||||
rowElement.fadeOut(500).remove();
|
||||
}
|
||||
});
|
||||
} else {}
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
<?php
|
||||
include('../koneksi.php');
|
||||
$syarat_pel_id=$_POST['syarat_pel_id'];
|
||||
$berkas=$_POST['berkas'];
|
||||
?>
|
||||
<h4><?php echo $berkas; ?></h4>
|
||||
<form id="fr_cvz" name="fr_cvz" class="form-inline" method="post" onsubmit="return false;" enctype="multipart/form-data">
|
||||
|
||||
<input type="hidden" value="<?php echo $syarat_pel_id; ?>" name="syarat_pel_id_uploadz">
|
||||
<div class="btn-group btn-group-justified singit">
|
||||
<a class="btn btn-default waves-effect waves-light" role="button" id="btn_load_cvz"><i class="fa fa-folder-open"></i> Load File</a>
|
||||
<a class="btn btn-danger waves-effect waves-light" role="button" id="btn_upl_cvz"><i class="fa fa-upload"></i> Upload</a>
|
||||
</div>
|
||||
<input type="file" name="input_load_cvz" class="filestyle" style="display:none" data-buttonbefore="true" id="input_load_cvz">
|
||||
</form>
|
||||
|
||||
<div id="tabel_upl_cvz"></div>
|
||||
|
||||
<script>
|
||||
var syarat_pel_id = $('input[name="syarat_pel_id_uploadz"]').val();
|
||||
$('#btn_upl_cvz').hide();
|
||||
$('#tabel_upl_cvz').load("app/pel_setting/pdf/tabel_upl_cv.php",{syarat_pel_idzz:syarat_pel_id});
|
||||
|
||||
|
||||
$('#btn_load_cvz').click(function(){
|
||||
$('#input_load_cvz').trigger('click');
|
||||
});
|
||||
|
||||
$('#input_load_cvz').change(function(e){
|
||||
var fileName = e.target.files[0].name;
|
||||
$("#btn_upl_cvz").trigger('click');
|
||||
});
|
||||
|
||||
$('#btn_upl_cvz').click(function(){
|
||||
$("#fr_cvz").trigger('submit');
|
||||
});
|
||||
|
||||
$("#fr_cvz").on('submit',(function(e) {
|
||||
e.preventDefault();
|
||||
$.ajax({
|
||||
url: "app/pel_setting/pdf/upl_cv.php",
|
||||
type: "POST",
|
||||
data: new FormData(this),
|
||||
contentType: false,
|
||||
cache: false,
|
||||
processData:false,
|
||||
success: function(data) {
|
||||
alert('Data tersimpan..');
|
||||
var syarat_pel_id = $('input[name="syarat_pel_id_uploadz"]').val();
|
||||
$('#tabel_upl_cvz').load("app/pel_setting/pdf/tabel_upl_cv.php",{syarat_pel_idzz:syarat_pel_id});
|
||||
}
|
||||
});
|
||||
}));
|
||||
|
||||
/*
|
||||
var riwayat_syarat_pel_id = $('input[name="riwayat_syarat_pel_id_uploadz"]').val();
|
||||
$('#btn_upl_cvz').hide();
|
||||
|
||||
$('#tabel_upl_cvz').load("app/pel_setting/tabel_upl_cv.php",{riwayat_syarat_pel_idzz:riwayat_syarat_pel_id});
|
||||
$('#btn_load_cvz').click(function(){
|
||||
$('#input_load_cvz').trigger('click');
|
||||
});
|
||||
|
||||
$('#input_load_cvz').change(function(e){
|
||||
var fileName = e.target.files[0].name;
|
||||
$("#btn_upl_cvz").trigger('click');
|
||||
});
|
||||
|
||||
$('#btn_upl_cvz').click(function(){
|
||||
$("#fr_cvz").trigger('submit');
|
||||
});
|
||||
|
||||
$("#fr_cvz").on('submit',(function(e) {
|
||||
e.preventDefault();
|
||||
$.ajax({
|
||||
url: "app/pel_setting/upl_cv.php",
|
||||
type: "POST",
|
||||
data: new FormData(this),
|
||||
contentType: false,
|
||||
cache: false,
|
||||
processData:false,
|
||||
success: function(data) {
|
||||
alert('Data tersimpan..');
|
||||
var key="jumlah_nonjpg";
|
||||
var riwayat_syarat_pel_id = $('input[name="riwayat_syarat_pel_id_uploadz"]').val();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "app/st_pel/crud.php",
|
||||
data: 'riwayat_syarat_pel_id='+riwayat_syarat_pel_id
|
||||
+'&key='+key,
|
||||
success: function(data){
|
||||
$('.sr'+riwayat_syarat_pel_id).html(' ('+data+')');
|
||||
$('#tabel_upl_cvz').load("app/pel_setting/tabel_upl_cv.php",{riwayat_syarat_pel_idzz:riwayat_syarat_pel_id});
|
||||
$("#btn_upl_cvz").hide();
|
||||
var riwayat_pel_id=$('#riwayat_pel_id').val();
|
||||
var data_pegawai_id=$('#data_pegawai_id').val();
|
||||
$('#tabel_kelengkapan').load('app/st_pel/tabel_daftar.php',{riwayat_pel_id:riwayat_pel_id, data_pegawai_id:data_pegawai_id});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}));
|
||||
*/
|
||||
</script>
|
||||
Reference in New Issue
Block a user