@forelse ($personnel as $p) @php $avatar_placeholder = url('assets/img/avatars/placeholder.jpg'); $avatar = $p->user->pas_photo ? Util::linkFile('pas-photo', $p->user->pas_photo) : $avatar_placeholder; $bgcolors = [ 'Approved' => '#3DAD5C', 'Need Review' => '#FAAD43', 'Decline' => '#ED3E3E', ]; $icons = [ 'Approved' => url('assets/img/icons/approved.svg'), 'Need Review' => url('assets/img/icons/pending.svg'), 'Decline' => url('assets/img/icons/decline.svg'), ]; $gateNames = []; foreach ($p->gateInLocation as $gil) { $gateNames[] = $gil->location?->name; } $implodeGateNames = implode(',', $gateNames); @endphp {{ $loop->index + 1 + $personnel->perPage() * ($personnel->currentPage() - 1) }}
{{ $p->user->name }}
{{ $p->user->position }} @if ($p->user->gender == 'Male') @lang('app.male') @else @lang('app.female') @endif {{ $p->user->company }} {{ $implodeGateNames }} {{ date('d F Y H:i', strtotime($p->start_duty)) }} {{ date('d F Y H:i', strtotime($p->end_duty)) }} @php $countDays = Util::countDaysDuty($p->start_duty); @endphp @if ($countDays < 0) not started yet @else {{ $countDays }} @endif @empty @include('components.empty.empty-state') @endforelse