@extends('layouts.app') @section('title', 'لوحة التحكم - DOTS HR Pro') @push('styles') @endpush @section('content') {{-- Welcome --}}

مرحباً، {{ auth()->user()->name }} 👋

لوحة تحكم الموارد البشرية — نظرة شاملة على أداء مؤسستك

{{ now()->translatedFormat('l j F Y') }}
{{-- Stat Cards --}}
+{{ $stats['new_employees'] ?? 0 }}
{{ number_format($stats['total_employees']) }}
إجمالي الموظفين
اليوم
{{ number_format($stats['present_today']) }}
حاضرون اليوم
إجازة
{{ number_format($stats['on_leave']) }}
في إجازة
@if($stats['pending_requests'] > 0) بانتظار @else لا يوجد @endif
{{ number_format($stats['pending_requests']) }}
طلبات معلقة
{{-- Alerts --}} @if($alerts['expiring_contracts'] > 0 || $alerts['expiring_residencies'] > 0 || $alerts['pending_leaves'] > 0)
@if($alerts['expiring_contracts'] > 0)
{{ $alerts['expiring_contracts'] }} عقود تنتهي خلال 30 يومعرض
@endif @if($alerts['expiring_residencies'] > 0)
{{ $alerts['expiring_residencies'] }} إقامات تنتهي خلال 30 يومعرض
@endif @if($alerts['pending_leaves'] > 0)
{{ $alerts['pending_leaves'] }} طلبات إجازة بانتظار الموافقةعرض
@endif
@endif {{-- Charts --}}

إحصائيات الحضور

توزيع الموظفين

{{-- Pending Approvals --}} @if(isset($pendingApprovals))

الموافقات المعلقة

@if($pendingApprovals->count() > 0) {{ $pendingApprovals->count() }} @endif
@forelse($pendingApprovals as $approval) @php $apColor = $approval->leaveType->color ?? '#6b7280'; $empName = $approval->employee->full_name ?? ($approval->employee->first_name ?? 'موظف'); $daysCount = $approval->start_date && $approval->end_date ? $approval->start_date->diffInDays($approval->end_date) + 1 : ($approval->days_count ?? 1); @endphp
{{ mb_substr($approval->employee->first_name ?? '?', 0, 1) }}
{{ $empName }}
{{ $approval->leaveType->name_ar ?? 'إجازة' }} {{ $daysCount }} يوم • {{ $approval->start_date ? $approval->start_date->format('m/d') : '' }}{{ $approval->end_date ? ' — ' . $approval->end_date->format('m/d') : '' }}
@csrf
@csrf
@empty
لا توجد طلبات معلقة

جميع الطلبات تمت مراجعتها

@endforelse
@endif {{-- Bottom Grid --}}
{{-- Departments --}}

الأقسام

{{ $departmentStats->count() }} قسم
@php $dColors = ['#1B2A4A','#2E6BA4','#E8502F','#0ead69','#f5a623','#7c5cfc','#4e8cff','#17c1bc','#e85386','#E8A838']; @endphp @foreach($departmentStats as $i => $dept)
{{ $dept->name }} {{ $dept->employees_count }} موظف
@endforeach @if($departmentStats->isEmpty())
لا توجد أقسام
@endif
{{-- Leave Requests --}}

آخر طلبات الإجازات

عرض الكل
@forelse($recentRequests as $req)
{{ mb_substr($req->employee->first_name ?? '?', 0, 1) }}
{{ $req->employee->full_name ?? 'غير محدد' }}
{{ $req->leaveType->name_ar ?? 'إجازة' }} • {{ $req->days_count ?? 1 }} يوم
@switch($req->status) @case('pending') معلق @break @case('approved') موافق @break @case('rejected') مرفوض @break @default {{ $req->status }} @endswitch
@empty
لا توجد طلبات إجازات
@endforelse
{{-- Quick Actions --}}

إجراءات سريعة

@if($alerts['birthdays'] > 0)

أعياد ميلاد قادمة

{{ $alerts['birthdays'] }} موظف لديهم أعياد ميلاد خلال الأسبوع القادم
@endif @endsection @push('scripts') @endpush