?
| Path : /home/u949514618/domains/drpktiwari.com/public_html/admin/ |
| Current File : /home/u949514618/domains/drpktiwari.com/public_html/admin/print_receipt.php |
<?php
if (!isset($_GET['file'])) {
die("No file specified!");
}
$file = $_GET['file'];
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Print Receipt</title>
<style>
body { text-align: center; }
img { max-width: 100%; height: auto; margin: 20px 0; }
button { padding: 10px 20px; font-size: 16px; cursor: pointer; }
</style>
<script>
function printReceipt() {
var printWindow = window.open('', '_blank');
printWindow.document.write('<html><head><title>Print Receipt</title></head><body>');
printWindow.document.write('<img src="<?php echo $file; ?>" style="width: 100%;">');
printWindow.document.write('</body></html>');
printWindow.document.close();
printWindow.print();
}
</script>
</head>
<body>
<h2>Generated Receipt</h2>
<img src="<?php echo $file; ?>" alt="Receipt Image">
<br>
<button onclick="printReceipt()">Print Receipt</button>
</body>
</html>