@section('title', 'Panel - Stats') @php while ($stats == null) { echo "Waiting for stats..."; } $options = []; $payments = $stats["global"]["payment_gateway"]; $hasStripe = false; foreach ($payments as $key => $payment) { if (str_contains($key, "stripe") && $hasStripe == false) { $hasStripe = true; array_push($options, "All Stripe"); } array_push($options, $key); } @endphp @section('content')

Stats

Countries stats

{{-- Global stats - Money --}}

Global - Money

{{ $stats['global']['moneyInvoiced'] }} USD @if ($stats['global']['moneyRefunded'] > 0) - {{ $stats['global']['moneyRefunded'] }} USD @endif

@if ($stats['global']['moneyRefunded'] > 0)

Total @if($stats['global']['profit'] <= 0) {{$stats['global']['profit']}} USD @else {{$stats['global']['profit']}} USD @endif

@endif
@if ($from->isToday() && $to->isToday())

$stats['global']['today']['difference'] > 0, 'text-red-500' => $stats['global']['today']['difference'] < 0, 'text-neutral-400' => $stats['global']['today']['difference'] === 0, ])>{{ $stats['global']['today']['difference'] }}% compared to yesterday at this time

@endif

{{ $stats['global']['paid'] }} payments @if ($stats['global']['refunded'] > 0) {{ $stats['global']['refunded'] }} refunds @endif

@if ($from->isToday() && $to->isToday())

{{ $stats['global']['yesterday']['paid'] }} payments yesterday at this time. {{ $stats['global']['yesterday']['moneyInvoiced'] }} USD

@endif
Global
{{-- Global stats - Payment Gateway --}}

Global - Payment Gateway

@foreach ($stats['global']['payment_gateway'] as $payment_gateway => $value) @if ($gateway == 'all stripe' && str_contains($payment_gateway, 'stripe'))

{{ $value }} {{ $payment_gateway }}

@elseif ($gateway == null || $gateway == 'all' || $gateway == $payment_gateway)

{{ $value }} {{ $payment_gateway }}

@endif @endforeach
Global
{{-- Stats - Country --}} @foreach ($stats['countries'] as $iso => $value) @endforeach
@endsection @push('scripts') @endpush