2026-04-14 18:42:34 +05:30

29 lines
769 B
PHP

<?php
namespace App\Controllers;
use App\Models\ActivityLogModel;
class ActivityLog extends BaseController
{
public function index()
{
if ($r = $this->requireRole('admin')) {
return $r;
}
$logModel = new ActivityLogModel();
$filters = [
'action' => trim((string) $this->request->getGet('action')),
'role' => trim((string) $this->request->getGet('role')),
'date_from' => trim((string) $this->request->getGet('date_from')),
'date_to' => trim((string) $this->request->getGet('date_to')),
];
return view('admin/activity_log', [
'logs' => $logModel->getFiltered($filters),
'filters' => $filters,
]);
}
}