@props(['records', 'countryCodes' => []])
UNSCR Consolidated List
{{ $records->total() }} Records
@forelse ($records as $record) @php /* |-------------------------------------------------------------------------- | FULL NAME |-------------------------------------------------------------------------- */ $fullName = trim( ($record->FIRST_NAME ?? '') . ' ' . ($record->SECOND_NAME ?? '') . ' ' . ($record->THIRD_NAME ?? '') . ' ' . ($record->FOURTH_NAME ?? ''), ); if ($fullName === '') { $fullName = $record->NAME_ORIGINAL_SCRIPT ?: '-'; } /* |-------------------------------------------------------------------------- | DESIGNATION |-------------------------------------------------------------------------- */ $designationDecoded = json_decode($record->DESIGNATION ?? '', true); $designations = []; if (is_array($designationDecoded) && array_key_exists('VALUE', $designationDecoded)) { $designationValue = $designationDecoded['VALUE']; if (is_array($designationValue)) { $designations = array_values(array_filter($designationValue)); } elseif ($designationValue !== null && trim((string) $designationValue) !== '') { $designations = [$designationValue]; } } /* |-------------------------------------------------------------------------- | NATIONALITY |-------------------------------------------------------------------------- */ $nationalityDecoded = json_decode($record->NATIONALITY ?? '', true); $nationalities = []; if (is_array($nationalityDecoded) && array_key_exists('VALUE', $nationalityDecoded)) { $nationalityValue = $nationalityDecoded['VALUE']; if (is_array($nationalityValue)) { $nationalities = array_values(array_filter($nationalityValue)); } elseif ($nationalityValue !== null && trim((string) $nationalityValue) !== '') { $nationalities = [$nationalityValue]; } } @endphp {{-- NO --}} {{-- NAME --}} {{-- DESIGNATION --}} {{-- NATIONALITY --}} {{-- REFERENCE NUMBER --}} {{-- DATE LISTED --}} {{-- ACTION --}} @empty @endforelse
No. Name Designation Nationality Reference No. Date Listed Action
{{ $records->firstItem() + $loop->index }} {{ $fullName }} @if (!empty($record->NAME_ORIGINAL_SCRIPT) && $fullName !== $record->NAME_ORIGINAL_SCRIPT)
{{ $record->NAME_ORIGINAL_SCRIPT }}
@endif
@forelse ($designations as $designation)
last) class="mb-1" @endif> {{ $designation }}
@empty - @endforelse
@forelse ($nationalities as $country) @php $iso3 = $countryCodes[strtolower(trim($country))] ?? null; $flagCode = $this->getFlagCode($iso3); @endphp
@if ($flagCode) @endif {{ $country }}
@empty - @endforelse
{{ $record->REFERENCE_NUMBER ?: '-' }} @if ($record->LISTED_ON) {{ \Carbon\Carbon::parse($record->LISTED_ON)->format('d/m/Y') }} @else - @endif
No UNSCR Consolidated records found.
{{ $records->links() }}