@extends('backoffice.layouts.app') @section('content')
{{-- HEADER --}}
{{-- glow background --}}
Dashboard Live
Overview dashboard realtime
{{-- right stats --}}
Total User
{{ number_format($totalUser ?? 0) }}
Profit
Rp {{ number_format($profit ?? 0) }}
{{-- KPI + MINI SPARKLINES --}}
@php $kpis = [ [ 'id' => 'sparkUsers', 'label' => 'Total User', 'value' => number_format($totalUser), 'icon' => 'tabler-users', 'color' => '#60a5fa', ], [ 'id' => 'sparkDeposit', 'label' => 'Total Deposit', 'value' => 'Rp ' . number_format($totalDeposit), 'icon' => 'tabler-wallet', 'color' => '#22c55e', ], [ 'id' => 'sparkWithdraw', 'label' => 'Total Withdraw', 'value' => 'Rp ' . number_format($totalWithdraw), 'icon' => 'tabler-arrow-down', 'color' => '#f43f5e', ], [ 'id' => 'sparkProfit', 'label' => 'Net Profit', 'value' => 'Rp ' . number_format($profit), 'icon' => 'tabler-chart-line', 'color' => '#f59e0b', ], ]; @endphp @foreach ($kpis as $kpi)
{{ $kpi['label'] }}
{{ $kpi['value'] }}
@endforeach
{{-- RINGKASAN OPERASIONAL --}}
{{-- background glow --}}
Pending Ratio
Deposit vs withdraw overview
Live Status
{{-- radial chart --}}
{{-- stats --}}
Pending Deposit
{{ number_format($pendingDeposit ?? 0) }}
Pending Withdraw
{{ number_format($pendingWithdraw ?? 0) }}
@php $pendingDepositValue = (int) ($pendingDeposit ?? 0); $pendingWithdrawValue = (int) ($pendingWithdraw ?? 0); $pendingTotal = $pendingDepositValue + $pendingWithdrawValue; $depositPercent = $pendingTotal > 0 ? round(($pendingDepositValue / $pendingTotal) * 100) : 0; $withdrawPercent = $pendingTotal > 0 ? round(($pendingWithdrawValue / $pendingTotal) * 100) : 0; @endphp {{-- progress section --}}
{{-- deposit --}}
Deposit Queue {{ $depositPercent }}%
{{-- withdraw --}}
Withdraw Queue {{ $withdrawPercent }}%
{{-- TOP USER (MODERN) --}}
{{-- background glow --}}
Top Deposit User
Leaderboard transaksi deposit
Top Rank
@php // ambil maksimal 4 user $topUsers = array_slice($topUsers ?? [], 0, 4); $maxTop = collect($topUsers) ->map(function ($u) { return (float) preg_replace('/[^0-9.]/', '', (string) ($u['total'] ?? 0)); }) ->max() ?? 0; @endphp {{-- top users --}}
@forelse($topUsers as $i => $user) @php $username = (string) ($user['username'] ?? '-'); $initial = strtoupper(substr($username, 0, 1)); $totalRaw = (float) preg_replace('/[^0-9.]/', '', (string) ($user['total'] ?? 0)); $pct = $maxTop > 0 ? max(10, min(100, round(($totalRaw / $maxTop) * 100))) : 10; $rank = $i + 1; $rankBg = match ($rank) { 1 => 'rgba(250,204,21,.16)', 2 => 'rgba(148,163,184,.16)', 3 => 'rgba(251,146,60,.16)', default => 'rgba(99,102,241,.16)', }; $rankColor = match ($rank) { 1 => '#fde047', 2 => '#cbd5e1', 3 => '#fdba74', default => '#a5b4fc', }; @endphp
{{-- rank --}} #{{ $rank }} {{-- avatar --}} {{ $initial }} {{-- username --}}
{{ $username }} Deposit Member
{{-- amount --}}
{{ $user['total'] }}
Volume
{{-- progress --}}
@empty
No Leaderboard Data
Data deposit belum tersedia
@endforelse
{{-- PERFORMANCE SNAPSHOT --}}
{{-- background glow --}}
Performance Snapshot
Live analytic overview
+18.4%
{{-- radar chart --}}
@php /* |-------------------------------------------------------------------------- | REAL PERFORMANCE CALCULATION |-------------------------------------------------------------------------- */ $totalUserCount = (int) ($totalUser ?? 0); $depositAmount = (float) ($totalDeposit ?? 0); $withdrawAmount = (float) ($totalWithdraw ?? 0); $profitAmount = (float) ($profit ?? 0); /* |-------------------------------------------------------------------------- | TRANSACTION ARRAY SAFE |-------------------------------------------------------------------------- */ $trxData = is_array($transactions ?? null) ? $transactions : []; /* |-------------------------------------------------------------------------- | ACTIVE USER |-------------------------------------------------------------------------- */ $uniqueUsers = collect($trxData)->pluck('username')->unique()->count(); $activeUser = min($totalUserCount, $uniqueUsers); /* |-------------------------------------------------------------------------- | SUCCESS RATE |-------------------------------------------------------------------------- */ $totalTransaction = count($trxData); $successTransaction = collect($trxData)->where('status', 'Delivered')->count(); $successRate = $totalTransaction > 0 ? round(($successTransaction / $totalTransaction) * 100, 1) : 0; /* |-------------------------------------------------------------------------- | GROWTH RATE |-------------------------------------------------------------------------- */ $growthRate = $withdrawAmount > 0 ? round(($profitAmount / $withdrawAmount) * 100, 1) : 0; @endphp {{-- quick stats --}}
{{-- ACTIVE --}}
Active
{{ number_format($activeUser) }}
{{-- SUCCESS --}}
Success
{{ $successRate }}%
{{-- GROWTH --}}
Growth
{{ $growthRate >= 0 ? '+' : '' }}{{ $growthRate }}%
{{-- mini progress --}}
Server Performance 82%
{{-- TABLE TRANSAKSI --}}
User Transaction
Realtime transaction activity
Live
@forelse($transactions as $i => $trx) @empty @endforelse
# User Amount Type Status Action
{{ $i + 1 }} {{ $trx['username'] }} {{ $trx['amount'] }} {{ $trx['type'] }} {{ $trx['status'] }}
Tidak ada data
@endsection @push('scripts') @endpush