@extends('layouts.app')
@section('title', _lang('System Dashboard'))
@push('styles')
@endpush
@section('content')
{{-- Hero --}}
{{ _lang('System Dashboard') }}
{{ _lang('Platform overview — all tenant organizations & accounts.') }}
@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 ===== --}}
এখন ব্যবহার করছে
@if ($nowUsing->isEmpty())
এই মুহূর্তে কেউ সক্রিয় নেই।
@else
| {{ _lang('User') }} | {{ _lang('Organization') }} | {{ _lang('Last active') }} |
@foreach ($nowUsing as $u)
| {{ $u->name }} |
{{ $u->organization }} |
{{ (int) $u->last_seen->diffInMinutes(now()) }} মিনিট আগে |
@endforeach
@endif
{{-- ===== Recent organizations ===== --}}
{{ _lang('Recent Organizations') }}
| {{ _lang('Organization') }} |
{{ _lang('Email') }} |
{{ _lang('Status') }} |
{{ _lang('Created') }} |
@forelse ($recentOrganizations as $organization)
|
|
{{ $organization->email ?? '—' }} |
@if ($organization->status)
{{ _lang('Active') }}
@else
{{ _lang('Suspended') }}
@endif
|
{{ $organization->created_at?->format('d M Y') }} |
@empty
| {{ _lang('No organizations yet.') }} |
@endforelse
@endsection