<?php
include 'config/database.php';
include 'includes/functions.php';

$ucapan = getUcapan($conn);
?>

<section id="rsvp">
    <h2>Ucapan & Doa</h2>

    <form action="process/rsvp.php" method="POST">
        <input type="text" name="nama" placeholder="Nama" required>
        <textarea name="ucapan" placeholder="Ucapan"></textarea>
        <button type="submit">Kirim</button>
    </form>

    <div style="margin-top:20px;">
        <?php while($row = mysqli_fetch_assoc($ucapan)): ?>
        <div style="background:#1a1a1a; padding:10px; margin-bottom:10px; border-radius:5px;">
            <strong><?= $row['nama'] ?></strong>
            <p><?= $row['ucapan'] ?></p>
        </div>
        <?php endwhile; ?>
    </div>
</section>