@extends('admin.layout') @section('title', 'Platform Overview') @section('content')
Businesses (Active / Susp / Trial)
{{ $stats['total_businesses'] }} ({{ $stats['active_businesses'] }}/{{ $stats['suspended_businesses'] }}/{{ $stats['trial_businesses'] }})
Subscriptions (Active / Expired)
{{ $stats['active_subscriptions'] }} / {{ $stats['expired_subscriptions'] }}
Users / POS Devices (Active)
{{ $stats['total_users'] }} / {{ $stats['active_devices'] }}
Platform Subscription Revenue
UGX {{ number_format($stats['platform_sub_revenue']) }}
Merchant Sales (Period)
UGX {{ number_format($stats['merchant_sales_total']) }}
EFRIS (Confirmed / Errors)
{{ $stats['efris_confirmed'] }} / {{ $stats['efris_errors'] }}
Pending Sync Issues
{{ $stats['pending_sync_batches'] }}
System Health
Healthy

Monthly Business Registrations

@php $maxReg = max(1, max($regValues ?: [1])); @endphp
@foreach($regValues as $idx => $v)
{{ $v }}
{{ $chartLabels[$idx] }}
@endforeach

Monthly Subscription Revenue (UGX)

@php $maxRev = max(1, max($revValues ?: [1])); @endphp
@foreach($revValues as $idx => $v)
{{ $v > 0 ? number_format($v/1000) . 'k' : '0' }}
{{ $chartLabels[$idx] }}
@endforeach

Recent Business Registrations

@foreach($recentBusinesses as $b) @endforeach
BusinessPackageStatus
{{ $b->name }} {{ $b->package->name ?? '-' }} {{ $b->status }}

Recent Subscription Payments

@forelse($recentPayments as $p) @empty @endforelse
BusinessCycleAmount (UGX)Expires
{{ $p->business->name ?? '-' }} {{ strtoupper($p->billing_cycle) }} UGX {{ number_format((float)$p->amount_ugx) }} {{ $p->expires_at?->format('Y-m-d') ?? '-' }}
No subscription payments recorded yet.
@endsection