@extends('layouts.superadmin') @section('title','Socratic Sentinel — Explorer') @section('content') @php $auditTotal = (is_object($audit) && method_exists($audit,'total')) ? (int)$audit->total() : (is_countable($audit) ? count($audit) : 0); $trackingCount = (is_countable($tracking) ? count($tracking) : 0); $failedCount = (is_countable($failed) ? count($failed) : 0); $jobsCount = (is_countable($jobs) ? count($jobs) : 0); $membersDeep = $membersDeep ?? [ 'total'=>0,'active7'=>0,'active30'=>0,'dormant14'=>0, 'top_visitors_14'=>collect(),'last_seen'=>collect(),'absence_top30'=>collect(), 'eval'=>[ 'overall_avg_current'=>0,'overall_avg_prev'=>0,'overall_change_pct'=>0, 'top_improvers'=>collect(),'top_decliners'=>collect(),'anomalies'=>collect(), ], ]; $promission = $promission ?? [ 'open'=>0,'completed'=>0,'late'=>0,'completion_rate'=>0, 'stuck'=>collect(),'forecast_bad'=>collect(),'top_assignees'=>collect(), ]; $promissionAlgo = $promissionAlgo ?? [ 'from' => $from ?? now()->subDays(14)->toDateString(), 'to' => $to ?? now()->toDateString(), 'compare_mode' => 'prev_month', 'compare_from' => null, 'compare_to' => null, 'compare_enabled' => false, 'goalsTeam' => ['total_hours'=>300,'guest_count'=>100,'live_hours'=>80,'sahra_hours'=>20], 'goalsMember' => ['mix_hours'=>50,'sahra_hours'=>5], 'team' => ['members'=>0,'live_hours'=>0,'sahra_hours'=>0,'guest_hours'=>0,'guest_count'=>0,'total_hours'=>0], 'teamCmp' => null, 'rows' => collect(), 'ai' => ['summary'=>'','tips'=>[]], ]; $algoTeam = $promissionAlgo['team'] ?? []; $algoGoalsTeam = $promissionAlgo['goalsTeam'] ?? []; $algoGoalsMember = $promissionAlgo['goalsMember'] ?? []; $algoRows = collect($promissionAlgo['rows'] ?? collect()); $algoAi = $promissionAlgo['ai'] ?? ['summary'=>'','tips'=>[]]; $pct = function($num, $den){ $den = (float)($den ?? 0); if($den <= 0) return 0; return round(((float)$num / $den) * 100, 1); }; $fmtH = function($h){ return number_format((float)$h, 2); }; $hitBadge = function($hit){ if(is_null($hit)) return ['cls'=>'bg-white/5 border-white/10 text-white/70','txt'=>'—']; return $hit ? ['cls'=>'bg-emerald-500/10 border-emerald-400/20 text-emerald-200','txt'=>'محقق ✅'] : ['cls'=>'bg-rose-500/10 border-rose-400/20 text-rose-200','txt'=>'غير محقق ✖']; }; $compareEnabled = (bool)($promissionAlgo['compare_enabled'] ?? false); $cmp = $promissionAlgo['teamCmp'] ?? null; $tone = function($v){ if(is_null($v)) return 'slate'; return ((float)$v >= 0) ? 'emerald' : 'rose'; }; @endphp
{{-- Header --}}
Explorer — Audit + Tracking + Jobs + Members + ProMission

Explorer التنقيب والتحقيق

لوحة استكشاف عميقة: سجلات الإدارة + تتبع + طوابير + تعمّق بالأعضاء + أهداف + خوارزمية ProMission.

Audit: {{ number_format($auditTotal) }} Tracking: {{ number_format($trackingCount) }} Jobs: {{ number_format($jobsCount) }} Failed: {{ number_format($failedCount) }}
✅ ملاحظة: يتم عرض الأعضاء المؤهلين فقط (نشط + غير خارج) حسب فلترة الكنترول.
فلترة + بحث
نطاق التحليل
{{-- Range --}}
{{-- Search --}}
{{-- ProMission Algo Compare Controls (kept in same request) --}}
إذا اخترت "تخصيص" لازم تعبي من/إلى.
{{-- Tabs --}}
{{-- ✅ NEW TAB: ProMission Algorithm --}}
{{-- ========================= AUDIT ========================= --}}
Audit Logs
أحدث عمليات الإدارة (مع Pagination)
@forelse($audit as $row) @empty @endforelse
ID Action Module Route IP At
{{ $row->id ?? '—' }}
{{ $row->action ?? '—' }}
{{ $row->url ?? $row->route_name ?? '—' }}
{{ $row->module ?? '—' }} {{ $row->route_name ?? '—' }} {{ $row->ip_address ?? '—' }} {{ $row->created_at ?? '—' }}
لا يوجد نتائج.
@if(is_object($audit) && method_exists($audit,'links'))
{{ $audit->links() }}
@endif
{{-- ========================= TRACKING ========================= --}} {{-- ========================= JOBS ========================= --}} {{-- ========================= FAILED ========================= --}} {{-- ========================= MEMBERS DEEP ========================= --}} {{-- ========================= PROMISSION (TABLE-BASED GOALS) ========================= --}} {{-- ========================= PROMISSION ALGORITHM (NEW) ========================= --}}
@endsection