<?php if (!defined('DASHBOARD_ROOT')) { http_response_code(403); exit; } ?> <div class="mny-grid"> <div class="mny-card green"> <span class="mny-icon">&#128176;</span> <span class="mny-val">$<?= number_format((float)($totals['etransfer_today'] ?? 0), 0) ?></span> <span class="mny-lbl">E-Transfers Today</span> <span class="mny-sub"><?= (int)($totals['etransfer_count_today'] ?? 0) ?> verified</span> </div> <div class="mny-card blue"> <span class="mny-icon">&#8383;</span> <span class="mny-val">$<?= number_format((float)($totals['crypto_cad_total'] ?? 0), 0) ?></span> <span class="mny-lbl">Crypto Holdings (CAD)</span> <span class="mny-sub"><?= count($wallets) ?> wallets tracked</span> </div> <div class="mny-card amber"> <span class="mny-icon">&#9201;</span> <span class="mny-val">$<?= number_format((float)($totals['pending_total'] ?? 0), 0) ?></span> <span class="mny-lbl">Pending Verification</span> <span class="mny-sub"><?= count(array_filter($etransfers, fn($e) => ($e['status'] ?? '') === 'pending')) ?> e-transfers waiting</span> </div> <div class="mny-card purple"> <span class="mny-icon">&#128200;</span> <span class="mny-val">$<?= number_format((float)($totals['lifetime_processed'] ?? 0), 0) ?></span> <span class="mny-lbl">Lifetime Processed</span> <span class="mny-sub">All payment methods combined</span> </div> </div> <?php if ($engineHealth['reachable']): ?> <div class="mny-status"> <div class="mny-status-dot<?= ($engineHealth['engine']['running'] ?? false) ? ' ok' : ' err' ?>"></div> <span class="mny-status-txt">Engine: <?= ($engineHealth['engine']['running'] ?? false) ? 'Running' : 'Offline' ?></span> <span style="margin-left:auto;font-size:9px;color:rgba(200,204,212,.3)"><?= ($engineHealth['payment']['latency_ms'] ?? 0) > 0 ? 'Latency: ' . (int)$engineHealth['payment']['latency_ms'] . 'ms' : '' ?></span> </div> <?php endif; ?> <div class="mny-pipe"> <div class="mny-panel"> <div class="mny-panel-hdr"> <span class="mny-panel-title">Pending E-Transfers</span> <span class="mny-badge warn"><?= count(array_filter($etransfers, fn($e) => ($e['status'] ?? '') === 'pending')) ?> PENDING</span> </div><?php foreach (array_slice($etransfers, 0, 6) as $et): ?> <div class="mny-row"> <div class="mny-row-dot <?= $et['status'] ?? 'pending' ?>"></div> <span class="mny-row-txt"><?= UI::e($et['sender_name'] ?? 'Unknown') ?> &mdash; <?= UI::e($et['reference_note'] ?? '') ?></span> <span class="mny-row-amt">$<?= number_format((float)($et['amount'] ?? 0), 2) ?></span> <span class="mny-row-time"><?= $et['created_at'] ? date('H:i', strtotime($et['created_at'])) : '&mdash;' ?></span> </div><?php endforeach; ?> <?php if (empty($etransfers)): ?> <div class="mny-empty">No pending e-transfers</div><?php endif; ?> </div> <div class="mny-panel"> <div class="mny-panel-hdr"> <span class="mny-panel-title">Recent Ledger</span> <span class="mny-badge info">LIVE</span> </div><?php foreach (array_slice($ledger, 0, 6) as $tx): ?> <div class="mny-row"> <div class="mny-row-dot <?= ($tx['direction'] ?? '') === 'incoming' ? 'verified' : 'pending' ?>"></div> <span class="mny-row-txt"><?= UI::e($tx['description'] ?? 'Transaction') ?></span> <span class="mny-row-amt">$<?= number_format((float)($tx['amount_cad'] ?? 0), 2) ?></span> <span class="mny-row-time"><?= $tx['created_at'] ? date('H:i', strtotime($tx['created_at'])) : '&mdash;' ?></span> </div><?php endforeach; ?> <?php if (empty($ledger)): ?> <div class="mny-empty">Ledger empty</div><?php endif; ?> </div> </div>