محدد: 0
@php
$displayedCount = 0;
$totalCount = $certificates->count();
@endphp
@forelse($certificates as $certificate)
@php
$student = $certificate->student;
$isSelected = in_array($certificate->id, $selectedCertificateIds ?? []);
@endphp
@if($student)
@php $displayedCount++; @endphp
@php
// Get saved country name for this graduate (stored as text)
$savedCountryName = $value['graduate_countries'][$certificate->id] ?? null;
$savedCountryFlag = null;
$savedFlagImage = $value['graduate_flags'][$certificate->id] ?? null;
if ($savedCountryName) {
$savedCountryName = trim($savedCountryName);
// Get country flag emoji (only if no custom flag image)
if (!$savedFlagImage && class_exists('\App\Helpers\CountryHelper')) {
$savedCountryFlag = \App\Helpers\CountryHelper::getCountryFlag($savedCountryName);
}
}
// Fallback to student's country if no saved country
if (!$savedCountryName && !empty($student->country_id)) {
try {
$country = \App\Models\Region::where('id', $student->country_id)->first();
if ($country && !empty($country->title)) {
$savedCountryName = trim($country->title);
if (!$savedFlagImage && class_exists('\App\Helpers\CountryHelper')) {
$savedCountryFlag = \App\Helpers\CountryHelper::getCountryFlag($savedCountryName);
}
}
} catch (\Exception $e) {
// Silently handle errors
}
}
@endphp
@endif
@empty
لا يوجد خريجين متاحين
@endforelse
@php
\Log::info('Graduates Settings View - Total Certificates: ' . $totalCount);
\Log::info('Graduates Settings View - Displayed Certificates: ' . $displayedCount);
@endphp
معلومات التصحيح:
إجمالي الشهادات: {{ $totalCount }}
الشهادات المعروضة: {{ $displayedCount }}
الشهادات المخفية: {{ $totalCount - $displayedCount }}