82 lines
3.4 KiB
PHP
82 lines
3.4 KiB
PHP
<?php
|
|
include("../../koneksi.php");
|
|
$riwayat_kegiatan_id=$_POST['riwayat_kegiatan_id'];
|
|
?>
|
|
|
|
<input type="hidden" id="riwayat_kegiatan_ida" value="<?php echo $riwayat_kegiatan_id; ?>">
|
|
<div class="row port">
|
|
<div class="portfolioContainer">
|
|
<?php
|
|
$dok=pg_query("SELECT * FROM dokumentasi WHERE riwayat_kegiatan_id='$riwayat_kegiatan_id' ORDER BY id DESC");
|
|
while($rdok=pg_fetch_array($dok)) {$foto=$rdok['file'];$ket=$rdok['keterangan'];
|
|
?>
|
|
<div class="col-sm-6 col-lg-3 col-md-4 webdesign illustrator">
|
|
<div class="gal-detail thumb">
|
|
<a href="#" class="view_scan" id-pic="<?php echo $rdok['id'];?>">
|
|
<img name="pic" id="<?php echo $rdok['id']; ?>" src="<?php echo 'app/kehadiran/dokumentasi/pic/'.$foto; ?>" class="thumb-img" alt="work-thumbnail">
|
|
</a>
|
|
|
|
<h4><!--<small><b style="color:black"><?php echo $ket; ?></b></small>-->
|
|
<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>
|
|
</div>
|
|
<?php
|
|
}
|
|
?>
|
|
</div>
|
|
</div> <!-- End row -->
|
|
<script type="text/javascript">
|
|
// $('html, body').animate({scrollTop:$(document).height()}, 'slow');
|
|
</script>
|
|
<script>
|
|
|
|
$('.view_scan').click(function(){
|
|
var id = $(this).attr('id-pic');
|
|
$("#modal_dokumentasi").modal('show');
|
|
$("#modal_body_dokumentasi").html("");
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "app/kehadiran/dokumentasi/modal.php",
|
|
data: 'id='+id,
|
|
success: function(data){$('#modal_body_dokumentasi').html(data);}
|
|
});
|
|
});
|
|
|
|
|
|
$('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/kehadiran/dokumentasi/delete.php",
|
|
data: 'id='+id
|
|
+'&key='+key,
|
|
success: function(data){
|
|
var riwayat_kegiatan_id = $('#riwayat_kegiatan_ida').val();
|
|
$('#tabel_dokumentasi').load("app/kehadiran/dokumentasi/tabel.php", {riwayat_kegiatan_id: riwayat_kegiatan_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>
|