{{-- ===================================================== Etebarit - by Gisoo Web Solutions ------------------------------------------------------ Gisoo.net ------------------------------------------------------ Copyright (c) 2026 Gisoo Web Solutions ===================================================== This code is protected by copyright ===================================================== File: index.blade.php ------------------------------------------------------ Use: The admin reports page: finance / users / shops analytics over a selectable window, with KPIs, a twelve-month chart, a detail table and an Excel export. ===================================================== --}} @extends('layouts.admin') @section('title', __('admin.reports.title')) @php use App\Support\Format; // Columns rendered as money vs as a plain integer; anything else is text. $moneyCols = ['fees', 'allocated', 'repaid', 'overdue', 'sales', 'fee', 'share']; $countCols = ['new', 'merchants', 'cumulative', 'orders']; @endphp @section('breadcrumb') @endsection @section('page')

{{ __('admin.reports.title') }}

{{ __('admin.reports.subtitle') }}

{{ __('admin.reports.export') }}
{{ __('admin.reports.info') }} {{-- Tabs (report family), preserving the selected range --}}
@foreach (__('admin.reports.tabs') as $key => $label) $tab === $key, 'text-ink-muted hover:text-primary-600' => $tab !== $key, ])>{{ $label }} @endforeach
{{-- Range selector, preserving the selected tab --}}
@foreach (__('admin.reports.ranges') as $key => $label) $range === $key, 'border-[#e3e1ec] bg-white text-ink-muted hover:border-primary-300' => $range !== $key, ])>{{ $label }} @endforeach
{{-- KPI cards --}}
@foreach ($report['kpis'] as $kpi) @php $danger = ($kpi['tone'] ?? '') === 'danger'; @endphp
$danger, 'border-line bg-white' => ! $danger, ])>
{{ __("admin.reports.{$tab}.kpi_{$kpi['key']}") }}
@isset($kpi['amount']) $danger, 'text-ink' => ! $danger]) dir="ltr">@toman($kpi['amount']) {{ __('admin.reports.toman') }} @else @fa($kpi['count']) @endisset
@endforeach
{{-- Twelve-month chart --}} @php $isMoneyTrend = $tab !== 'users'; @endphp

{{ __('admin.reports.chart_title') }}

@foreach ($report['trend']['points'] as $point) @php $pct = $report['trend']['max'] > 0 ? max(2, (int) round($point['amount'] * 100 / $report['trend']['max'])) : 2; @endphp
{{ $point['label'] }}
@endforeach
{{-- Detail table --}}

{{ __('admin.reports.table_title') }}

@foreach ($report['columns'] as $col) @endforeach @forelse ($report['rows'] as $row) @foreach ($report['columns'] as $col) @endforeach @empty @endforelse
{{ __("admin.reports.{$tab}.col_{$col}") }}
in_array($col, ['month', 'name'], true), 'font-bold text-secondary-600' => $col === 'overdue', ]) @if (in_array($col, $moneyCols, true) || in_array($col, $countCols, true)) dir="ltr" @endif> @if (in_array($col, $moneyCols, true)) @toman((int) $row[$col]) @elseif (in_array($col, $countCols, true)) @fa($row[$col]) @else {{ $row[$col] }} @endif
{{ __('admin.reports.empty') }}
@endsection