57 lines
1.7 KiB
PHP
57 lines
1.7 KiB
PHP
<?php
|
|
include("../koneksi.php");
|
|
$surat_id = $_POST['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'];
|
|
$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">
|
|
<!-- <div class="gal-detail"> -->
|
|
<center><img name="pic" id="<?php echo $rdok['id']; ?>" src="<?php echo 'app/kirim/dok/' . $foto; ?>" class="img-thumbnail" alt="work-thumbnail"></center>
|
|
<!-- </div> -->
|
|
</div>
|
|
</div>
|
|
<hr>
|
|
<?php
|
|
}
|
|
?>
|
|
<!--
|
|
</div>
|
|
</div> -->
|
|
|
|
|
|
<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/inbox/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>
|