71 lines
2.2 KiB
PHP
71 lines
2.2 KiB
PHP
<?php
|
|
include("../koneksi.php");
|
|
$surat_id = $_POST['surat_id'];
|
|
?>
|
|
|
|
<style type="text/css">
|
|
.gal-detail .btn {
|
|
position: absolute;
|
|
top: 50%;
|
|
left: 50%;
|
|
transform: translate(-50%, -50%);
|
|
-ms-transform: translate(-50%, -50%);
|
|
}
|
|
</style>
|
|
|
|
<input type="hidden" id="riwayat_keluhan_ida" value="<?php echo $surat_id; ?>">
|
|
<div class="row port">
|
|
<div class="portfolioContainer">
|
|
<?php
|
|
$dok = pg_query($koneksi, "SELECT * FROM scan
|
|
WHERE surat_id = '$surat_id'
|
|
AND LOWER(file) NOT IN ('%.jpg', '%.jpeg', '%.png')
|
|
ORDER BY id DESC");
|
|
while ($rdok = pg_fetch_array($dok)) {
|
|
$foto = $rdok['file'];
|
|
?>
|
|
<div class="col-sm-6 col-lg-3 col-md-4 webdesign illustrator">
|
|
<div class="gal-detail thumb">
|
|
<img name="pic" id="<?php echo $rdok['id']; ?>" src="<?php echo 'app/kirim/dok/' . $foto; ?>" class="img-thumbnail" alt="work-thumbnail">
|
|
<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>
|
|
</div>
|
|
</div>
|
|
<?php
|
|
}
|
|
?>
|
|
</div>
|
|
</div> <!-- End row -->
|
|
|
|
<script type="text/javascript">
|
|
$('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/kirim/delete.php",
|
|
data: {id:id,key:key},
|
|
success: function(data) {
|
|
var surat_id = $('#riwayat_keluhan_ida').val();
|
|
$('#tabel_pic').load("app/kirim/tabel_pic.php", {
|
|
surat_id: surat_id
|
|
});
|
|
var key = "jumlah_jpg";
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "app/kirim/crud.php",
|
|
data: {surat_id:surat_id,key:key},
|
|
success: function(data) {
|
|
$('.sq' + surat_id).html(' (' + data + ')');
|
|
$('.xq' + surat_id).html(data);
|
|
}
|
|
});
|
|
}
|
|
});
|
|
} else {}
|
|
});
|
|
</script>
|