<?php

declare(strict_types=1);

require_once __DIR__ . '/../includes/bootstrap.php';
require_once __DIR__ . '/../includes/helpers.php';
require_once __DIR__ . '/../includes/i18n.php';
require_once __DIR__ . '/../includes/auth.php';
require_once __DIR__ . '/../includes/mvc.php';

init_i18n();

use App\Controllers\PublicContractController;

$signToken = trim((string)($_GET['sign_token'] ?? ''));

$controller = new PublicContractController();

if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    $controller->submitSign($signToken);
    exit;
}

$controller->showBySignToken($signToken);
