<?php
include '../includes/auth.php';
include '../includes/functions.php';

header('Content-Type: application/json');


$eventId = (int)$_GET['id_event'];
$query = $conn->query("SELECT * FROM dafdir_event_undangan WHERE id_event = $eventId ORDER BY created_at DESC");

$undangan = [];
while ($row = $query->fetch_assoc()) {
    $undangan[] = $row;
}

echo json_encode($undangan);



?>

