@extends('layouts.app', ['class' => 'g-sidenav-show bg-gray-100']) @section('content') @include('layouts.navbars.auth.topnav', ['title' => ''])
| Action | No | Karyawan | Posisi (Periode) | Departemen | Status |
|---|---|---|---|---|---|
|
@if ($authorize && $authorize->edit == '1')
@if ($r->master_id && $status === 'approved')
{{-- Employee has assignment and evaluation master and it's approved - show View button --}}
@else
{{-- All other statuses - show Detail button (unlock is on detail page) --}}
@php
// For incomplete status, ensure master record exists
$detailMasterId = $r->master_id;
if (!$detailMasterId) {
$incompleteMaster = DB::table(
'trs_pa_evaluation_master',
)
->where('employee_nik', $r->employee_nik)
->where('period_id', $activePeriod->id)
->first();
if (!$incompleteMaster) {
// Create master record if it doesn't exist
$detailMasterId = DB::table(
'trs_pa_evaluation_master',
)->insertGetId([
'employee_nik' => $r->employee_nik,
'period_id' => $activePeriod->id,
'status' => 'in_progress',
'isactive' => '1',
'created_at' => now(),
'updated_at' => now(),
'user_create' =>
auth()->user()->username ??
auth()->user()->id,
'user_update' =>
auth()->user()->username ??
auth()->user()->id,
]);
} else {
$detailMasterId = $incompleteMaster->id;
}
}
@endphp
@endif
@endif
|
{{ ($rows->currentPage() - 1) * $rows->perPage() + $loop->iteration }} |
{{ $r->employee_name }} -
{{ $r->employee_nik }}
|
{!! $positionDisplay !!} | {!! $departmentDisplay !!} |
{{ $statusBadge['text'] }}
@if ($r->has_late_unlock)
TERLAMBAT
@endif
@if ($r->master_id)
{{ $progressText }}
@endif
|