<?php if (!defined('DASHBOARD_ROOT')) { http_response_code(403); exit; } ?> <div class="mny-panel"> <div class="mny-panel-hdr"> <span class="mny-panel-title">Payment Ledger</span> <span class="mny-badge info">FULL AUDIT TRAIL</span> </div> <table class="data-table"> <thead> <tr> <th>Time</th><th>Type</th><th>Description</th><th>Method</th><th>Amount</th><th>Status</th> </tr> </thead> <tbody><?php foreach ($ledger as $tx): $txStatus = $tx['status'] ?? 'pending'; $badgeClass = $txStatus === 'confirmed' || $txStatus === 'completed' ? 'ok' : ($txStatus === 'failed' ? 'warn' : 'info'); ?> <tr> <td><?= $tx['created_at'] ? date('M j H:i', strtotime($tx['created_at'])) : '&mdash;' ?></td> <td><span class="mny-badge <?= $badgeClass ?>"><?= UI::e(strtoupper($tx['type'] ?? 'TX')) ?></span></td> <td><?= UI::e($tx['description'] ?? '&mdash;') ?></td> <td><?= UI::e(strtoupper($tx['method'] ?? '&mdash;')) ?></td> <td style="font-weight:900;color:#fff">$<?= number_format((float)($tx['amount_cad'] ?? 0), 2) ?></td> <td><?= UI::e(strtoupper($txStatus)) ?></td> </tr><?php endforeach; ?> <?php if (empty($ledger)): ?> <tr><td colspan="6" class="mny-empty">Ledger empty</td></tr><?php endif; ?> </tbody> </table> </div>