@extends('layouts.app') @section('title', __(auth()->user()->isEmployee() ? 'Operations overview' : 'Admin overview')) @section('content') @php $isAdmin = auth()->user()->isAdmin(); $mobileShortcuts = [ ['label' => __($isAdmin ? 'Accounts' : 'My team'), 'route' => $isAdmin ? 'admin.members.index' : 'team', 'icon' => 'users', 'tone' => 'text-sky-600', 'tile' => 'bg-sky-50'], ['label' => __('Network'), 'route' => 'admin.network.index', 'icon' => 'tree', 'tone' => 'text-emerald-600', 'tile' => 'bg-emerald-50'], ['label' => __('Sales'), 'route' => 'admin.sales.index', 'icon' => 'receipt', 'tone' => 'text-amber-600', 'tile' => 'bg-amber-50'], ['label' => __('Global leaderboard'), 'route' => 'leaderboard', 'icon' => 'chart', 'tone' => 'text-cyan-600', 'tile' => 'bg-cyan-50'], ['label' => __('Payments'), 'route' => 'admin.payments.index', 'icon' => 'wallet', 'tone' => 'text-purple-600', 'tile' => 'bg-purple-50'], ['label' => __('Withdrawals'), 'route' => 'admin.withdrawals.index', 'icon' => 'transfer', 'tone' => 'text-rose-600', 'tile' => 'bg-rose-50'], ['label' => __('Wallet'), 'route' => 'wallet', 'icon' => 'wallet', 'tone' => 'text-teal-600', 'tile' => 'bg-teal-50'], ]; $mobileFeatures = [ ['label' => __($isAdmin ? 'Accounts' : 'My team'), 'route' => $isAdmin ? 'admin.members.index' : 'team', 'icon' => 'users', 'tone' => 'text-emerald-600'], ['label' => __('Network'), 'route' => 'admin.network.index', 'icon' => 'tree', 'tone' => 'text-teal-600'], ['label' => __('Sales'), 'route' => 'admin.sales.index', 'icon' => 'receipt', 'tone' => 'text-amber-600'], ['label' => __('Global leaderboard'), 'route' => 'leaderboard', 'icon' => 'chart', 'tone' => 'text-cyan-600'], ['label' => __('Payment reviews'), 'route' => 'admin.payments.index', 'icon' => 'wallet', 'tone' => 'text-blue-600'], ['label' => __('Withdrawal requests'), 'route' => 'admin.withdrawals.index', 'icon' => 'transfer', 'tone' => 'text-cyan-600'], ['label' => __('Wallet'), 'route' => 'wallet', 'icon' => 'wallet', 'tone' => 'text-purple-600'], ]; if (! $isAdmin) { $mobileShortcuts = array_values(array_filter($mobileShortcuts, fn ($item) => $item['route'] !== 'admin.network.index')); $mobileFeatures = array_values(array_filter($mobileFeatures, fn ($item) => $item['route'] !== 'admin.network.index')); } if (! $isAdmin) { $mobileShortcuts = array_merge($mobileShortcuts, [ ['label' => __('Leads'), 'route' => 'leads.index', 'icon' => 'user', 'tone' => 'text-green-600', 'tile' => 'bg-green-50'], ['label' => __('Sales targets'), 'route' => 'targets.index', 'icon' => 'chart', 'tone' => 'text-violet-600', 'tile' => 'bg-violet-50'], ['label' => __('Incentives'), 'route' => 'incentives.index', 'icon' => 'sparkles', 'tone' => 'text-pink-600', 'tile' => 'bg-pink-50'], ['label' => __('Salary and payroll'), 'route' => 'salary.index', 'icon' => 'transfer', 'tone' => 'text-red-600', 'tile' => 'bg-red-50'], ['label' => __('Transfers'), 'route' => 'transfers.index', 'icon' => 'transfer', 'tone' => 'text-orange-600', 'tile' => 'bg-orange-50'], ['label' => __('Support'), 'route' => 'support.index', 'icon' => 'user', 'tone' => 'text-yellow-600', 'tile' => 'bg-yellow-50'], ['label' => __('Learning room'), 'route' => 'learning.index', 'icon' => 'sparkles', 'tone' => 'text-stone-600', 'tile' => 'bg-stone-50'], ['label' => __('Rank guide'), 'route' => 'ranks', 'icon' => 'sparkles', 'tone' => 'text-violet-600', 'tile' => 'bg-violet-50'], ]); $mobileFeatures = array_merge($mobileFeatures, [ ['label' => __('Leads'), 'route' => 'leads.index', 'icon' => 'user', 'tone' => 'text-green-600'], ['label' => __('Sales targets'), 'route' => 'targets.index', 'icon' => 'chart', 'tone' => 'text-violet-600'], ['label' => __('Incentives'), 'route' => 'incentives.index', 'icon' => 'sparkles', 'tone' => 'text-pink-600'], ['label' => __('Salary and payroll'), 'route' => 'salary.index', 'icon' => 'transfer', 'tone' => 'text-red-600'], ['label' => __('Transfers'), 'route' => 'transfers.index', 'icon' => 'transfer', 'tone' => 'text-orange-600'], ['label' => __('Support'), 'route' => 'support.index', 'icon' => 'user', 'tone' => 'text-yellow-600'], ['label' => __('Learning room'), 'route' => 'learning.index', 'icon' => 'sparkles', 'tone' => 'text-stone-600'], ['label' => __('Rank guide'), 'route' => 'ranks', 'icon' => 'sparkles', 'tone' => 'text-violet-600'], ]); } if ($isAdmin) { $mobileShortcuts = array_merge($mobileShortcuts, [ ['label' => __('Departments'), 'route' => 'admin.departments.index', 'icon' => 'users', 'tone' => 'text-blue-600', 'tile' => 'bg-blue-50'], ['label' => __('Ranks'), 'route' => 'admin.ranks.index', 'icon' => 'sparkles', 'tone' => 'text-indigo-600', 'tile' => 'bg-indigo-50'], ['label' => __('Rank guide'), 'route' => 'ranks', 'icon' => 'sparkles', 'tone' => 'text-violet-600', 'tile' => 'bg-violet-50'], ['label' => __('Bonuses'), 'route' => 'admin.bonuses.index', 'icon' => 'chart', 'tone' => 'text-orange-600', 'tile' => 'bg-orange-50'], ['label' => __('Leads'), 'route' => 'leads.index', 'icon' => 'user', 'tone' => 'text-green-600', 'tile' => 'bg-green-50'], ['label' => __('Sales targets'), 'route' => 'targets.index', 'icon' => 'chart', 'tone' => 'text-violet-600', 'tile' => 'bg-violet-50'], ['label' => __('Incentives'), 'route' => 'admin.incentives.index', 'icon' => 'sparkles', 'tone' => 'text-pink-600', 'tile' => 'bg-pink-50'], ['label' => __('Accounting ledger'), 'route' => 'admin.finance.index', 'icon' => 'wallet', 'tone' => 'text-lime-600', 'tile' => 'bg-lime-50'], ['label' => __('Salary and payroll'), 'route' => 'salary.index', 'icon' => 'transfer', 'tone' => 'text-red-600', 'tile' => 'bg-red-50'], ['label' => __('Transfers'), 'route' => 'transfers.index', 'icon' => 'transfer', 'tone' => 'text-orange-600', 'tile' => 'bg-orange-50'], ['label' => __('Learning room'), 'route' => 'admin.learning.index', 'icon' => 'sparkles', 'tone' => 'text-stone-600', 'tile' => 'bg-stone-50'], ['label' => __('Support'), 'route' => 'support.index', 'icon' => 'user', 'tone' => 'text-yellow-600', 'tile' => 'bg-yellow-50'], ['label' => __('System settings'), 'route' => 'admin.settings.index', 'icon' => 'sparkles', 'tone' => 'text-slate-600', 'tile' => 'bg-slate-100'], ['label' => __('System activity'), 'route' => 'admin.activity.index', 'icon' => 'receipt', 'tone' => 'text-slate-600', 'tile' => 'bg-slate-100'], ['label' => __('Reports'), 'route' => 'admin.reports', 'icon' => 'chart', 'tone' => 'text-cyan-600', 'tile' => 'bg-cyan-50'], ['label' => __('Create account'), 'route' => 'admin.members.create', 'icon' => 'user', 'tone' => 'text-fuchsia-600', 'tile' => 'bg-fuchsia-50'], ]); $mobileFeatures = array_merge($mobileFeatures, [ ['label' => __('Departments'), 'route' => 'admin.departments.index', 'icon' => 'users', 'tone' => 'text-blue-600'], ['label' => __('Ranks'), 'route' => 'admin.ranks.index', 'icon' => 'sparkles', 'tone' => 'text-indigo-600'], ['label' => __('Rank guide'), 'route' => 'ranks', 'icon' => 'sparkles', 'tone' => 'text-violet-600'], ['label' => __('Bonuses'), 'route' => 'admin.bonuses.index', 'icon' => 'chart', 'tone' => 'text-orange-600'], ['label' => __('Leads'), 'route' => 'leads.index', 'icon' => 'user', 'tone' => 'text-green-600'], ['label' => __('Sales targets'), 'route' => 'targets.index', 'icon' => 'chart', 'tone' => 'text-violet-600'], ['label' => __('Incentives'), 'route' => 'admin.incentives.index', 'icon' => 'sparkles', 'tone' => 'text-pink-600'], ['label' => __('Accounting ledger'), 'route' => 'admin.finance.index', 'icon' => 'wallet', 'tone' => 'text-lime-600'], ['label' => __('Salary and payroll'), 'route' => 'salary.index', 'icon' => 'transfer', 'tone' => 'text-red-600'], ['label' => __('Transfers'), 'route' => 'transfers.index', 'icon' => 'transfer', 'tone' => 'text-orange-600'], ['label' => __('Learning room'), 'route' => 'admin.learning.index', 'icon' => 'sparkles', 'tone' => 'text-stone-600'], ['label' => __('Support'), 'route' => 'support.index', 'icon' => 'user', 'tone' => 'text-yellow-600'], ['label' => __('System settings'), 'route' => 'admin.settings.index', 'icon' => 'sparkles', 'tone' => 'text-slate-600'], ['label' => __('System activity'), 'route' => 'admin.activity.index', 'icon' => 'receipt', 'tone' => 'text-slate-600'], ['label' => __('Network reports'), 'route' => 'admin.reports', 'icon' => 'chart', 'tone' => 'text-cyan-600'], ['label' => __('Create account'), 'route' => 'admin.members.create', 'icon' => 'user', 'tone' => 'text-fuchsia-600'], ]); } $routeFeatures = [ 'admin.departments.index' => 'departments', 'targets.index' => 'targets', 'leads.index' => 'leads', 'admin.incentives.index' => 'incentives', 'admin.finance.index' => 'finance', 'salary.index' => 'salary', 'admin.learning.index' => 'learning', 'learning.index' => 'learning', 'support.index' => 'support', ]; $mobileShortcuts = array_values(array_filter($mobileShortcuts, fn ($item) => ! isset($routeFeatures[$item['route']]) || $featureFlags->get('feature_'.$routeFeatures[$item['route']]) !== '0')); $mobileFeatures = array_values(array_filter($mobileFeatures, fn ($item) => ! isset($routeFeatures[$item['route']]) || $featureFlags->get('feature_'.$routeFeatures[$item['route']]) !== '0')); @endphp
{{ strtoupper(substr(auth()->user()->name, 0, 1)) }}
@if(! $isAdmin)

