<?php
declare(strict_types=1);
require_once __DIR__ . '/../../app/Models/GeneralLedger.php';
require_once __DIR__ . '/../../app/Config/functions.php';

class GeneralLedgerController {
    public function index(): void {
        require_login();
        $model = new GeneralLedger();
        $start = $_GET['start'] ?? null;
        $end   = $_GET['end'] ?? null;
        $acc   = $_GET['account'] ?? null;
        $rows  = $model->getAll($start, $end, $acc);
        $accounts = $model->getAccounts();
        include __DIR__ . '/../../app/Views/ledger/index.php';
    }
}
