@extends('layouts.superadmin') @section('title', 'منظومة العلامات - تفصيل العلامات') @section('page-title', 'منظومة العلامات - تفصيل علامات الأعضاء (Breakdown)') @section('content')
{{-- الهيدر --}}

تفصيل علامات الأعضاء

عرض مفصّل لصافي نقاط كل عضو مع توزيع النقاط حسب المصدر: تقييمات يومية، لايف، مخالفات، تكريم، مسابقات، وغيرها.

الفترة: من {{ $from }} إلى {{ $to }} (حسب recorded_date في score_records).

{{-- تبديل جدول / كروت --}}
@php $isCards = ($view ?? 'table') === 'cards'; @endphp جدول كروت
{{-- كروت ملخص --}}
عدد الأعضاء
{{ (int)($summary['count'] ?? 0) }}
إجمالي صافي النقاط
{{ (float)($summary['sum_net'] ?? 0) }}
إجمالي النقاط الإيجابية
{{ (float)($summary['sum_positive'] ?? 0) }}
إجمالي النقاط السلبية
{{ (float)($summary['sum_negative'] ?? 0) }}
{{-- الفلاتر --}}
إعادة ضبط يعتمد التفصيل على جدول score_records فقط.
@php $isCards = ($view ?? 'table') === 'cards'; @endphp {{-- وضع الكروت --}} @if($isCards)
@forelse($rows as $r) @php $uid = $r->id; $net = (float)($r->net_points ?? 0); $pos = (float)($r->positive_points ?? 0); $neg = (float)($r->negative_points ?? 0); $hours = (float)($r->total_hours ?? 0); $userDetails = $details[$uid] ?? []; @endphp
{{ $r->name ?? ('#'.$r->id) }}
{{ $r->username ?? '' }} • {{ $r->membership_status }} @if($r->gender === 'male') • شاب @elseif($r->gender === 'female') • صبية @endif
صافي الفترة
{{ $net }}
إيجابي
{{ (int)$pos }}
سلبي
{{ (int)$neg }}
ساعات
{{ $hours }}
{{-- تفصيل حسب نوع المصدر --}}
تفصيل حسب المصدر:
@forelse($userDetails as $type => $info) @php $label = $sourceTypeLabels[$type] ?? $type; $p = (float)$info['points']; $class = $p >= 0 ? 'text-emerald-200' : 'text-rose-200'; @endphp
{{ $label }} {{ $p }} ({{ $info['records'] }} سجلات)
@empty
لا يوجد سجلات مفصّلة في هذه الفترة.
@endforelse
@empty
لا يوجد أعضاء ضمن الفلاتر الحالية.
@endforelse
{{ $rows->links() }}
@else {{-- جدول --}}

جدول تفصيل علامات الأعضاء

يعرض صافي النقاط + إيجابي + سلبي، مع إشارة لأهم المصادر لكل عضو.

عدد الصفوف: {{ $rows->total() }}
@forelse($rows as $r) @php $uid = $r->id; $userDetails = $details[$uid] ?? []; // نعرض أول 3 مصادر بس $topSources = collect($userDetails) ->sortByDesc(fn($info) => $info['points']) ->take(3); @endphp @empty @endforelse
العضو اليوزر الرتبة الجنس صافي إيجابي سلبي ساعات أهم المصادر
{{ $r->name ?? ('#'.$r->id) }}
{{ $r->username ?? '—' }} {{ $r->membership_status }} @if($r->gender === 'male') شاب @elseif($r->gender === 'female') صبية @else غير محدد @endif {{ (float)$r->net_points }} {{ (float)$r->positive_points }} {{ (float)$r->negative_points }} {{ (float)$r->total_hours }} @if($topSources->isEmpty()) لا يوجد بيانات مفصّلة @else @foreach($topSources as $type => $info) @php $label = $sourceTypeLabels[$type] ?? $type; $p = (float)$info['points']; $class = $p >= 0 ? 'text-emerald-200' : 'text-rose-200'; @endphp
{{ $label }} {{ $p }} ({{ $info['records'] }} سجل)
@endforeach @endif
لا يوجد أعضاء ضمن الفلاتر الحالية.
{{ $rows->links() }}
@endif
هذه الصفحة مفيدة عندما تريد أن تقول: "علامات هذا العضو جايّة من وين بالضبط؟ تقييم؟ لايف؟ مخالفات؟ تكريم؟".
@endsection