<div class="container py-5">
    <nav aria-label="breadcrumb">
        <ol class="breadcrumb">
            <li class="breadcrumb-item active" aria-current="page">Lista de Tipos de Transportes</li>
        </ol>
    </nav>

    <?php Sessao::mensagem('tipo_transporte'); ?>

    <a href="<?= URL ?>/tipos_transportes/cadastrar" class="btn btn-primary mb-3">Cadastrar Novo Tipo de Transporte</a>

    <div class="table-responsive">
        <table class="table table-bordered table-hover">
            <thead>
                <tr>
                    <th>#</th>
                    <th>Descrição</th>
                    <th>Opções</th>
                </tr>
            </thead>
            <tbody>
                <?php foreach ($dados['tipos_transportes'] as $tp): ?>
                    <tr>
                        <td><?= $tp->id_transporte ?></td>
                        <td><?= htmlspecialchars($tp->descricao) ?></td>
                        <td>
                            <a href="<?= URL ?>/tipos_transportes/visualizar/<?= $tp->id_transporte ?>" class="btn btn-info btn-sm">Ver</a>
                            <a href="<?= URL ?>/tipos_transportes/editar/<?= $tp->id_transporte ?>" class="btn btn-warning btn-sm">Editar</a>
                            <a href="<?= URL ?>/tipos_transportes/excluir/<?= $tp->id_transporte ?>" class="btn btn-danger btn-sm" onclick="return confirm('Tem certeza?')">Excluir</a>
                        </td>
                    </tr>
                <?php endforeach; ?>
                <?php if (empty($dados['tipos_transportes'])): ?>
                    <tr>
                        <td colspan="3" class="text-center">Nenhum tipo de transporte cadastrado.</td>
                    </tr>
                <?php endif; ?>
            </tbody>
        </table>
    </div>
</div>
