<?php require __DIR__ . '/../layouts/header.php'; ?>

<div class="d-flex justify-content-between align-items-center mb-4">
    <h1 class="fw-bold mb-0"><?= e(trans('edit_submission')) ?></h1>
    <a href="<?= e(base_path('submissions/show?id=' . (int) $submission['id'])) ?>" class="btn btn-outline-secondary rounded-3"><?= e(trans('back')) ?></a>
</div>

<div class="card border-0 shadow-sm rounded-4 mb-4">
    <div class="card-body">
        <div><strong><?= e(trans('submission_no')) ?>:</strong> <?= e((string) $submission['submission_no']) ?></div>
        <div><strong><?= e(trans('current_version')) ?>:</strong> <?= e((string) $submission['current_version']) ?></div>
    </div>
</div>

<div class="card border-0 shadow-sm rounded-4">
    <div class="card-body p-4">
        <form method="post" action="<?= e(base_path('submissions/edit?id=' . (int) $submission['id'])) ?>" enctype="multipart/form-data">
            <input type="hidden" name="_csrf" value="<?= e(csrf_token()) ?>">

            <?php require __DIR__ . '/form.php'; ?>

            <div class="mt-4 d-flex gap-2">
                <button type="submit" class="btn btn-success rounded-3"><?= e(trans('save')) ?></button>
                <a href="<?= e(base_path('submissions/show?id=' . (int) $submission['id'])) ?>" class="btn btn-outline-secondary rounded-3"><?= e(trans('cancel')) ?></a>
            </div>
        </form>
    </div>
</div>

<?php require __DIR__ . '/../layouts/footer.php'; ?>
