{{-- resources/views/admin/competitors/_table.blade.php --}}
| No | Foto | Identitas Personal | Gender | Kategori & Spesialisasi Lomba | Semua Hasil | Aksi |
|---|---|---|---|---|---|---|
| {{ $loop->iteration }} |
|
{{ $comp->name }}
[Kompetitor]
{{ $comp->date_of_birth ? \Carbon\Carbon::parse($comp->date_of_birth)->format('d M Y') : '-' }}
@if($comp->date_of_birth)
({{ \Carbon\Carbon::parse($comp->date_of_birth)->age }} Thn)
@endif
@php $countries = config('countries'); @endphp
@if(isset($countries[$comp->country_code])) {{ $countries[$comp->country_code]['flag'] ?? '🏳️' }} @else 🏳️ @endif
{{ $comp->country_code }}
|
{{ $comp->affiliation ?? '-' }}
@php
$cats = is_string($comp->age_category) ? json_decode($comp->age_category, true) : $comp->age_category;
@endphp
@if(is_array($cats))
Kategori Usia: {{ implode(', ', $cats) }}
@endif
|
@if($comp->gender == 'male') Putra @elseif($comp->gender == 'female') Putri @else Campuran @endif |
@php
$requestedCategory = request('specialty_category');
$performancesToDisplay = $comp->performances;
if ($requestedCategory) {
$performancesToDisplay = $performancesToDisplay->filter(function($perf) use ($requestedCategory) {
return ($perf->discipline->competition_category_id ?? null) == $requestedCategory;
});
}
@endphp
@if($performancesToDisplay->isEmpty())
Belum ada spesialisasi.
@else
|
{{ $comp->performanceHistories->count() ?? 0 }} | |
|
@if(request('search') || request('specialty_category'))
Pencarian tidak ditemukan
@else
{{ $emptyMessage ?? 'Belum ada data kompetitor' }}
@endif
|
||||||