Files
eletter/src/app/tindaklanjut/modal_vpic.php
2024-07-14 13:15:09 +07:00

55 lines
1.7 KiB
PHP

<?php
include("../koneksi.php");
$komen_id = $_POST['id'];
$baseURL = '../../../public/doc/';
$dir = 'tindaklanjut/img/';
?>
<?php
$dok = pg_query($koneksi, "SELECT * FROM scan_komen WHERE komen_id='$komen_id'
AND LOWER(file) LIKE ANY (ARRAY['%jpg','%jpeg','%png'])
ORDER BY id DESC
");
while ($rdok = pg_fetch_array($dok)) {
$foto = $rdok['file'];
$file_id = $rdok['id'];
?>
<div class="row">
<div class="col-lg-12">
<button type="button" id="<?php echo $file_id; ?>" class="btn btn-block btn-success waves-effect waves-light pr_scan_surat">Print</button>
</div>
</div>
<br>
<div class="row">
<div class="col-lg-12">
<center>
<!-- <div class="gal-detail"> -->
<img name="pic" id="<?php echo $rdok['id']; ?>" src="<?= $baseURL . $dir . $foto; ?>" class="img-thumbnail" alt="work-thumbnail">
<!-- </div> -->
</center>
</div>
</div>
<hr>
<?php
}
?>
<script>
$('.pr_scan_surat').click(function() {
var id = $(this).attr('id');
var w = 1000;
var h = 800;
var left = Number((screen.width / 2) - (w / 2));
var tops = Number((screen.height / 2) - (h / 2));
$.post('app/tindaklanjut/print_pic.php', {
id: id
}, function(result) {
WinId = window.open('toolbar=no, location=no, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=no, copyhistory=no, width=' + w + ', height=' + h + ', top=' + tops + ', left=' + left);
WinId.document.open();
WinId.document.write(result);
WinId.document.close();
WinId.focus();
});
});
</script>