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

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

    <div class="table-wrap">
        <table>
            <thead>
                <tr>
                    <th>Curso</th>
                    <th>Referencia</th>
                    <th>Valor</th>
                    <th>Estado</th>
                    <th>Actualizado</th>
                    <th>Accoes</th>
                </tr>
            </thead>
            <tbody>
                <?php if (!$payments): ?>
                    <tr><td colspan="6">Ainda nao existem pagamentos.</td></tr>
                <?php endif; ?>
                <?php foreach ($payments as $payment): ?>
                    <tr>
                        <td><strong><?= e($payment['course_title']) ?></strong><span class="muted"><?= e($payment['order_number']) ?></span></td>
                        <td><?= e($payment['reference']) ?></td>
                        <td><?= e(money_mzn($payment['amount'])) ?></td>
                        <td><span class="badge <?= e($payment['status']) ?>"><?= e(payment_status_label($payment['status'])) ?></span></td>
                        <td><?= e(format_date($payment['updated_at'] ?? '')) ?></td>
                        <td><a class="mini-button" href="/payments/show?id=<?= e((string) $payment['id']) ?>">Ver</a></td>
                    </tr>
                <?php endforeach; ?>
            </tbody>
        </table>
    </div>
</section>

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