<?php
session_start();
require_once 'config.php';
require_once 'functions.php';
requireLogin();
$user = getConnectedUser($pdo);
requireAdmin($user);
$id = (int)($_GET['id'] ?? 0);
if ($id) {
    $pdo->prepare("DELETE FROM chat_reports WHERE message_id=?")->execute([$id]);
    $pdo->prepare("DELETE FROM messages WHERE id=?")->execute([$id]);
}
echo "ok";
?>
