<?php

namespace App\Controllers\Admin;

class Dashboard extends AdminBaseController
{
    public function index()
    {
        if (!$this->checkAuth()) return redirect()->to('/admin/login');

        $enquiryModel = new \App\Models\EnquiryModel();
        $productModel = new \App\Models\ProductModel();
        $galleryModel = new \App\Models\GalleryModel();

        $data = [
            'title' => 'Dashboard',
            'total_enquiries' => $enquiryModel->countAllResults(),
            'total_products' => $productModel->countAllResults(),
            'total_gallery' => $galleryModel->countAllResults(),
        ];

        return view('admin/dashboard', $data);
    }
}
