$e['time'] >= ($now - $ms_30d)); $errors_30d = array_filter($errors, fn($e) => $e['time'] >= ($now - $ms_30d)); // Logins par jour (30 derniers jours) $by_day = []; for ($i = 29; $i >= 0; $i--) { $d = date('d/m', strtotime("-$i days")); $by_day[$d] = 0; } foreach ($logins_30d as $e) { $d = date('d/m', (int)($e['time'] / 1000)); if (isset($by_day[$d])) $by_day[$d]++; } // Logins par heure (0-23) $by_hour = array_fill(0, 24, 0); foreach ($logins as $e) { $h = (int)date('G', (int)($e['time'] / 1000)); $by_hour[$h]++; } // Logins par jour de semaine (lundi = 0) $days_fr = ['Lun','Mar','Mer','Jeu','Ven','Sam','Dim']; $by_dow = array_fill(0, 7, 0); foreach ($logins as $e) { $by_dow[((int)date('w', (int)($e['time'] / 1000)) + 6) % 7]++; } // IPs uniques $ips = array_count_values(array_column($logins, 'ipAddress')); arsort($ips); // Dernière connexion $last_login = $logins ? max(array_column($logins, 'time')) : null; $title = 'Historique des connexions'; require __DIR__ . '/views/layout.php'; ?>
Aucune donnée.
| Date | Heure | Adresse IP |
|---|---|---|
| = date('d/m/Y', $ts) ?> | = date('H:i:s', $ts) ?> | = htmlspecialchars($e['ipAddress'] ?? '—') ?> |
Aucune connexion enregistrée.
| Date | Heure | IP |
|---|---|---|
| = date('d/m/Y', $ts) ?> | = date('H:i:s', $ts) ?> | = htmlspecialchars($e['ipAddress'] ?? '—') ?> |