<?= $this->extend('layout/layout') ?>

<?= $this->section('content') ?>
<div class="container mt-5">
    <h4 class="title is-4">Adicionar Tipo</h4>
    <form action="/tipos/store" method="post">
        <div class="field">
            <label class="label" for="ano_id">Ano:</label>
            <div class="control">
                <div class="select is-fullwidth">
                    <select name="ano_id" required>
                        <option value="" disabled selected>Selecione o Ano</option>
                        <?php foreach ($anos as $ano): ?>
                            <option value="<?= $ano['id'] ?>"><?= $ano['ano'] ?></option>
                        <?php endforeach; ?>
                    </select>
                </div>
            </div>
        </div>

        <div class="field">
            <label class="label" for="nome">Nome do Tipo:</label>
            <div class="control">
                <input type="text" name="nome" class="input" required>
            </div>
        </div>

        <div class="field">
            <div class="control">
                <button type="submit" class="button is-primary">Salvar</button>
            </div>
        </div>
    </form>
</div>
<?= $this->endSection() ?>
