/** * Admin Panel - Dashboard Logic */ async function loadDashboardStats() { try { const res = await fetch('/api/admin/stats'); const stats = await res.json(); document.getElementById('stat-pending-payments').innerText = stats.pending_payments; document.getElementById('stat-total-wallet').innerText = `₹${stats.total_wallet_balance}`; document.getElementById('stat-open-tickets').innerText = stats.open_tickets; document.getElementById('stat-active-users').innerText = stats.active_users; } catch (e) { console.error("Error loading dashboard stats:", e); } } function refreshDashboard() { loadDashboardStats(); if(typeof showToast === 'function') { showToast('success', 'Dashboard Refreshed', 'All data has been updated successfully'); } }