@extends('layouts.app') @section('title', 'My Dashboard') @section('page-title', 'Candidate Dashboard') @section('content')
{{ $stats['total_registered'] }}
Registered Exams
{{ $stats['completed'] }}
Completed
{{ $stats['pending'] }}
Awaiting Approval
{{ $stats['passed'] }}
Exams Passed
My Registrations
Browse Exams
@forelse($registrations as $reg)
{{ $reg->exam->title }}
By {{ $reg->exam->tester->name }} @if($reg->exam->tester->organization) · {{ $reg->exam->tester->organization }} @endif
{{ $reg->exam->duration_minutes }} min · {{ $reg->exam->total_marks }} marks · Pass: {{ $reg->exam->pass_percentage }}%
@if($reg->exam->start_at)
{{ $reg->exam->start_at->format('D, M j Y H:i') }}
@endif
{{-- Status badge --}} @php $statusMap = [ 'pending' => ['label' => 'Pending Approval', 'class' => 'badge-warning'], 'approved' => ['label' => 'Approved', 'class' => 'badge-info'], 'completed' => ['label' => 'Completed', 'class' => 'badge-success'], 'rejected' => ['label' => 'Rejected', 'class' => 'badge-danger'], ]; $s = $statusMap[$reg->status] ?? ['label' => ucfirst($reg->status), 'class' => 'badge-muted']; @endphp {{ $s['label'] }} {{-- Payment badge --}} @if($reg->payment_required && !$reg->payment_confirmed) Payment Required @endif {{-- Action button --}} @if($reg->payment_required && !$reg->payment_confirmed) Pay Now @elseif($reg->status === 'approved' && $reg->canAttempt() && $reg->exam->isActive()) Start Exam @elseif($reg->status === 'completed') @if($reg->attempts->where('status', 'graded')->first()) View Result @endif @else Details @endif
@empty
You haven't registered for any exams yet.

Browse Available Exams
@endforelse
@endsection