@extends('layouts.app') @section('title', 'Staff Profile') @php $canManage = auth()->user()->isAdmin() || auth()->user()->isSupervisor(); @endphp @section('content')
{{-- LEFT: profile summary --}}
@if($staff->photoUrl()) photo @else
{{ strtoupper(substr($staff->name,0,1)) }}
@endif
{{ $staff->name }}

{{ $staff->designation ?? 'Worker' }} · {{ $staff->passport_no }}

{{ ucfirst($staff->status) }} @if($canManage) @endif

Running No#{{ $staff->running_no }}
Site / Project{{ $staff->site?->name ?? '—' }}
Department{{ $staff->department ?? '—' }}
Nationality{{ $staff->nationality?->name ?? '—' }}
Gender{{ ucfirst($staff->gender ?? '—') }}
Date Joined{{ optional($staff->date_of_join)->format('d M Y') ?? '—' }}
@if($staff->resign_date)
Resigned{{ $staff->resign_date->format('d M Y') }}
@endif

Payroll & Bank
Basic RateRM {{ number_format((float)$staff->basic_rate, 2) }} / {{ $staff->pay_basis }}
Bank{{ $staff->bank?->name ?? '—' }}
Account{{ $staff->account_number ?? '—' }}
{{-- RIGHT: tabbed sections --}}
@include('staff._renewal_tab', ['type'=>'passport','label'=>'Passport','col'=>'passport_expiry'])
@include('staff._renewal_tab', ['type'=>'permit','label'=>'Permit','col'=>'permit_expiry'])
@include('staff._renewal_tab', ['type'=>'fomema','label'=>'FOMEMA','col'=>'fomema_expiry'])
{{-- SITES --}}
Current Site
{{ $staff->site?->name ?? 'Unassigned' }}
{{ $staff->site?->client }}
@if($canManage)
Reassign Site
@csrf
@endif
Assignment History
@forelse($staff->siteAssignments as $a) @empty @endforelse
SiteFromToRemarksBy
{{ $a->site?->name ?? '—' }} {{ optional($a->assigned_on)->format('d/m/Y') ?? '—' }} @if($a->ended_on){{ $a->ended_on->format('d/m/Y') }}@elseCurrent@endif {{ $a->remarks ?? '—' }} {{ $a->creator?->name ?? '—' }}
No site assignment history yet.
{{-- DOCUMENTS --}}
@if($canManage)
Upload Document
@csrf
@endif
@forelse($staff->documents as $doc) @empty @endforelse
TitleTypeExpiryUploaded
{{ $doc->title }} {{ ucfirst($doc->type) }} {{ optional($doc->expiry_date)->format('d/m/y') ?? '—' }} {{ $doc->created_at->format('d/m/y') }} @if($canManage)
@csrf @method('DELETE')
@endif
No documents uploaded.
{{-- PAYSLIPS --}}
@forelse($staff->payslips as $p) @empty @endforelse
PeriodNett PayStatus
{{ $p->periodLabel() }} RM {{ number_format($p->nett_pay, 2) }} {{ ucfirst($p->status) }} @if(auth()->user()->isAdmin() || auth()->user()->isFinance())@endif @if($p->status==='finalized')@endif
No payslips yet.
@endsection