@extends('layouts.superadmin') @section('title', 'إصلاح أخطاء التقييمات - نزاهة') @section('page-title', 'إصلاح أخطاء التقييمات - نزاهة') @section('content') @php $attendanceLabel = fn($v) => match($v){ 'present' => 'حاضر', 'absent_with_excuse' => 'غائب بعذر', 'absent_without_excuse' => 'غائب بدون عذر', default => 'غير محدد', }; $isCards = (request('view','cards') === 'cards'); // Helpers: safe defaults for view variables $from = $from ?? request('from'); $to = $to ?? request('to'); $q = $q ?? request('q'); $type = $type ?? request('type','all'); $status = $status ?? request('status','all'); $role = $role ?? request('role','all'); $userId = $userId ?? request('user_id'); $evaluatorId = $evaluatorId ?? request('evaluator_id'); $perPage = $perPage ?? (int)request('per_page', 15); @endphp
{{-- Header --}}

إصلاح أخطاء التقييمات

صفحة إصلاح التناقضات الحساسة. تتطلب كلمة مرور داخلية لتنفيذ الإصلاح وإرسال إشعارات رسمية للعضو والإدارة (والمُقيِّم أيضًا).

{{-- Toggle --}}
{{-- Flash Messages --}} @if(session('success'))
{{ session('success') }}
@endif @if(session('warning'))
{{ session('warning') }}
@endif @if(session('error'))
{{ session('error') }}
@endif {{-- Filters --}}
إعادة ضبط ملاحظة: الإصلاح يرسل إشعار للعضو + إشعار للسوبر أدمن + إشعار للمُقيِّم.
{{-- Cards --}} @if($isCards)
@forelse($rows as $e) @php $reasons = (array)($e->anomaly_reasons ?? []); $dateYmd = \Carbon\Carbon::parse($e->evaluation_date)->toDateString(); @endphp
{{ $e->user->name ?? ('#'.$e->user_id) }}
المقيم: {{ $e->evaluator->name ?? ('#'.$e->evaluator_id) }} • {{ $dateYmd }}
النقاط
{{ (int)$e->total_daily_points }}
الحضور: {{ $attendanceLabel($e->attendance_status) }}
@foreach($reasons as $r) {{ $r }} @endforeach
واتساب
{{ (int)$e->whatsapp_presence }}
تيكتوك
{{ (int)$e->tiktok_interaction }}
المعرّف
#{{ $e->id }}
{{-- Fix Form --}}
@csrf

هذا الإجراء مخصص للسوبر أدمن فقط.

فتح التقييم
@empty
لا يوجد أخطاء ضمن الفلاتر الحالية.
@endforelse
{{ $rows->links() }}
{{-- Table --}} @else
@forelse($rows as $e) @php $reasons = (array)($e->anomaly_reasons ?? []); $dateYmd = \Carbon\Carbon::parse($e->evaluation_date)->toDateString(); @endphp @empty @endforelse
التاريخ العضو المقيم الحضور النقاط الأسباب إصلاح
{{ $dateYmd }} {{ $e->user->name ?? ('#'.$e->user_id) }} {{ $e->evaluator->name ?? ('#'.$e->evaluator_id) }} {{ $attendanceLabel($e->attendance_status) }} {{ (int)$e->total_daily_points }}
@foreach($reasons as $r) {{ $r }} @endforeach
@csrf

للسوبر أدمن فقط.

فتح التقييم
لا يوجد أخطاء.
{{ $rows->links() }}
@endif
عند تنفيذ الإصلاح، سيتم إرسال إشعار رسمي: "تم إصلاح تقييمك" مع التفاصيل، وإشعار للسوبر أدمنز + للمُقيِّم كذلك.
@endsection