@if (empty($standardSetTabs))
@else
{{-- Position Tabs --}}
{{-- Tab Content --}}
{{-- Tab Content --}}
@foreach ($standardSetTabs as $positionKey => $setData)
@php
$tabKey = $positionKey;
$allStandardItems = collect();
if (isset($standardItemsBySet[$tabKey])) {
$allStandardItems = $standardItemsBySet[$tabKey];
}
@endphp
@if ($allStandardItems->isNotEmpty())
|
Standar PA
|
@foreach ($setData['months'] as $monthKey)
@php
$monthLabel = \Carbon\Carbon::createFromFormat(
'Y-m',
$monthKey,
)->format('M Y');
$segment =
$segmentsByMonth[$monthKey] ??
null;
$restMonth =
$restMonths[$monthKey] ?? null;
@endphp
@if ($restMonth)
{{ $monthLabel }}
({{ ucfirst($restMonth->reason) }})
|
@elseif($segment)
{{ $monthLabel }}
@if (isset($lateMonths[$monthKey]) && $lateMonths[$monthKey])
TERLAMBAT
@endif
|
@else
{{ $monthLabel }} (Kosong)
|
@endif
@endforeach
@foreach ($setData['months'] as $monthKey)
@php
$segment =
$segmentsByMonth[$monthKey] ??
null;
$restMonth =
$restMonths[$monthKey] ?? null;
@endphp
@if ($restMonth)
| - |
- |
- |
- |
@elseif($segment)
Bobot (%) |
Rating |
Alasan Revisi |
Score |
@else
- |
- |
- |
- |
@endif
@endforeach
@foreach ($allStandardItems as $standardItem)
|
{{ $standardItem->name }}
|
@foreach ($setData['months'] as $monthKey)
@php
$segment =
$segmentsByMonth[
$monthKey
] ?? null;
$restMonth =
$restMonths[$monthKey] ??
null;
$evaluationItem = null;
// Find evaluation item for this standard item and segment
if (
$segment &&
isset(
$evaluationItems[
$segment->id
],
)
) {
// First try exact match by standard_item_id
$evaluationItem = $evaluationItems[
$segment->id
]->firstWhere(
'standard_item_id',
$standardItem->id,
);
// If no exact match, try matching by name and order only
if (!$evaluationItem) {
$evaluationItem = $evaluationItems[
$segment->id
]->first(function (
$item,
) use ($standardItem) {
return $item->item_name ===
$standardItem->name &&
$item->item_order ==
$standardItem->order;
});
}
}
@endphp
@if ($restMonth)
Sedang Cuti
|
@elseif($evaluationItem)
{{-- Bobot --}}
{{ rtrim(rtrim(number_format($evaluationItem->final_weight ?? ($evaluationItem->item_weight ?? $standardItem->weight), 2), '0'), '.') }}%
|
{{-- Rating --}}
@if ($evaluationItem->is_revised && $evaluationItem->revision_reason)
{{ $evaluationItem->final_rating_score }}
(
{{ $evaluationItem->original_rating_score }}
)
@else
{{ $evaluationItem->final_rating_score }}
@endif
|
{{-- Alasan Revisi --}}
@if ($evaluationItem->is_revised && $evaluationItem->revision_reason)
{{ $evaluationItem->revision_reason }}@else-
@endif
|
{{-- Score --}}
{{ rtrim(rtrim(number_format($evaluationItem->weighted_score ?? 0, 2), '0'), '.') }}
|
@elseif($segment)
{{-- Segment ada, item evaluasi tidak ada --}}
- |
No
Data |
- |
- |
@else
{{-- Tidak ada segment --}}
Belum Dinilai |
@endif
@endforeach
@endforeach
@else
Tidak ada
standard item untuk posisi ini.
@endif
@endforeach