<?php

namespace App\Controllers\Admin;

use App\Controllers\BaseController;
use App\Models\ActivityLogModel;

class LogController extends BaseController
{
    public function index()
    {
        $filters = [
            'type'      => $this->request->getGet('type'),
            'date_from' => $this->request->getGet('date_from'),
            'date_to'   => $this->request->getGet('date_to'),
        ];

        $logs = model(ActivityLogModel::class)->getRecentLogs(100, $filters);

        return view('admin/logs/index', [
            'title'   => 'Log Aktivitas',
            'logs'    => $logs,
            'filters' => $filters,
        ]);
    }
}
