@extends('layouts.app') @section('title', 'Personnel ' . $security->full_name) @section('content')

{{ $security->full_name }}

Print Edit Back
@csrf @method('DELETE')
Staff Photo
@if($security->staff_photo && file_exists(public_path($security->staff_photo))) Staff photo @else No photo uploaded @endif
Weapon Image
@if($security->weapon_image && file_exists(public_path($security->weapon_image))) Weapon image @else No weapon image uploaded @endif
QR Code
QR code

{{ $security->qrUrl() }}

Open Profile
Personnel Information
Full Name {{ $security->full_name }}
Phone Number {{ $security->phone_number ?? 'N/A' }}
Title {{ $security->title ?? 'N/A' }}
Branch {{ $security->branch?->name ?? 'N/A' }}
Site {{ $security->site?->name ?? 'N/A' }}
Region {{ $security->region ?? 'N/A' }}
ID-Card Information
National ID {{ $security->national_id ?? 'N/A' }}
ID Card Number {{ $security->id_card_number ?? 'N/A' }}
Issued Date {{ $security->id_card_issued_date?->format('d/m/Y') ?? 'N/A' }}
Expiry Date @if($security->id_card_expiry_date) {{ $security->id_card_expiry_date->format('d/m/Y') }} @if($security->id_card_expiry_date->isPast()) EXPIRED@endif @else N/A @endif
Weapon Information
Weapon Name {{ $security->weapon_name ?? 'N/A' }}
Weapon Model {{ $security->weapon_model ?? 'N/A' }}
Weapon Serial {{ $security->weapon_serial ?? 'N/A' }}
Leave Balance
Annual Entitlement
{{ $security->annualEntitlement() }}
days
Used
{{ $security->usedLeaveDays() }}
days
Remaining
{{ $security->remainingLeaveDays() }}
days
@php $byType = $security->leaveUsedByType(); @endphp @if($byType)
Used by Type
@foreach($byType as $type => $days) @endforeach
{{ str_replace('_', ' ', $type) }} {{ $days }} days
@endif
Leave History
@if($security->leaves->count())
@foreach($security->leaves->sortByDesc('start_date') as $leaf) @endforeach
Type Start End Days Status Decided By
{{ str_replace('_', ' ', $leaf->leave_type) }} {{ $leaf->start_date->format('d/m/Y') }} {{ $leaf->end_date->format('d/m/Y') }} {{ $leaf->days }} @if($leaf->status === 'approved') Approved @elseif($leaf->status === 'declined') Declined @else Pending @endif {{ $leaf->approver?->name ?? '-' }}
@else
No leave records yet.
@endif
@push('scripts') @endpush @endsection