perubahan surat disposisi

This commit is contained in:
2024-07-14 13:15:09 +07:00
parent c3bff35638
commit 77e95ff2ee
109 changed files with 2140 additions and 2086 deletions
+64 -44
View File
@@ -1,47 +1,67 @@
<?php
include('../../koneksi.php');
if ($_POST['surat_idzz']) {
$surat_id=$_POST['surat_idzz'];
} else {
$surat_id='0';
}
?>
<input type="hidden" value="<?php echo $surat_id; ?>" id="surat_idxx">
<?php
$data_pdf=pg_query("SELECT file,id FROM scan WHERE surat_id='$surat_id' AND LOWER(file) LIKE '%.pdf' 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="gal-detail thumb" style="height:345px;background-color:#ece9d8;">
<embed src="app/smasuk/pdf/pdf/<?php echo $pdf; ?>#toolbar=0" width="100%" height="300"></embed>
<button type="button" name="cv_delete"
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
}
}
?>
<?php
include('../../koneksi.php');
$baseURL = '../../../public/doc/smasuk/dok/';
if ($_POST['surat_idzz']) {
$surat_id = $_POST['surat_idzz'];
} else {
$surat_id = '0';
}
?>
<input type="text" value="<?php echo $surat_id; ?>" id="surat_idxx">
<?php
$data_pdf = pg_query($koneksi, "SELECT file,id FROM scan WHERE surat_id='$surat_id' AND LOWER(file) LIKE '%.pdf' 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="gal-detail thumb" style="height:345px;background-color:#ece9d8;">
<embed src="<?= $baseURL.$pdf; ?>#toolbar=0" width="100%" height="300"></embed>
<button type="button" name="cv_delete" 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_delete"]').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();
$.ajax({
type: "POST",
url: "app/smasuk/pdf/crud.php",
data: 'id='+id
+'&key='+key,
success: function(data){
var surat_id=$('#surat_idxx').val();
$('#tabel_upl_cv').load("app/smasuk/pdf/tabel_upl_cv.php",{surat_id:surat_id});
}
});
} else {}
});
$('button[name="cv_delete"]').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();
$.ajax({
type: "POST",
url: "app/smasuk/pdf/crud.php",
data: 'id=' + id +
'&key=' + key,
success: function(response) {
var result=JSON.parse(response);
infoToast(result.icon,result.message);
var surat_id = $('#surat_idxx').val();
$('#tabel_upl_cv').load("app/smasuk/pdf/tabel_upl_cv.php", {
surat_id: surat_id
});
},
error:function(xhr){
var result = JSON.parse(xhr.responseText);
infoToast(result.icon,result.message);
}
});
}
});
function infoToast(icone, infone) {
Swal.fire({
// position: posisine,
icon: icone,
title: infone,
showConfirmButton: false,
timer: 2500
});
}
</script>