@extends('layouts.app') @section('title', 'Detail Pegawai') @section('subtitle', 'Informasi lengkap dan timeline akses') @section('breadcrumb')
  • Pegawai
  • Detail
  • @endsection @section('actions') Edit @endsection @section('content')
    {{ substr($employee->name, 0, 2) }}

    {{ $employee->name }}

    {{ $employee->nip }} • {{ $employee->position }}

    @php $statusColors = [ 'active' => 'bg-emerald-100 text-emerald-800', 'retiring' => 'bg-amber-100 text-amber-800', 'retired' => 'bg-gray-100 text-gray-800', 'extended' => 'bg-purple-100 text-purple-800', ]; @endphp {{ ucfirst($employee->status) }}

    Informasi Pribadi

    Email

    {{ $employee->email }}

    Telepon

    {{ $employee->phone ?? '-' }}

    Departemen

    {{ $employee->department->name }}

    Status Kepegawaian

    {{ str_replace('_', ' ', $employee->employment_status) }}

    Tanggal Masuk

    {{ $employee->join_date->format('d M Y') }}

    Masa Kerja

    {{ $employee->join_date->diffForHumans(null, true) }}

    @if($employee->retirement_date)

    Informasi Pensiun/Resign

    Tanggal

    {{ $employee->retirement_date->format('d M Y') }}

    Tipe

    {{ str_replace('_', ' ', $employee->retirement_type) }}

    @if($employee->retirement_document) Lihat Dokumen @endif
    @endif

    Timeline Akses

    @forelse($employee->accessDetails as $access)

    {{ $access->accessCatalog->name }}

    {{ $access->accessCatalog->code }} • {{ $access->accessCatalog->getCategoryLabelAttribute() }}

    @if($access->status !== 'revoked') {{ $access->daysUntilExpiry() }} hari
    @csrf
    @else Revoked @endif
    {{ $access->granted_date->format('d M Y') }} {{ $access->current_expiry_date->format('d M Y') }} @if($access->is_extended) Extended {{ $access->extension_count }}x @endif
    @empty

    Belum ada akses yang diberikan

    @endforelse

    Ringkasan Akses

    Aktif {{ $employee->accessDetails->where('status', 'active')->count() }}
    Extended {{ $employee->accessDetails->where('status', 'extended')->count() }}
    Revoked {{ $employee->accessDetails->where('status', 'revoked')->count() }}

    Aktivitas Terbaru

    @forelse($employee->accessDetails->flatMap->revocationLogs->sortByDesc('created_at')->take(5) as $log)

    {{ $log->employeeAccessDetail->accessCatalog->name }} {{ $log->method === 'automatic' ? 'auto-revoked' : 'revoked' }}

    {{ $log->created_at->diffForHumans() }}

    @empty

    Belum ada aktivitas

    @endforelse
    @endsection