<?php

namespace App\Controllers;

use App\Models\DokumenModel;
use App\Models\PegawaiModel;

class Home extends BaseController
{
    public function index()
    {
        // Memanggil model database
        $dokumenModel = new DokumenModel();
        $pegawaiModel = new PegawaiModel();

        // Menghitung total baris data di database
        $data = [
            'title'         => 'Dashboard Utama - KPH III Asahan',
            'total_dokumen' => $dokumenModel->countAll(),
            'total_pegawai' => $pegawaiModel->countAll(),
        ];
        
        // Membawa data angka tersebut ke halaman tampilan dashboard
        return view('dashboard', $data);
    }
}