@extends('layouts.main_dashboard.app') @section('title', __('dashboard.Activity Statistics')) @section('page_heading', __('dashboard.Activity Statistics')) @section('page_subtitle', __('dashboard.Activity statistics subtitle')) @section('skip_page_hero', true) @section('content') @php $statisticsItems = collect($statistics); $totalTimeSpent = $statisticsItems->sum('total_time'); $selectedTeacherName = optional($teachers->firstWhere('id', (int) ($filters['teacher'] ?? null)))->name; $periodLabels = [ 'week' => __('dashboard.Last Week'), 'month' => __('dashboard.Last Month'), 'custom' => __('dashboard.Custom Period'), ]; @endphp

{{ __('dashboard.Activity Statistics') }}

{{ __('dashboard.Activity statistics subtitle') }}

{{ __('dashboard.Tracked Events') }}

{{ number_format($statisticsItems->count()) }}

{{ __('dashboard.Tracked Time') }}

{{ number_format($totalTimeSpent) }}

{{ __('dashboard.Total Time Spent (Seconds)') }}

{{ __('dashboard.Selected Teacher') }}

{{ $selectedTeacherName ?: '—' }}

{{ __('dashboard.Report Period') }}

{{ $periodLabels[$period] ?? __('dashboard.Last Week') }}

{{ __('dashboard.Reset') }}

{{ __('dashboard.Statistics Results') }}

{{ __('dashboard.Results') }}: {{ number_format($statisticsItems->count()) }}

@if($statisticsItems->isEmpty())

{{ __('dashboard.No activity statistics found') }}

@else
@foreach($statisticsItems as $stat) @endforeach
{{ __('dashboard.Event') }} {{ __('dashboard.Total Time Spent (Seconds)') }}
{{ $stat->event ?: __('dashboard.Unknown events') }} {{ number_format($stat->total_time) }}
{{ __('dashboard.Total Time for All Events') }} {{ number_format($totalTimeSpent) }}

{{ __('dashboard.Activity Statistics') }}

@foreach($statisticsItems as $stat) @php $percentage = $totalTimeSpent > 0 ? min(100, round(($stat->total_time / $totalTimeSpent) * 100, 1)) : 0; @endphp
{{ $stat->event ?: __('dashboard.Unknown events') }} {{ number_format($stat->total_time) }}
@endforeach
@endif
@endsection