Files
eletter-backup/dev/app/smasuk/tabel.php
2024-05-31 14:18:00 +07:00

65 lines
2.4 KiB
PHP

<?php
include("../koneksi.php");
$surat_id=$_POST['surat_id'];
?>
<br>
<input type="hidden" id="surat_ida" value="<?php echo $surat_id; ?>">
<div class="row port">
<div class="portfolioContainer">
<?php
$dok=pg_query("SELECT * FROM scan WHERE surat_id='$surat_id' AND LOWER(file) LIKE '%.jpg'ORDER BY id DESC");
while($rdok=pg_fetch_array($dok)) {$foto=$rdok['file'];
?>
<div class="col-lg-6 webdesign illustrator">
<a href="#" class="image-popup">
<img src="<?php echo 'app/smasuk/dok/'.$foto; ?>" class="thumb-img" alt="work-thumbnail">
</a>
<h4>
<button type="button" name="dok_delete" style="height:22px;border-radius: 50%;"class="btn btn-danger btn-xs pull-right" id="<?php echo $rdok[0];?>" data-content="Hapus" rel="popover" data-placement="bottom" data-trigger="hover">
<i class="fa fa-remove"></i>
</button>
</h4>
</div>
<?php
}
?>
</div>
</div> <!-- End row -->
<script type="text/javascript">
// $('html, body').animate({scrollTop:$(document).height()}, 'slow');
</script>
<script>
$('button[name="dok_delete"]').click(function(){
var x = confirm("Anda yakin ingin menghapus ?");
if (x) {
var key = "delete_dok";
var id = $(this).attr('id');
var rowElement = $(this).parent().parent();
$.ajax({
type: "POST",
url: "app/smasuk/delete.php",
data: 'id='+id
+'&key='+key,
success: function(data){
var surat_id = $('#surat_ida').val();
$('#dok_tbl').load("app/smasuk/tabel.php", {surat_id: surat_id});
}
});
} else {}
});
$('.image-popup').magnificPopup({
type: 'image',
closeOnContentClick: true,
mainClass: 'mfp-fade',
gallery: {
enabled: true,
navigateByImgClick: true,
preload: [0,1] // Will preload 0 - before current, and 1 after the current image
}
});
</script>