<?php
require_once __DIR__ . '/../../../Models/Contract.php';

class ContractController {
    public function index() {
        $contractModel = new Contract();
        
        $page = isset($_GET['p']) ? (int)$_GET['p'] : 1;
        $perPage = 10;
        
        $result = $contractModel->paginateWithDetails($page, $perPage);
        $contracts = $result['data'];
        
        $total = $result['total'];
        $totalPages = ceil($total / $perPage);

        require __DIR__ . '/../../../../views/admin/contracts/index.php';
    }
}
