<?php 
include 'header.php';
$kd = $_GET['kode_cs'] ?? '';

// Ambil data QRIS terbaru dari database
$qrisQuery = mysqli_query($conn, "SELECT * FROM qris ORDER BY id_qris ASC LIMIT 1");
$row = mysqli_fetch_assoc($qrisQuery);

?>

<!DOCTYPE html>
<html lang="id">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Dashboard - UMKM Galeri 3D</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css">
<style>
body {
    background: #f3f4f6;
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
}
.container {
    max-width: 1200px;
    margin: 5px auto;
    padding: 0 30px;
}
</style>
</head>
<body>
<div class="container">
    <h2 style="width: 100%; border-bottom: 2px solid #000; margin-top: 20px; padding-bottom: 10px;"><i class="fas fa-qrcode"></i> <b>QRIS Pembayaran</b></h2>
    <p>Silakan scan QRIS untuk menyelesaikan pembayaran.</p>
    <div style="text-align: center; margin-top: 20px; margin-bottom: 30px;">
        <img src="image/qris/<?= $row['image']; ?>" 
            alt="QRIS" width="350">
    </div>
    <div style="text-align: center; margin-top: 20px;">
        <button type="submit" class="btn btn-success" style="margin-right: 10px;">
            Konfirmasi
        </button>
        <a href="checkout.php?kode_cs=<?= $kd; ?>" class="btn btn-danger">
            Cancel
        </a>
    </div>
</div>
</body>
</html>