<?php

declare(strict_types=1);

require_once __DIR__ . '/../includes/auth.php';
require_once __DIR__ . '/../includes/mvc.php';

use App\Controllers\ContractController;

$contractId = (int)($_GET['id'] ?? 0);

if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
    header('Location: ' . (function_exists('app_path') ? app_path('/admin/contracts/' . max(1, $contractId)) : '/admin/contracts/' . max(1, $contractId)), true, 302);
    exit;
}

$controller = new ContractController();
$controller->send($contractId);
