@extends('layouts.admin') @section('title', 'Peserta — ' . $program->title) @section('header', 'Senarai Peserta') @section('breadcrumb') @endsection @section('header-actions')
Export CSV Import CSV Tambah
@endsection @section('content') {{-- Summary Cards --}}
@foreach([ ['label' => 'Jumlah Peserta', 'value' => $counts['total'], 'icon' => 'bi-people', 'color' => 'primary'], ['label' => 'Pra-Daftar', 'value' => $counts['pre_registered'], 'icon' => 'bi-person-check', 'color' => 'info'], ['label' => 'Walk-In', 'value' => $counts['walk_in'], 'icon' => 'bi-person-walking', 'color' => 'warning'], ['label' => 'Hadir', 'value' => $counts['checked_in'], 'icon' => 'bi-patch-check', 'color' => 'success'], ] as $card)
{{ $card['value'] }}
{{ $card['label'] }}
@endforeach
{{-- Filter --}}
@if(request()->hasAny(['search', 'source', 'status'])) Reset @endif
{{-- Table --}}
@if($programParticipants->isEmpty())
Belum ada peserta.
@else
@foreach($programParticipants as $i => $pp) @php $p = $pp->participant; $cert = $certificates[$pp->participant_id] ?? null; @endphp @endforeach
# Nama Agensi Sesi Sumber Status E-Sijil Tindakan
{{ $programParticipants->firstItem() + $i }}
{{ $p->name }}
{{ $p->email ?: '—' }}
{{ $p->agency ?: '—' }} @if($pp->pre_registered_session) {{ Str::ucfirst($pp->pre_registered_session) }} @else @endif @php $sourceMap = [ 'pre_registered' => ['secondary', 'Pra-Daftar'], 'import' => ['info', 'Import'], 'walk_in' => ['warning', 'Walk-In'], 'admin_manual' => ['dark', 'Manual'], ]; [$sc, $sl] = $sourceMap[$pp->registration_source] ?? ['light', $pp->registration_source]; @endphp {{ $sl }} @if($pp->status === 'checked_in') Hadir @elseif($pp->status === 'cancelled') Dibatalkan @else Berdaftar @endif @if(! $cert) @else {{-- Sijil --}} @if(in_array($cert->status, ['generated','emailed','downloaded'])) Jana ✓ @elseif($cert->status === 'pending') Menjana... @elseif($cert->status === 'failed') Gagal Jana @endif {{-- Emel --}} @if($pp->status_sent_emel === 'sent')
Emel Dihantar
@elseif($pp->status_sent_emel === 'failed')
Emel Gagal
@elseif($pp->status_sent_emel === 'pending')
Dalam Antrian
@elseif($cert && $cert->isGenerated() && ! $cert->emailed_at)
Belum Dihantar
@endif {{-- Muat turun --}} @if($cert->download_count > 0)
{{ $cert->download_count }}× Muat Turun
@endif @endif
@if($cert && $cert->isGenerated()) @endif @if($pp->status !== 'checked_in')
@csrf @method('DELETE')
@endif
@if($programParticipants->hasPages())
{{ $programParticipants->links() }}
@endif @endif
@endsection