{{-- resources/views/HR/employees/show.blade.php --}} @extends('master.app') @section('title', 'Employee Profile') @section('body')
{{-- Header --}}
Employee

{{ $employee->name }}

{{ $employee->position ?? '—' }} • Phone: {{ $employee->phone ?? '—' }} @if($employee->email) • {{ $employee->email }} @endif @if($employee->resigned_at) • Resigned @else • Active @endif
{{-- Flash --}} @if(session('msg'))
{{ session('msg') }}
@endif {{-- Quick Actions --}}
Quick Actions
Overtime • Advance • Salary • Print • Resign
{{-- Overtime Advance Salary --}} {{-- Print Profile --}} Print Profile {{-- ID Card --}} ID Card {{-- Resign --}} {{-- Resign Certificate --}} @if($employee->resigned_at) Resign Certificate @endif
{{-- Stats --}}
Total Overtime
{{ number_format((float)($stats['overtime_total'] ?? 0), 2) }}
Total Advance
{{ number_format((float)($stats['advance_total'] ?? 0), 2) }}
Last Salary (Net)
{{ $stats['last_salary'] ? number_format((float)$stats['last_salary']->net_salary, 2) : '—' }}
{{ $stats['last_salary'] ? ($stats['last_salary']->year.'-'.$stats['last_salary']->month) : '' }}
Attendance Summary
P: {{ $stats['present_days'] ?? 0 }} A: {{ $stats['absent_days'] ?? 0 }} L: {{ $stats['leave_days'] ?? 0 }}
{{-- Activity Chart --}}
Activity Chart (Last 6 Months)
Overtime • Advance • Net Salary • Present Days
{{-- Documents --}}
@php $docs = [ ['title'=>'Profile Image','path'=>$employee->image,'icon'=>'fa-image'], ['title'=>'Employee Tazkira','path'=>$employee->tz_scan,'icon'=>'fa-id-card'], ['title'=>'Security Insurance','path'=>$employee->document,'icon'=>'fa-shield'], ['title'=>'Contract Letter','path'=>$employee->contract_letter,'icon'=>'fa-file-text-o'], ]; $isPdf = fn($p) => strtolower(pathinfo($p ?? '', PATHINFO_EXTENSION)) === 'pdf'; @endphp @foreach($docs as $d)
{{ $d['title'] }}
@if(!empty($d['path']) && $d['path'] !== 'profile.png') Open @endif
@if(empty($d['path']) || $d['path'] === 'profile.png')
No file uploaded.
@else @if($isPdf($d['path'])) @else @endif @endif
@endforeach

{{-- Light History --}}
{{-- Recent Overtime --}}
Recent Overtime
@forelse($employee->overtime as $ot)
{{ $ot->date ?? '—' }} • {{ $ot->hourse ?? '' }}h {{ number_format((float)$ot->amount,2) }}
@empty
No overtime records.
@endforelse
{{-- Recent Advance --}}
Recent Advance
@forelse($employee->advance as $ad)
{{ $ad->date ?? '—' }} • {{ $ad->title ?? 'Advance' }} {{ number_format((float)$ad->payment,2) }}
@empty
No advance records.
@endforelse
{{-- Recent Salary --}}
Recent Salary
@forelse($employee->salary as $sal)
{{ $sal->year ?? '' }}-{{ $sal->month ?? '' }} {{ number_format((float)$sal->net_salary,2) }}
@empty
No salary records.
@endforelse
{{-- card-body --}}
{{-- card --}}
{{-- Resign Modal --}} @endsection @section('pageJs') @endsection