<?php
header('Content-Type: application/json');
require_once __DIR__ . '/../db.php';

$rows = $pdo->query("SELECT * FROM alerts ORDER BY id DESC LIMIT 50")->fetchAll();
echo json_encode(["ok"=>true, "alerts"=>$rows]);
