@extends('layouts.app') @section('title', _lang('System Dashboard')) @push('styles') @endpush @section('content')
{{-- Hero --}}

{{ _lang('System Dashboard') }}

{{ _lang('Platform overview — all tenant organizations & accounts.') }}

{{ auth()->user()?->name }} {{ _lang('New Organization') }}
@include('partials.alerts') {{-- ===== Stats ===== --}}
{{ _lang('Overview') }}
@php $statCards = [ [_lang('Total Organizations'), $stats['organizations'], 'bi-building', 'g-indigo', $stats['new_month'].' '._lang('new this month')], [_lang('Active'), $stats['active'], 'bi-check-circle', 'g-green', null], [_lang('Suspended'), $stats['suspended'], 'bi-pause-circle', 'g-red', null], [_lang('Tenant Users'), $stats['users'], 'bi-people', 'g-cyan', $stats['staff'].' '._lang('staff')], ['৳ '._lang('Outstanding'), ($billing['outstanding'] ?? 0)/100, 'bi-receipt', 'g-amber', null], ['৳ '._lang('Collected (mo)'), ($billing['collected_month'] ?? 0)/100, 'bi-cash-stack', 'g-green', null], [_lang('Restricted'), $billing['restricted'] ?? 0, 'bi-lock', 'g-red', null], ]; @endphp
@foreach ($statCards as [$label, $value, $icon, $grad, $sub])
{{ $label }}
{{ number_format($value) }}
@if ($sub)
{{ $sub }}
@endif
@endforeach
{{-- ===== Quick actions ===== --}} @php $actions = array_values(array_filter([ ['organizations.index', _lang('Organizations'), 'bi-building', 'g-indigo'], ['organizations.create', _lang('Add Organization'), 'bi-plus-square','g-green'], \Route::has('admin.billing.dashboard') ? ['billing.dashboard', _lang('Billing'), 'bi-receipt', 'g-green'] : null, \Route::has('admin.marketplace.index') ? ['marketplace.index', _lang('Marketplace'), 'bi-shop', 'g-cyan'] : null, \Route::has('admin.notices.index') ? ['notices.index', _lang('Notices'), 'bi-megaphone', 'g-pink'] : null, \Route::has('admin.push.index') ? ['push.index', _lang('Push Notification'), 'bi-bell', 'g-amber'] : null, \Route::has('admin.ads.index') ? ['ads.index', _lang('Ad Banners'), 'bi-image', 'g-cyan'] : null, \Route::has('admin.subscriptions.index') ? ['subscriptions.index', _lang('Subscriptions'), 'bi-credit-card', 'g-pink'] : null, \Route::has('admin.users.index') ? ['users.index', _lang('Users'), 'bi-people', 'g-cyan'] : null, \Route::has('admin.settings.index') ? ['settings.index', _lang('Settings'), 'bi-gear', 'g-slate'] : null, \Route::has('admin.email.index') ? ['email.index', _lang('Email'), 'bi-envelope', 'g-cyan'] : null, \Route::has('admin.tools.index') ? ['tools.index', _lang('Tools'), 'bi-tools', 'g-indigo'] : null, \Route::has('admin.system.update') ? ['system.update', _lang('System Update'), 'bi-arrow-repeat', 'g-red'] : null, ])); @endphp
{{ _lang('Quick Actions') }}
@foreach ($actions as [$route, $label, $icon, $grad]) {{ $label }} @endforeach
{{-- ===== Now using ===== --}}
এখন ব্যবহার করছে
শেষ ৩০ মিনিটে সক্রিয় {{ _lang('Usage history') }}
@if ($nowUsing->isEmpty())
এই মুহূর্তে কেউ সক্রিয় নেই।
@else
@foreach ($nowUsing as $u) @endforeach
{{ _lang('User') }}{{ _lang('Organization') }}{{ _lang('Last active') }}
{{ $u->name }} {{ $u->organization }} {{ (int) $u->last_seen->diffInMinutes(now()) }} মিনিট আগে
@endif
{{-- ===== Recent organizations ===== --}}
{{ _lang('Recent Organizations') }}
{{ _lang('Recent Organizations') }} {{ _lang('View all') }}
@forelse ($recentOrganizations as $organization) @empty @endforelse
{{ _lang('Organization') }} {{ _lang('Email') }} {{ _lang('Status') }} {{ _lang('Created') }}
{{ strtoupper(substr($organization->name, 0, 1)) }} {{ $organization->name }}
{{ $organization->email ?? '—' }} @if ($organization->status) {{ _lang('Active') }} @else {{ _lang('Suspended') }} @endif {{ $organization->created_at?->format('d M Y') }}
{{ _lang('No organizations yet.') }}
@endsection