@extends('layouts.app') @section('title', 'Super Admin Dashboard') @section('breadcrumb') Home Dashboard @endsection @section('content') @php $u = auth()->user(); // Derived metrics from existing $stats $liveExams = ($stats['total_exams'] ?? 0) - ($stats['completed_exams'] ?? 0); $activePct = ($stats['total_users'] ?? 0) > 0 ? round(($stats['active_users'] / $stats['total_users']) * 100) : 0; $completionPct = ($stats['total_exams'] ?? 0) > 0 ? round(($stats['completed_exams'] / $stats['total_exams']) * 100) : 0; // Radial: dasharray out of 352 (2*π*56) $radialLen = round(352 * ($completionPct / 100), 1); $radialRemaining = round(352 - $radialLen, 1); // Application status breakdown (approved vs rest) $applicationsTotal = $stats['total_applications'] ?? 0; $applicationsApproved = $stats['approved_applications'] ?? 0; $applicationsPending = max(0, $applicationsTotal - $applicationsApproved); $donutTotal = max(1, $applicationsTotal); $donutApproved = round(($applicationsApproved / $donutTotal) * 390, 1); $donutPending = round(($applicationsPending / $donutTotal) * 390, 1); @endphp {{-- ============ HERO ============ --}}
{{ now()->format('l, F j, Y') }} All systems operational ISO 27001 certified

Welcome back, {{ $u->name }}

{{ $appSettings->app_name ?? config('app.name') }} Recruitment System — Real-time monitoring and oversight dashboard

