<?php
// Get values
$payment_id = $_GET['payment_id'] ?? '';
$status = $payment_id ? "PAID" : "UNPAID";

// Demo values (real amount/order DB se aa sakta hai)
$amount = $_GET['amount'] ?? '---';
$date = date("d M Y");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Payment Receipt</title>

<style>
body{
  font-family: Arial, sans-serif;
  background:#f4f6f8;
}
.receipt{
  max-width:800px;
  margin:40px auto;
  background:#fff;
  border:1px solid #ddd;
  padding:30px;
}
.header{
  display:flex;
  justify-content:space-between;
  align-items:center;
}
.header img{
  max-width:120px;
}
.status{
  padding:8px 16px;
  border-radius:20px;
  font-weight:bold;
  color:#fff;
}
.paid{ background:#28a745; }
.unpaid{ background:#dc3545; }

hr{
  margin:25px 0;
}

.details{
  display:flex;
  justify-content:space-between;
}
.box{
  width:48%;
}
.box h3{
  margin-bottom:10px;
  border-bottom:2px solid #eee;
  padding-bottom:6px;
}

table{
  width:100%;
  margin-top:20px;
  border-collapse:collapse;
}
table th, table td{
  border:1px solid #ddd;
  padding:12px;
  text-align:left;
}
table th{
  background:#f7f7f7;
}

.total{
  text-align:right;
  margin-top:20px;
  font-size:18px;
}

.footer{
  text-align:center;
  margin-top:30px;
  color:#777;
  font-size:13px;
}
</style>
</head>

<body onload="window.print()">

<div class="receipt">

  <!-- HEADER -->
  <div class="header">
    <img src="logo.png" alt="Company Logo">

    <div class="status <?php echo ($status=="PAID") ? 'paid':'unpaid'; ?>">
      <?php echo $status; ?>
    </div>
  </div>

  <hr>

  <!-- COMPANY & CLIENT -->
  <div class="details">
    <div class="box">
      <h3>Company Details</h3>
      <p>
        <strong>RBV Royals Biltmore Vacation</strong><br>
        Luxury Resort & Hotel<br>
        India<br>
        Email: info@rbvroyalsbiltmorevacation.com<br>
        Phone: +91 XXXXXXXXXX
      </p>
    </div>

    <div class="box">
      <h3>Client Details</h3>
      <p>
        <strong>Name:</strong> Guest Customer<br>
        <strong>Email:</strong> client@email.com<br>
        <strong>Mobile:</strong> 9XXXXXXXXX<br>
        <strong>Address:</strong> Client Address
      </p>
    </div>
  </div>

  <!-- PAYMENT INFO -->
  <table>
    <tr>
      <th>Description</th>
      <th>Payment ID</th>
      <th>Date</th>
      <th>Amount (?)</th>
    </tr>
    <tr>
      <td>Online Payment</td>
      <td><?php echo $payment_id ? $payment_id : '---'; ?></td>
      <td><?php echo $date; ?></td>
      <td><?php echo $amount; ?></td>
    </tr>
  </table>

  <div class="total">
    <strong>Total Paid: ? <?php echo $amount; ?></strong>
  </div>

  <div class="footer">
    This is a system generated receipt.<br>
    © <?php echo date("Y"); ?> RBV Royals Biltmore Vacation
  </div>

</div>

</body>
</html>
