@forelse ($data as $item) @php $avatar_placeholder = url('assets/img/avatars/placeholder.jpg'); $avatar = $item->pas_photo ? Util::linkFile('pas-photo', $item->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 = []; if ($item->gateInVisitor && count($item->gateInVisitor) > 0) { foreach ($item->gateInVisitor as $gate) { $gateNames[] = $gate->location?->name; } } if ($item->gateIn && count($item->gateIn) > 0) { foreach ($item->gateIn[0]->gateInLocation as $gil) { $gateNames[] = $gil->location?->name; } } $implodeGateNames = implode(',', $gateNames); @endphp @php $get = url()->full(); $parsedUrl = parse_url($get); $query = $parsedUrl['query']; parse_str($query, $output); @endphp {{ $loop->index + 1 + $data->perPage() * ($data->currentPage() - 1) }}
{{ $item->name }}
{{ $item->username ?? '' }} @if ($item->gender == 'Male') @lang('app.male') @else @lang('app.female') @endif {{ $item->company }} {{ $implodeGateNames }} @if ($item->gateInVisitor && count($item->gateInVisitor) > 0) {{ date('d F Y H:i', strtotime($item->gateInVisitor[0]->start_duty)) }} @endif @if ($item->gateIn && count($item->gateIn) > 0) {{ date('d F Y H:i', strtotime($item->gateIn[0]->start_duty)) }} @endif @if ($item->gateInVisitor && count($item->gateInVisitor) > 0) {{ date('d F Y H:i', strtotime($item->gateInVisitor[0]->end_duty)) }} @endif @if ($item->gateIn && count($item->gateIn) > 0) {{ date('d F Y H:i', strtotime($item->gateIn[0]->end_duty)) }} @endif @if ($type == 'all') @if ($item->gateInVisitor) @lang('app.visitor') @endif @if ($item->gateIn) @lang('app.worker') @endif @endif @empty @include('components.empty.empty-state') @endforelse