<?php
namespace App\Controllers\Admin;
use App\Controllers\BaseController;
class Dashboard extends BaseController {
    public function index() {
        $db = db_connect();
        return view('admin/dashboard', $this->data + ['title'=>'Dashboard','stats'=>[
            'tamu'=>$db->table('tamu')->countAllResults(),
            'hadir'=>$db->table('rsvp')->where('status','hadir')->countAllResults(),
            'tidak_hadir'=>$db->table('rsvp')->where('status','tidak_hadir')->countAllResults(),
            'ucapan'=>$db->table('ucapan')->countAllResults(),
            'pengunjung'=>$db->table('pengunjung')->countAllResults(),
        ]]);
    }
}