{{ __('Name') }}: {{ auth()->user()->name }}

{{ __('Employee ID') }}: {{ auth()->user()->member_id }}

@else

{{ auth()->user()->name }}

{{ auth()->user()->member_id ?: auth()->user()->email }}

{{ __('Administrator') }}

@endif
@if($isAdmin) ! auth()->user()->is_active])>{{ auth()->user()->is_active ? __('Active') : __('Inactive') }}@endif
@foreach($mobileShortcuts as $shortcut) {{ $shortcut['label'] }} @endforeach

{{ __('Explore more features') }}

@foreach($mobileFeatures as $feature) {{ $feature['label'] }} @endforeach
@if($isAdmin)

{{ __('Total accounts') }}

{{ number_format($stats['members']) }}

{{ __('Active accounts') }}

{{ number_format($stats['active']) }}

{{ __('Employees') }}

{{ number_format($stats['employees']) }}

{{ __('Departments') }}

{{ number_format($stats['departments']) }}

{{ __('Total sales') }}

৳{{ number_format($stats['sales'], 2) }}

{{ __('Pending sales') }}

{{ number_format($pendingSales) }}

{{ __('Commissions') }}

৳{{ number_format($stats['commissions'], 2) }}

{{ __('Payment reviews') }} · {{ __('Withdrawal requests') }}

