<?php 
include 'header.php';
include '../koneksi/koneksi.php';
?>

<!DOCTYPE html>
<html lang="id">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>QRIS - UMKM Galeri 3D</title>
<style>
body {
    background: #f3f4f6;
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
}
.container {
  	max-width: 1200px;
    margin: 5px auto;
    padding: 0 30px;
}
.btn-success {
    margin-top: 15px;
    padding: 10px 18px;
    font-weight: 600;
}
</style>
</head>
<body>

<div class="container">
    <h2 style="width:100%; border-bottom:3px solid gray; font-size:30px; margin-bottom: 20px; padding-bottom: 10px;">
        <i class="fas fa-qrcode"></i> <b>QRIS Pembayaran</b>
    </h2>

    <table class="table table-striped">
        <thead>
            <tr>
                <th>No</th>
                <th>QRIS</th>
                <th>Tanggal</th>
                <th>Action</th>
            </tr>
        </thead>
        <tbody>
            <?php 
            $result = mysqli_query($conn, "SELECT * FROM qris ");
            $no = 1;
            while ($row = mysqli_fetch_assoc($result)) {
            ?>
                <tr>
                    <td><?= $no; ?></td>
                    <td>
                        <img src="../image/qris/<?= $row['image']; ?>" width="100" alt="QRIS">
                    </td>
                    <td><?= date('d-m-Y H:i', strtotime($row['tanggal'])); ?></td>
                    <td>
                        <a href="proses/del_qris.php?id_qris=<?= $row['id_qris']; ?>" class="btn btn-danger btn-sm" onclick="return confirm('Yakin ingin menghapus QRIS ini?')" title="Hapus">
                            <i class="glyphicon glyphicon-trash"></i>
                        </a>
                    </td>
                </tr> 
            <?php
            $no++; 
            }
            ?>
        </tbody>
    </table>
    <a href="tm_qris.php" class="btn btn-success">
        <i class="glyphicon glyphicon-plus-sign"></i> Tambah Qris
    </a>
</div>

</body>
</html>