{{ $stats['active_users'] }} / {{ $stats['total_users'] }}
Active users
{{ $liveExams }} live
Ongoing exams
{{ $completionPct }}%
Completion rate
{{ $stats['emails_sent'] }}
Result emails
{{-- ============ STAT CARDS ============ --}}
{{-- Total Users — links to the candidates listing (no dedicated users page exists; candidates are the dominant user class). --}}
View all candidates
{{ $stats['total_candidates'] }} cands
Total Users
{{ $stats['total_users'] }} users
{{-- Active Users → same candidate listing (route filter by `status` not yet implemented; noted for Tier 2). --}}
View active candidates
{{ $activePct }}%
Active Users
{{ $stats['active_users'] }} online
{{-- Exam Attempts → full attempts list. --}}
View all exam attempts
@if($liveExams > 0) LIVE @else {{ $stats['completed_exams'] }} done @endif
Exam Attempts
{{ $stats['total_exams'] }} total
{{-- Security Events → exam-security-logs index (note: route is `admin.exam-security-logs.index`, not `admin.security-logs.index`). --}}
View security events
@if(($stats['force_submitted'] ?? 0) > 0) {{ $stats['force_submitted'] }} forced @else clean @endif
Security Events
{{ $stats['security_events'] }} flagged
{{-- ============ INFO ROW ============ --}}
{{-- Radial KPI: Exam completion rate --}}
{{ $completionPct }}%
completion
Exam completion rate
{{ $stats['completed_exams'] }} of {{ $stats['total_exams'] }} attempts completed
{{-- Timeline --}}
System timeline
Latest {{ min(5, $recentLogs->count()) }} events
@forelse($recentLogs->take(5) as $log) @php $a = strtolower($log->action ?? ''); $tone = 'success'; if (str_contains($a, 'reject') || str_contains($a, 'delete') || str_contains($a, 'force')) $tone = 'danger'; elseif (str_contains($a, 'warning') || str_contains($a, 'tab_') || str_contains($a, 'fullscreen')) $tone = 'warning'; elseif (str_contains($a, 'logout') || str_contains($a, 'update') || str_contains($a, 'login')) $tone = ''; @endphp
{{ Str::title(str_replace('_', ' ', $log->action)) }}{{ $log->user ? ' — '.Str::limit($log->user->name, 30) : '' }}
{{ $log->created_at->format('h:i A') }} · {{ $log->ip_address ?? 'System' }}
@empty
No events yet.
@endforelse
{{-- Breakdown card (replaces geo; uses real data) --}}
System load
Distribution across modules
@php $maxLoad = max(1, $stats['total_users'], $stats['total_applications'], $stats['total_exams'], $stats['active_posts']); $rows = [ ['label' => 'Users', 'value' => $stats['total_users'], 'letters' => 'US', 'grad' => 'linear-gradient(135deg,#22D3EE,#0EA5E9)', 'fill' => 'linear-gradient(90deg,#22D3EE,#0EA5E9)'], ['label' => 'Applications', 'value' => $stats['total_applications'], 'letters' => 'AP', 'grad' => 'linear-gradient(135deg,#34D399,#10B981)', 'fill' => 'linear-gradient(90deg,#34D399,#10B981)'], ['label' => 'Exam attempts','value' => $stats['total_exams'], 'letters' => 'EX', 'grad' => 'linear-gradient(135deg,#FBBF24,#F59E0B)', 'fill' => 'linear-gradient(90deg,#FBBF24,#F59E0B)'], ['label' => 'Active posts', 'value' => $stats['active_posts'], 'letters' => 'PO', 'grad' => 'linear-gradient(135deg,#A78BFA,#8B5CF6)', 'fill' => 'linear-gradient(90deg,#A78BFA,#8B5CF6)'], ]; @endphp
@foreach($rows as $r)
{{ $r['letters'] }}
{{ $r['label'] }}{{ $r['value'] }}
@endforeach
{{-- ============ CHARTS ROW ============ --}}
{{-- Applications overview area chart --}}
Applications overview
Cumulative activity snapshot
Received
Approved
Pending
{{-- Illustrative 7-day chart. Once the controller provides a daily series, swap these points. --}} 40 30 20 10 @foreach(['Mon','Tue','Wed','Thu','Fri','Sat','Sun'] as $i => $d) {{ $d }} @endforeach
{{-- Donut: application status --}}
Application status
Approved vs pending/rejected
{{ $applicationsTotal }} TOTAL
Approved{{ $applicationsApproved }}
Pending / Rejected{{ $applicationsPending }}
{{-- ============ SECONDARY ROW ============ --}}
{{-- Activity feed --}}
Recent activity
System audit log
View all →
@forelse($recentLogs->take(6) as $log) @php $a = strtolower($log->action ?? ''); $tone = 'neutral'; $tag = 'neutral'; $icon = ''; if (str_contains($a, 'approve')) { $tone = 'success'; $tag = 'success'; $icon = ''; } elseif (str_contains($a, 'reject') || str_contains($a, 'delete')) { $tone = 'warning'; $tag = 'warning'; $icon = ''; } elseif (str_contains($a, 'login') || str_contains($a, 'register')) { $tone = 'primary'; $tag = 'primary'; } elseif (str_contains($a, 'update') || str_contains($a, 'post_')) { $tone = 'primary'; $tag = 'primary'; $icon = ''; } elseif (str_contains($a, 'warning') || str_contains($a, 'tab_') || str_contains($a, 'fullscreen') || str_contains($a, 'force')) { $tone = 'warning'; $tag = 'warning'; $icon = ''; } @endphp
{!! $icon !!}
{{ Str::title(str_replace('_', ' ', $log->action)) }}{{ $log->user ? ' — ' : '' }}@if($log->user){{ $log->user->name }}@endif
{{ $log->action }} · {{ $log->ip_address ?? 'System' }} @if($log->notes) · {{ Str::limit($log->notes, 40) }} @endif
{{ $log->created_at->diffForHumans(null, true) }} ago
@empty
No activity logged yet.
@endforelse
{{-- Module summary --}}
Module health
By volume & activity
@php $maxMod = max(1, $stats['total_users'], $stats['total_applications'], $stats['total_exams'], $stats['active_posts']); // Each row links to its relevant index page. Flagged: "Users" → candidates.index // since there's no unified users listing in the admin panel yet. $modules = [ ['name' => 'Users', 'value' => $stats['total_users'], 'grad' => 'perf-grad-1', 'route' => 'admin.candidates.index'], ['name' => 'Applications', 'value' => $stats['total_applications'], 'grad' => 'perf-grad-2', 'route' => 'admin.applications.index'], ['name' => 'Exam attempts','value' => $stats['total_exams'], 'grad' => 'perf-grad-3', 'route' => 'admin.exam-attempts.index'], ['name' => 'Active posts', 'value' => $stats['active_posts'], 'grad' => 'perf-grad-4', 'route' => 'admin.posts.index'], ]; usort($modules, fn($a, $b) => $b['value'] <=> $a['value']); @endphp
@foreach($modules as $i => $m) @php $rankIdx = $i + 1; @endphp
{{ $rankIdx }}{{ $m['name'] }} {{ $m['value'] }}
@endforeach
{{ $stats['total_admins'] ?? 0 }}
Admins
{{ $stats['total_candidates'] }}
Candidates
{{ $stats['emails_sent'] }}
Emails sent
@endsection