{{ number_format($pendingPayments) }} · {{ number_format($pendingWithdrawals) }}

@else @php($targetProgress = $employeeStats['target'] > 0 ? min(100, $employeeStats['monthly_sales'] / $employeeStats['target'] * 100) : 0)

{{ __('My performance') }}

{{ __('A quick look at your personal progress.') }}

{{ __('My leads') }}

{{ number_format($employeeStats['leads']) }}

{{ __('My total sales') }}

৳{{ number_format($employeeStats['sales'], 2) }}

{{ __('This month sales') }}

৳{{ number_format($employeeStats['monthly_sales'], 2) }}

{{ __('My total earnings') }}

৳{{ number_format($employeeStats['earnings'], 2) }}

{{ __('This month earnings') }}

৳{{ number_format($employeeStats['monthly_earnings'], 2) }}

{{ __('My performance rank') }}

#{{ number_format($employeeStats['rank']) }} / {{ number_format($employeeStats['employees']) }}

{{ __('My monthly target') }}

৳{{ number_format($employeeStats['target'], 2) }}

{{ $employeeStats['target'] > 0 ? number_format($targetProgress, 1).'%' : __('Not set') }}

৳{{ number_format($employeeStats['monthly_sales'], 2) }} / ৳{{ number_format($employeeStats['target'], 2) }}

@endif @if($isAdmin)

{{ __('Needs your attention') }}

{{ __('Review pending activity from one place.') }}

@endif @if($isAdmin)

{{ __('Recently joined') }}

{{ __('Latest member and employee accounts') }}

{{ __('All accounts') }} →
@forelse($latestMembers as $member)
{{ strtoupper(substr($member->name, 0, 1)) }}

{{ $member->name }}

{{ $member->member_id ?: '—' }}

{{ __($member->isEmployee() ? 'Employee' : 'Team Leader') }}
@empty

{{ __('No accounts have been created yet.') }}

@endforelse
@endif
@endsection