<?php
require_once __DIR__ . '/admin-server/config/database.php';
$pdo = getDBConnection();
try {
    echo "--- TODOS OS EVENTOS (ÚLTIMOS 15) ---\n";
    $stmt = $pdo->query("SELECT id, site_id, event_type, placa, ip_address, created_at FROM events ORDER BY id DESC LIMIT 15");
    while ($event = $stmt->fetch(PDO::FETCH_ASSOC)) {
        echo "ID: {$event['id']} | Site: {$event['site_id']} | Tipo: {$event['event_type']} | Placa: [{$event['placa']}] | IP: {$event['ip_address']} | Data: {$event['created_at']}\n";
    }
} catch (Exception $e) {
    echo "ERRO: " . $e->getMessage() . "\n";
}
