<section class="content-header">
    <h1><?= __('Payment confirmations') ?></h1>

    <div class="actions">
        <a data-ajax class="btn btn-default btn-sm" href="<?= admin_url_to('/orders') ?>"><?= __('Orders') ?></a>
    </div>
</section>

<section class="content">
    <?php if (empty($confirmations)): ?>
        <div class="callout callout-warning">
            <h4>Ops!</h4>
            <p><?= __('No payments confirmation found') ?></p>
        </div>
    <?php else: ?>

        <div class="box box-default table-responsive">
            <table data-table class="table table-condensed table-hover table-striped">
                <thead>
                    <tr>
                        <th width="40">#</th>
                        <th><?= __('User') ?></th>
                        <th><?= __('Value') ?></th>
                        <th><?= __('Bank account') ?></th>
                        <th><?= __('Created at') ?></th>
                        <th><?= __('Receipt') ?></th>
                        <th><?= __('Status') ?></th>
                        <th width="10"></th>
                    </tr>
                </thead>

                <tbody>
                    <?php foreach ($confirmations as $confirmation): ?>
                        <tr>
                            <td><?= $confirmation['id'] ?></td>
                            <td><a data-ajax href="<?= admin_url_to('/accounts/edit/' . $confirmation['account']) ?>"><?= $confirmation['account'] ?></a></td>
                            <td><?= util('Number')->currency($confirmation['value']) ?></td>
                            <td><?= $confirmation['bank_account'] ?></td>
                            <td><?= util('Date')->date($confirmation['create_date']) ?></td>
                            <td><a target="_blank" href="<?= upload_to('/payments/' . $confirmation['images']) ?>"><?= $confirmation['images'] ?></a></td>
                            <td><?= util('Donate.PaymentConfirmation')->paymentStatus($confirmation['status']) ?></td>
                            <td class="record-actions">
                                <a data-ajax class="btn btn-default btn-xs" href="<?= admin_url_to('/orders/payment-confirmations/view/' . $confirmation['id']) ?>"><?= __('View') ?></a>
                            </td>
                        </tr>
                    <?php endforeach ?>
                </tbody>
            </table>
        </div>
    <?php endif ?>
</section>