<?php if (!defined('DASHBOARD_ROOT')) { http_response_code(403); exit; } ?> <div class="mny-panel"> <div class="mny-panel-hdr"> <span class="mny-panel-title">E-Transfer Inbox</span> <span class="mny-badge warn"><?= count(array_filter($etransfers, fn($e) => ($e['status'] ?? '') === 'pending')) ?> NEED ACTION</span> </div> <table class="data-table"> <thead> <tr> <th>Received</th><th>Sender</th><th>Email</th><th>Amount</th><th>Note</th><th>Status</th><th>Actions</th> </tr> </thead> <tbody><?php foreach ($etransfers as $et): $st = $et['status'] ?? 'pending'; $badgeClass = $st === 'verified' ? 'ok' : 'warn'; ?> <tr> <td><?= $et['created_at'] ? date('M j H:i', strtotime($et['created_at'])) : '&mdash;' ?></td> <td style="font-weight:700"><?= UI::e($et['sender_name'] ?? 'Unknown') ?></td> <td><?= UI::e($et['sender_email'] ?? '&mdash;') ?></td> <td style="font-weight:900;color:#fff">$<?= number_format((float)($et['amount'] ?? 0), 2) ?></td> <td><?= UI::e($et['reference_note'] ?? '&mdash;') ?></td> <td><span class="mny-badge <?= $badgeClass ?>"><?= strtoupper($st) ?></span></td> <td><?php if ($st === 'pending'): ?> <form method="POST" style="display:inline"><?= CSRF::field() ?> <input type="hidden" name="action" value="verify_etransfer"> <input type="hidden" name="et_id" value="<?= (int)($et['id'] ?? 0) ?>"> <button type="submit" class="btn btn-sm" style="font-size:9px">VERIFY</button> </form> <form method="POST" style="display:inline;margin-left:4px"><?= CSRF::field() ?> <input type="hidden" name="action" value="reject_etransfer"> <input type="hidden" name="et_id" value="<?= (int)($et['id'] ?? 0) ?>"> <button type="submit" class="btn btn-sm" style="font-size:9px;background:rgba(231,76,60,.1);color:#e74c3c">REJECT</button> </form><?php else: ?> <span style="font-size:9px;color:rgba(200,204,212,.3)"><?= $et['verified_by'] ? 'By admin #' . $et['verified_by'] : '&mdash;' ?></span><?php endif; ?> </td> </tr><?php endforeach; ?> <?php if (empty($etransfers)): ?> <tr><td colspan="7" class="mny-empty">No e-transfers in inbox</td></tr><?php endif; ?> </tbody> </table> </div>