<?php
// Retrieve data from URL parameters
$bank_name = $_GET['bank_name'] ?? '';
$amount = $_GET['amount'] ?? '';
$payment_status = $_GET['payment_status'] ?? '';
$date_deposit = $_GET['date_deposit'] ?? '';

// Format the date properly
$date_deposit = date('d-m-Y', strtotime($date_deposit));
?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Income Voucher</title>
    <style>
        body {
            font-family: 'Arial', sans-serif;
            margin: 0;
            padding: 0;
            background-color: #fff;
        }
        .voucher-container {
            width: 80mm; 
            margin: 10px auto;
            padding: 10px;
            border: 1px solid #000;
            text-align: center;
        }
        .voucher-header {
            font-size: 20px;
            font-weight: bold;
            color: #333;
            margin-bottom: 10px;
        }
        .voucher-header img {
            max-width: 75px;
            margin-bottom: 10px;
        }
        .voucher-details {
            font-size: 14px;
            margin: 15px 0;
            line-height: 1.5;
        }
        .voucher-details span {
            font-weight: bold;
        }
        .voucher-divider {
            margin: 10px 0;
            border-top: 1px dashed #000;
        }
        .voucher-footer {
            font-size: 12px;
            color: #555;
            margin-top: 15px;
        }
        .btn-print, .btn-back {
            display: block;
            width: 100%;
            padding: 10px;
            text-align: center;
            background-color: #4CAF50;
            color: white;
            font-size: 16px;
            font-weight: bold;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            margin-top: 20px;
        }
        .btn-print:hover, .btn-back:hover {
            background-color: #45a049;
        }
        .btn-back {
            background-color: #f44336;
        }
    </style>
</head>
<body>

    <div class="voucher-container">
        <div class="voucher-header">
            <!-- <img src="invoice_logo-removebg-preview.png" alt="Logo">  -->
            <h2>Income Voucher</h2>
        </div>

        <div class="voucher-details">
            <p><span>Bank Name:</span> <?= htmlspecialchars($bank_name) ?></p>
            <p><span>Amount:</span> <?= htmlspecialchars($amount) ?></p>
            <p><span>Payment Status:</span> <?= htmlspecialchars($payment_status) ?></p>
            <p><span>Date of Deposit:</span> <?= htmlspecialchars($date_deposit) ?></p>
        </div>

        <div class="voucher-divider"></div>

        <div class="voucher-footer">
            <p>Thank you for your payment!</p>
            <p>Receipt generated for your records.</p>
        </div>

        <button class="btn-print" onclick="window.print()">Print Voucher</button>

        <button class="btn-back" onclick="window.history.back()">Back</button>
    </div>

</body>
</html>
