<?php  if (!defined('DASHBOARD_ROOT')) { http_response_code(403); exit; } $page=max(1,(int)($_GET["log_page"]??1));$limit=50;$offset=($page-1)*$limit; $logs=AuditLogger::query([],$limit,$offset); $total=AuditLogger::count(); $headers=["ID","Admin","Action","Target","IP","Time"]; $rows=[]; foreach($logs as $l){$rows[]=[$l["id"],$l["admin_id"]??"System",UI::e($l["action"]),UI::e(($l["target_type"]??"").":".($l["target_id"]??"")),UI::e($l["ip_address"]??""),$l["created_at"]];} echo "<div class=\"audit-viewer\"><h3>Audit Log</h3>".UI::table($headers,$rows,"tbl-audit").UI::pagination($page,ceil($total/$limit),"?view=security&log_page")."</div>"; 