@extends('admin.layout') @php $admin = Auth::guard('admin')->user(); if (!empty($admin->role)) { $permissions = $admin->role->permissions; $permissions = json_decode($permissions, true); } $tokenTooltipText = '' . __('AI Token Statistics') . ' (' . __('All Active Tenants') . ')

' . 'Scope: ' . __('Calculated by combining all ACTIVE tenant memberships only.') . '
' . 'Required AI Tokens: ' . __('Total allocated tokens for this AI engine across all active tenant plans.') . '
' . 'Used AI Tokens: ' . __('Total number of tokens already used by tenant users.') . '
' . 'Remaining AI Tokens: ' . __('Remaining available tokens for all tenants combined.') . '

' . '' . __('Important: Combined usage across all tenants, not individual limits.') . ''; $imageTooltipText = '' . __('AI Image Statistics') . ' (' . __('All Active Tenants') . ')

' . 'Scope: ' . __('Calculated by combining all ACTIVE tenant memberships only.') . '
' . 'Required AI Images: ' . __('Total image quota allocated for this AI engine across active tenants.') . '
' . 'Used AI Images: ' . __('Total number of AI-generated images already created.') . '
' . 'Remaining AI Images: ' . __('Remaining available images for all tenants combined.') . '

' . '' . __('Important: Combined usage across all tenants, not individual limits.') . ''; @endphp @section('content')

{{ __('Welcome back,') }} Ecom Builder Admin! 👋

{{ __('Here\'s what\'s happening with your platform today.') }}

Build Launch Grow
🚀
@if (empty($admin->role) || (!empty($permissions) && in_array('Users Management', $permissions)))
{{ __('Registered Users') }}
{{ App\Models\User::count() }}
12% from last month
@endif @if (empty($admin->role) || (!empty($permissions) && in_array('Package Management', $permissions)))
{{ __('Packages') }}
{{ App\Models\Package::count() }}
33% from last month
@endif @if (empty($admin->role) || (!empty($permissions) && in_array('Payment Log', $permissions)))
{{ __('Payment Logs') }}
{{ \Illuminate\Support\Facades\Schema::hasTable('memberships') ? App\Models\Membership::count() : 0 }}
18% from last month
@endif @if (empty($admin->role) || (!empty($permissions) && in_array('Admins Management', $permissions)))
{{ __('Registered Admins') }}
{{ App\Models\Admin::count() }}
0% from last month
@endif @if (empty($admin->role) || (!empty($permissions) && in_array('Pages', $permissions)))
{{ __('Blog') }}
{{ $defaultLang ? (\Illuminate\Support\Facades\Schema::hasTable('blogs') ? $defaultLang->blogs()->count() : 0) : 0 }}
25% from last month
@endif @if (empty($admin->role) || (!empty($permissions) && in_array('Users Management', $permissions)))
{{ __('Subscribers') }}
{{ App\Models\Subscriber::count() }}
50% from last month
@endif
@if (empty($admin->role) || (!empty($permissions) && in_array('Payment Log', $permissions)))
{{ __('Monthly Income') }} ({{ date('Y') }})
@endif @if (empty($admin->role) || (!empty($permissions) && in_array('Users Management', $permissions)))
{{ __('Monthly Premium Users') }} ({{ date('Y') }})
@endif
@if (!empty($aiEngineStats)) @foreach ($aiEngineStats as $key => $stat) @php $engineName = strtoupper($stat['engine']); $cardClass = str_contains($engineName, 'OPENAI') ? 'p-orange' : (str_contains($engineName, 'POLLINATIONS') ? 'p-cyan' : 'p-purple'); @endphp
{{ __('AI Engine') }} : {{ $engineName }}
Required AI Tokens : {{ $stat['token_required'] }}
Used AI Tokens : {{ $stat['token_used'] }}
Remaining AI Tokens : {{ $stat['token_remaining'] }}
0%
@endforeach @endif @if (!empty($aiEngineStats)) @foreach ($aiEngineStats as $key => $stat) @php $engineName = strtoupper($stat['engine']); $cardClass = str_contains($engineName, 'OPENAI') ? 'p-blue' : (str_contains($engineName, 'POLLINATIONS') ? 'p-red' : 'p-indigo'); @endphp
{{ __('AI Image Engine') }} : {{ $engineName }}
Required AI Images : {{ $stat['image_required'] }}
Used AI Images : {{ $stat['image_used'] }}
Remaining AI Images : {{ $stat['image_remaining'] }}
0%
@endforeach @endif
@endsection @php $months = []; $inTotals = []; $userTotals = []; for ($i = 1; $i <= 12; $i++) { $monthNum = $i; $dateObj = DateTime::createFromFormat('!m', $monthNum); $months[] = $dateObj->format('M'); $inFound = 0; foreach ($incomes as $key => $income) { if ($income->month == $i) { $inTotals[] = (float)$income->total; $inFound = 1; break; } } if ($inFound == 0) { $inTotals[] = 0; } $userFound = 0; foreach ($users as $key => $user) { if ($user->month == $i) { $userTotals[] = (int)$user->total; $userFound = 1; break; } } if ($userFound == 0) { $userTotals[] = 0; } } @endphp @section('scripts') @endsection