@forelse ($employees as $e)
@php
$avatar = Util::linkFile('pas-photo', $e->user->pas_photo);
$location_names = [];
foreach ($e->gateInLocation as $gil) {
$location_names[] = $gil->location?->name ?? "-";
}
if (!empty($location_names)) {
$location_str = $location_names[0];
$cnt = count($location_names);
if($cnt > 2) {
$txt = "(more "."+".($cnt - 1).")";
$location_str .= ' '.$txt.'';
}else if ($cnt > 1) {
$txt = "(more "."+".$cnt.")";
$location_str .= ' '.$txt.'';
}
} else {
$location_str = "-"; // fallback kalau kosong
}
$now = date('Y-m-d');
$tgl_akhir = date('Y-m-d', strtotime($e->end_duty));
@endphp
{{-- @if ($now <= $tgl_akhir) --}}
|
{{-- {{ $loop->index + 1 + $employees->perPage() * ($employees->currentPage() - 1) }} --}}
|
@foreach($location_names as $loc)
- {{ $loc }}
@endforeach
|
|
{{ $e->user->position }} |
{{ $e->user->company }} |
{{ date('d F Y', strtotime($e->start_duty)) }}
|
{{ date('d F Y', strtotime($e->end_duty)) }}
|
@hasrole(['super_admin', 'user_admin', 'contract_user'])
@include('components.util.change-status', [
'status' => $e->status,
'name' => 'gatein_status' . $e->id,
'user_id' => $e->user->id,
'type' => 'gatein_status',
'class' => 'update-status-gatein',
'route' => route('gate-in.update'),
'gate_in_id' => $e->id,
'style' => 'width:170px',
])
@else
@include('components.util.label-only', [
'status' => $e->status,
'name' => 'gatein_status' . $e->id,
'user_id' => $e->user->id,
'type' => 'gatein_status',
'class' => 'update-status-gatein',
'route' => route('gate-in.update'),
'gate_in_id' => $e->id,
'style' => 'width:170px',
])
@endhasrole
|
{{ route('gate-in.edit', ['id' => $e->id]) }} |
@role(['super_admin', 'admin_contractor', 'dokter', 'contract_user'])
@php
$urlDownload = $e->qrCode?->image ?? '';
if($urlDownload) $urlDownload2 = route('download-qrcode', ['url' => $urlDownload]);
else $urlDownload2 = 'javascript:;';
@endphp
@if($e->status == 'Approved')
@endif
|
@endrole
{{-- @endif --}}
@empty