@extends('layouts.superadmin') @section('title','AI — تحليل التقييمات') @section('content')
{{-- Hero --}}
AI — تحليل التقييمات
تجميع المقيمين • مؤشر عضو • تناقضات • تقييمات عضو
{{-- Tabs --}}
@php $tabs = [ 'evaluators' => ['t'=>'تجميع المقيمين','i'=>'fa-users-gear','c'=>'fuchsia'], 'user_indicator' => ['t'=>'مؤشر عضو','i'=>'fa-gauge-high','c'=>'cyan'], 'integrity' => ['t'=>'تناقضات','i'=>'fa-triangle-exclamation','c'=>'rose'], 'user_evaluations'=> ['t'=>'تقييمات عضو','i'=>'fa-clipboard-list','c'=>'amber'], ]; @endphp @foreach($tabs as $k=>$v) @php $active = ($behavior === $k); @endphp {{ $v['t'] }} @endforeach
{{-- Filters --}}
@if($behavior === 'evaluators')
ملاحظة: هنا الاختيار يفلتر على “المُقيّم evaluator”.
@endif
{{-- Summary --}}
الفترة
{{ $summary['from'] ?? $from }} → {{ $summary['to'] ?? $to }}
{{ $periodDays }} يوم
السلوك
{{ $behavior }}
mode: {{ $mode }}
عضو محدد
@if($selectedUser) {{ $selectedUser->name }} @else جميع الأعضاء @endif
{{ $selectedUser?('@'.$selectedUser->username):'—' }}
إحصائيات
{{ $withStats ? 'مفعّلة' : 'غير مفعّلة' }}
{{ $statsKind }}
{{-- Extra stats box --}} @if($withStats && !empty($stats))
إحصائيات إضافية
{{ json_encode($stats, JSON_UNESCAPED_UNICODE|JSON_PRETTY_PRINT) }}
@endif {{-- Content --}} @if($behavior === 'evaluators')
تجميع المقيمين
الإجمالي: {{ $summary['evaluations_total'] ?? 0 }} | المقيمين: {{ $summary['evaluators_count'] ?? 0 }}
@if($view === 'cards')
@foreach($rows as $r)
{{ $r->name }}
{{ $r->membership_status }}
{{ '@'.$r->username }}
تقييمات: {{ $r->evaluations_count }}
متوسط: {{ round($r->avg_points,2) }}
اعتراضات: {{ $r->objections_total }}
غياب بدون عذر: {{ $r->absent_without_excuse_days }}
@endforeach
{{ $rows->links() }}
@else
@foreach($rows as $r) @endforeach
المُقيّم تقييمات متوسط اعتراضات غياب بدون عذر أكشن
{{ $r->name }}
{{ '@'.$r->username }}
{{ $r->evaluations_count }} {{ round($r->avg_points,2) }} {{ $r->objections_total }} {{ $r->absent_without_excuse_days }} مؤشر
{{ $rows->links() }}
@endif
@endif @if($behavior === 'user_indicator')
مؤشر التقييمات
@if($selectedUser) {{ $selectedUser->name }} @endif • mode: {{ $mode }}
عرض التناقضات لنفس العضو
@if(!$indicator)
لا توجد تقييمات كافية لهذه الفترة.
@else {{-- Gauge --}}
النتيجة
{{ $indicator['percent'] }}/100
{{ $indicator['label'] }}
تفكيك المؤشر
@foreach($indicator['components'] as $c) @php $max = max(1, (float)$c['max']); $val = (float)$c['value']; $pct = min(100, max(0, ($val / $max) * 100)); $isPenalty = ($c['type'] ?? '') === 'penalty'; @endphp
{{ $c['label'] }}
{{ $c['value'] }} / {{ $c['max'] }}
@endforeach
متوسط النقاط: {{ $indicator['raw']['avg_points'] }}
تقييمات: {{ $indicator['raw']['total_evaluations'] }}
تحذيرات: {{ $indicator['raw']['warnings_total'] }}
@endif
@endif @if($behavior === 'integrity')
تناقضات التقييمات
الإجمالي: {{ $summary['total'] ?? 0 }}
@if(!$integrityRows || $integrityRows->isEmpty())
ما في تناقضات ضمن الفترة الحالية ✅
@else
@foreach($integrityRows as $ev) @endforeach
التاريخ العضو المقيم الحالة نقاط أسباب
{{ \Carbon\Carbon::parse($ev->evaluation_date)->toDateString() }}
{{ $ev->user->name ?? ('#'.$ev->user_id) }}
{{ $ev->user->username ? '@'.$ev->user->username : '' }}
{{ $ev->evaluator->name ?? ('#'.$ev->evaluator_id) }}
{{ $ev->evaluator->username ? '@'.$ev->evaluator->username : '' }}
{{ $ev->attendance_status }} @if($ev->anomaly_severity === 'high') HIGH @elseif($ev->anomaly_severity === 'mid') MID @else LOW @endif {{ $ev->total_daily_points }}
@foreach(($ev->anomaly_reasons ?? []) as $r)
• {{ $r }}
@endforeach
{{ $integrityRows->links() }}
@endif
@endif @if($behavior === 'user_evaluations')
تقييمات العضو
@if($selectedUser) {{ $selectedUser->name }} @endif
@if(!$selectedUser)
لا يوجد أعضاء.
@else
تقييمات: {{ $userStats['total_evaluations'] ?? 0 }}
نقاط: {{ $userStats['total_points'] ?? 0 }}
حضور: {{ $userStats['present_days'] ?? 0 }}
غياب بلا عذر: {{ $userStats['unexcused_absences'] ?? 0 }}
تحذيرات: {{ $userStats['total_warnings'] ?? 0 }}
@if(!$userEvaluations || $userEvaluations->isEmpty())
لا يوجد تقييمات ضمن الفترة.
@else
@foreach($userEvaluations as $ev) @endforeach
التاريخ المقيم الحالة واتساب تيكتوك نقاط تحذيرات
{{ \Carbon\Carbon::parse($ev->evaluation_date)->toDateString() }} {{ $ev->evaluator->name ?? ('#'.$ev->evaluator_id) }} {{ $ev->attendance_status }} {{ (int)($ev->whatsapp_presence ?? 0) }} {{ (int)($ev->tiktok_interaction ?? 0) }} {{ (int)($ev->total_daily_points ?? 0) }} {{ (int)($ev->warnings_count ?? 0) }}
{{ $userEvaluations->links() }}
@endif @endif
@endif
@endsection