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

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

$id_event = (int)$_GET['id_event'] ?? 0;

$query = "SELECT COUNT(*) as total FROM dafdir_event_foto WHERE id_event = ?";
$stmt = $conn->prepare($query);
$stmt->bind_param("i", $id_event);
$stmt->execute();
$result = $stmt->get_result();

echo json_encode($result->fetch_assoc());
?>