<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

include __DIR__ . '/inc/db.php';

header('Content-Type: text/html'); // ✅ Return HTML, not JSON

$id = $_POST['id'];

$result = mysqli_query($conn, "SELECT * FROM package_payments WHERE id = '$id'");
$row = mysqli_fetch_assoc($result);

if ($row['payment_mode'] === 'cheque') {
    echo "<strong>Cheque No:</strong> " . htmlspecialchars($row['cheque_no']) . "<br>";
    echo "<strong>Bank Name:</strong> " . htmlspecialchars($row['bank_name']) . "<br>";
} elseif ($row['payment_mode'] === 'upi') {
    echo "<strong>UPI ID:</strong> " . htmlspecialchars($row['upi_details']) . "<br>";
    // echo "<strong>Reference No:</strong> " . htmlspecialchars($row['upi_reference']) . "<br>";
} else {
    echo "No additional info available.";
}
