<?php if (!defined('DASHBOARD_ROOT')) { http_response_code(403); exit; } ?> <div class="glass" style="margin-bottom:20px"> <h3 style="font-size:14px;font-weight:900;color:#fff;margin-bottom:14px">Watchdog Events</h3> <div style="overflow-x:auto"> <table class="data-table"> <thead> <tr><th>Time</th><th>Severity</th><th>Node</th><th>Layer</th><th>Description</th><th>Confidence</th></tr> </thead> <tbody><?php if (empty($events)): ?> <tr><td colspan="6" style="text-align:center;padding:20px;color:var(--text-dim)">No watchdog events.</td></tr><?php else: foreach ($events as $ev): ?> <tr> <td style="font-size:11px;white-space:nowrap;color:var(--text-dim)"><?= UI::e($ev['created_at'] ?? '') ?></td> <td><span class="badge badge-<?= in_array($ev['severity'] ?? '', ['high','critical']) ? 'danger' : (($ev['severity'] ?? '') === 'medium' ? 'warning' : 'info') ?>"><?= UI::e(strtoupper($ev['severity'] ?? '')) ?></span></td> <td style="font-weight:700"><?= UI::e($ev['node_name'] ?? $ev['node_id'] ?? '') ?></td> <td><?= UI::e($ev['event_type'] ?? $ev['layer'] ?? '') ?></td> <td style="max-width:300px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap"><?= UI::e($ev['details'] ?? $ev['description'] ?? '') ?></td> <td><?= UI::e($ev['severity'] ?? $ev['confidence'] ?? '') ?></td> </tr><?php endforeach; endif; ?> </tbody> </table> </div> </div> <div class="glass" style="margin-bottom:20px"> <h3 style="font-size:14px;font-weight:900;color:#fff;margin-bottom:14px">Session IP Migrations</h3> <table class="data-table"> <thead><tr><th>Time</th><th>Session</th><th>Old IP</th><th>New IP</th><th>Distance</th></tr></thead> <tbody><?php if (empty($ipChanges)): ?> <tr><td colspan="5" style="text-align:center;padding:20px;color:var(--text-dim)">No session IP changes detected.</td></tr><?php else: foreach ($ipChanges as $ch): ?> <tr> <td style="font-size:11px;color:var(--text-dim)"><?= UI::e($ch['created_at'] ?? '') ?></td> <td style="font-family:var(--font-mono);font-size:10px"><?= UI::e(substr($ch['session_hash'] ?? '', 0, 12) . '...') ?></td> <td style="font-family:var(--font-mono);font-size:11px"><?= UI::e($ch['old_ip'] ?? '') ?></td> <td style="font-family:var(--font-mono);font-size:11px"><?= UI::e($ch['new_ip'] ?? '') ?></td> <td><?= UI::e(($ch['distance_km'] ?? '') . ' km') ?></td> </tr><?php endforeach; endif; ?> </tbody> </table> </div><?php if (!empty($suspiciousPayments)): ?> <div class="glass"> <h3 style="font-size:14px;font-weight:900;color:#fff;margin-bottom:14px">Suspicious Payment Signals</h3> <table class="data-table"> <thead><tr><th>Time</th><th>Order</th><th>Method</th><th>Amount</th><th>Status</th><th>Customer</th></tr></thead> <tbody><?php foreach ($suspiciousPayments as $sp): ?> <tr> <td style="font-size:11px;color:var(--text-dim)"><?= UI::e($sp['created_at'] ?? '') ?></td> <td style="font-weight:700"><?= UI::e($sp['order_ref'] ?? '') ?></td> <td><?= UI::e(strtoupper($sp['method'] ?? '')) ?></td> <td>$<?= number_format((float)($sp['amount_cad'] ?? 0), 2) ?></td> <td><span class="badge badge-danger"><?= UI::e(strtoupper($sp['status'] ?? '')) ?></span></td> <td><?= UI::e($sp['shipping_name'] ?? '') ?></td> </tr><?php endforeach; ?> </tbody> </table> </div><?php endif; ?>