<?php include app()->basePath('app/Views/partials/header.php'); ?>

<section class="panel">
    <p class="eyebrow">Aluno</p>
    <h1>Meus recibos</h1>

    <div class="table-wrap">
        <table>
            <thead>
                <tr>
                    <th>Numero</th>
                    <th>Curso</th>
                    <th>Total</th>
                    <th>Emitido em</th>
                    <th>Accoes</th>
                </tr>
            </thead>
            <tbody>
                <?php if (!$invoices): ?>
                    <tr><td colspan="5">Ainda nao existem recibos.</td></tr>
                <?php endif; ?>
                <?php foreach ($invoices as $invoice): ?>
                    <tr>
                        <td><strong><?= e($invoice['invoice_number']) ?></strong></td>
                        <td><?= e($invoice['course_title']) ?></td>
                        <td><?= e(money_mzn($invoice['total'])) ?></td>
                        <td><?= e(format_date($invoice['issued_at'])) ?></td>
                        <td><a class="mini-button" href="/invoices/show?id=<?= e((string) $invoice['id']) ?>">Ver recibo</a></td>
                    </tr>
                <?php endforeach; ?>
            </tbody>
        </table>
    </div>
</section>

<?php include app()->basePath('app/Views/partials/footer.php'); ?>
