@extends('layouts.backend') @section('content')
@php $canUpdateEmployee = auth()->user()?->hasPermission('employee.update') ?? false; $dateOfBirthDisplay = $employee->date_of_birth ? \Illuminate\Support\Carbon::parse($employee->date_of_birth)->format('m-d') : '-'; @endphp

{{ __('Employee Profile') }}

@if($canUpdateEmployee) {{ __('Edit') }} @endif
@if($employee->avatar_path) Employee Avatar @else @endif

{{ trim($employee->first_name.' '.$employee->last_name) }} ({{ $employee->employee_code }})

{{ __('Status:') }} {{ __(ucfirst(str_replace('_',' ', $employee->employment_status))) }}
{{ __('Type:') }} {{ __(ucfirst(str_replace('_',' ', $employee->employment_type))) }}
{{ __('Join Date:') }} {{ $employee->date_of_joining }}
{{ __('Department:') }} {{ $employee->department?->name ?? '-' }}
{{ __('Designation:') }} {{ $employee->designation?->name ?? '-' }}
{{ __('Manager:') }} {{ $employee->manager ? trim($employee->manager->first_name.' '.$employee->manager->last_name) : '-' }}
{{ __('Phone:') }} {{ $employee->phone ?: '-' }}
{{ __('Work Email:') }} {{ $employee->work_email ?: '-' }}
{{ __('Linked User:') }} {{ $employee->user?->email ?? '-' }}
{{ __('Date of Birth:') }} {{ $dateOfBirthDisplay }}
{{ __('Marital Status:') }} {{ $employee->marital_status ? __(ucfirst($employee->marital_status)) : '-' }}
{{ __('Marriage Date:') }} {{ $employee->marriage_date ?: '-' }}

{{ __('Addresses') }}
@forelse($employee->addresses as $address)
{{ __(ucfirst($address->address_type ?: 'Address')) }}{{ $address->is_primary ? ' ('.__('Primary').')' : '' }}: {{ collect([$address->line_1, $address->line_2, $address->city, $address->state, $address->postal_code, $address->country])->filter()->implode(', ') ?: '-' }}
@empty

{{ __('No addresses added.') }}

@endforelse
{{ __('Bank Accounts') }}
@forelse($employee->bankAccounts as $bank) @empty @endforelse
{{ __('Bank') }} {{ __('Branch') }} {{ __('Account Holder') }} {{ __('Account No') }} {{ __('Routing') }} {{ __('Type') }} {{ __('Salary Account') }} {{ __('Entry Date') }} {{ __('End Date') }}
{{ $bank->bank_name ?: '-' }}{{ $bank->is_primary ? ' ('.__('Primary').')' : '' }} {{ $bank->branch_name ?: '-' }} {{ $bank->account_holder_name ?: '-' }} {{ $bank->account_number ?: '-' }} {{ $bank->routing_number ?: '-' }} {{ $bank->account_type ?: '-' }} {{ $bank->is_salary_account ? __('Yes') : __('No') }} {{ $bank->salary_account_start_date ?: '-' }} {{ $bank->salary_account_end_date ?: '-' }}
{{ __('No bank accounts added.') }}
{{ __('Salary Account History') }}
@forelse($employee->salaryAccountHistories as $history) @empty @endforelse
{{ __('Bank') }} {{ __('Account Holder') }} {{ __('Account No') }} {{ __('Record Entry Date') }} {{ __('End Date') }} {{ __('Changed By') }}
{{ $history->bank_name ?: '-' }} {{ $history->account_holder_name ?: '-' }} {{ $history->account_number ?: '-' }} {{ $history->started_at ?: '-' }} {{ $history->ended_at ?: '-' }} {{ $history->changedBy?->name ?: '-' }}
{{ __('No salary account history added.') }}
{{ __('Emergency Contacts') }}
@forelse($employee->emergencyContacts as $contact) @empty @endforelse
{{ __('Name') }} {{ __('Relationship') }} {{ __('Phone') }} {{ __('Email') }} {{ __('Address') }}
{{ $contact->name ?: '-' }}{{ $contact->is_primary ? ' ('.__('Primary').')' : '' }} {{ $contact->relationship ?: '-' }} {{ $contact->phone ?: '-' }} {{ $contact->email ?: '-' }} {{ $contact->address ?: '-' }}
{{ __('No emergency contacts added.') }}
{{ __('Documents') }}
@forelse($employee->documents as $document) @php($documentHref = $document->file_path ? (filter_var($document->file_path, FILTER_VALIDATE_URL) ? $document->file_path : asset($document->file_path)) : null) @empty @endforelse
{{ __('Type') }} {{ __('Title') }} {{ __('File Path') }} {{ __('Issued') }} {{ __('Expiry') }}
{{ $document->document_type ?: '-' }} {{ $document->title ?: '-' }} @if($documentHref) {{ __('Open') }} @else - @endif {{ $document->issued_date ?: '-' }} {{ $document->expiry_date ?: '-' }}
{{ __('No documents added.') }}
@if($employee->subordinates->count() > 0)
{{ __('Subordinates') }}
    @foreach($employee->subordinates as $subordinate)
  • {{ trim($subordinate->first_name.' '.$subordinate->last_name) }} ({{ $subordinate->employee_code }})
  • @endforeach
@endif
@endsection