@extends('layouts.app') @section('title', $employee->full_name . ' - DOTS HR Pro') @section('content')
{{-- Profile Sidebar --}}
@if($employee->photo) {{ $employee->full_name }} @else {{ mb_substr($employee->first_name, 0, 1) }}{{ mb_substr($employee->last_name, 0, 1) }} @endif

{{ $employee->full_name }}

{{ $employee->jobTitle->name ?? '—' }}

@switch($employee->status) @case('active') نشط @break @case('on_leave') في إجازة @break @case('suspended') موقوف @break @case('terminated') منتهي @break @default {{ $employee->status }} @endswitch
{{ $employee->department->name ?? '—' }}
{{ $employee->email ?? '—' }}
{{ $employee->phone ?? '—' }}
تعيين: {{ $employee->hire_date ? $employee->hire_date->format('Y/m/d') : '—' }}
{{ $employee->nationality->name ?? '—' }}
@if($employee->manager)
{{ $employee->manager->full_name }}
@endif
إجمالي الراتب
{{ number_format($employee->total_salary, 2) }} {{ currency_label() }}
الأساسي{{ number_format($employee->basic_salary ?? 0, 2) }}
بدل السكن{{ number_format($employee->housing_allowance ?? 0, 2) }}
بدل النقل{{ number_format($employee->transport_allowance ?? 0, 2) }}
بدلات أخرى{{ number_format($employee->other_allowances ?? 0, 2) }}
{{-- Profile Content --}}
{{-- Tabs --}}
{{-- Personal Info Tab --}}
{{ $employee->full_name }}
{{ $employee->gender == 'male' ? 'ذكر' : 'أنثى' }}
{{ $employee->date_of_birth ? $employee->date_of_birth->format('Y/m/d') : '—' }}
@switch($employee->marital_status) @case('single') أعزب @break @case('married') متزوج @break @case('divorced') مطلق @break @case('widowed') أرمل @break @default — @endswitch
{{ $employee->religion ?? '—' }}
{{ $employee->address ?? '—' }}
@switch($employee->employment_type) @case('full_time') دوام كامل @break @case('part_time') دوام جزئي @break @case('contract') عقد مؤقت @break @case('remote') عن بُعد @break @default — @endswitch
{{ $employee->workShift->name ?? '—' }}
{{-- Financial Details --}}

البيانات البنكية

{{ $employee->bank_name ?? '—' }}
{{ $employee->bank_account ?? '—' }}
{{ $employee->iban ?? '—' }}
{{-- Documents Tab --}}
{{ $employee->national_id ?? '—' }}
{{ $employee->national_id_expiry ? $employee->national_id_expiry->format('Y/m/d') : '—' }}
{{ $employee->passport_number ?? '—' }}
{{ $employee->passport_expiry ? $employee->passport_expiry->format('Y/m/d') : '—' }}
{{ $employee->residency_expiry_date ? $employee->residency_expiry_date->format('Y/m/d') : '—' }}
{{ $employee->social_insurance_number ?? '—' }}
{{-- Contracts Tab --}}
@forelse($employee->contracts as $contract)
{{ $contract->contract_number }}
{{ $contract->start_date?->format('Y/m/d') }} — {{ $contract->end_date?->format('Y/m/d') ?? 'مفتوح' }} {{ $contract->status }}
@empty
لا توجد عقود
@endforelse
{{-- Attendance Tab --}}
@forelse($employee->attendances as $att) @empty @endforelse
التاريخالحضورالانصرافساعات العملالحالة
{{ $att->date->format('Y/m/d') }} {{ $att->check_in ? \Carbon\Carbon::parse($att->check_in)->format('H:i') : '—' }} {{ $att->check_out ? \Carbon\Carbon::parse($att->check_out)->format('H:i') : '—' }} {{ $att->worked_hours ?? '—' }} @switch($att->status) @case('present') حاضر @break @case('absent') غائب @break @case('late') متأخر @break @case('leave') إجازة @break @default {{ $att->status }} @endswitch
لا توجد سجلات حضور
{{-- Leaves Tab --}}
{{-- Leave Balances --}}

أرصدة الإجازات

{{ $employee->annual_leave_balance ?? 0 }}
سنوية متبقية
{{ $employee->sick_leave_balance ?? 0 }}
مرضية متبقية
{{ $employee->emergency_leave_balance ?? 0 }}
اضطرارية متبقية
@forelse($employee->leaveRequests as $lr) @php $leaveType = $lr->leaveType; $payType = $leaveType->pay_type ?? 'full'; $payPercentage = $leaveType->pay_percentage ?? 100; // Calculate deduction percentage if ($payType === 'full') { $deductionPercent = 0; } elseif ($payType === 'unpaid') { $deductionPercent = 100; } else { // partial — pay_percentage is what they GET paid, deduction is the rest $deductionPercent = 100 - $payPercentage; } // Calculate deducted amount (based on basic salary / 30 days × leave days × deduction%) $dailySalary = ($employee->basic_salary ?? 0) / 30; $deductedAmount = $dailySalary * ($lr->days_count ?? 0) * ($deductionPercent / 100); @endphp @empty @endforelse
النوعمنإلىالأيامنسبة الخصمالمبلغ المخصومالحالة
{{ $leaveType->name_ar ?? $leaveType->name ?? '—' }} {{ $lr->start_date ? $lr->start_date->format('Y/m/d') : '—' }} {{ $lr->end_date ? $lr->end_date->format('Y/m/d') : '—' }} {{ $lr->days_count }} @if($deductionPercent == 0) مدفوعة بالكامل @elseif($deductionPercent == 100) بدون أجر @else {{ $deductionPercent }}% @endif @if($deductedAmount > 0) {{ number_format($deductedAmount, 2) }} {{ currency_label() }} @else — @endif @switch($lr->status) @case('pending') معلق @break @case('approved') موافق @break @case('rejected') مرفوض @break @default {{ $lr->status }} @endswitch
لا توجد طلبات إجازات
{{-- Custom Fields Tab --}}
@if(isset($customFields) && $customFields->count()) @php $cfSections = $customFields->groupBy('section'); @endphp @foreach($cfSections as $section => $fields)

{{ \App\Models\CustomField::SECTION_LABELS[$section] ?? $section }}

@foreach($fields as $cf)
@php $cfVal = $employee->customFieldValues->firstWhere('custom_field_id', $cf->id); @endphp @if($cfVal && $cfVal->value) @if($cf->type === 'checkbox') {{ $cfVal->value ? '✓ نعم' : '✗ لا' }} @elseif($cf->type === 'url') {{ $cfVal->value }} @elseif($cf->type === 'email') {{ $cfVal->value }} @else {{ $cfVal->value }} @endif @else — @endif
@endforeach
@endforeach @else
لا توجد حقول مخصصة مفعّلة
@endif
@push('scripts') @endpush @endsection