@extends('layouts.app') @section('title', 'Personel Dashboard') @section('content') @php $employee = auth()->user()->employee; $currentYear = now()->year; $usedLeaves = $employee->leaves()->whereYear('start_date', $currentYear)->where('status', 'approved')->sum('days'); $pendingLeaves = $employee->leaves()->where('status', 'pending')->sum('days'); $totalAllowedLeaves = 20; // Bu değer leave_types tablosundan hesaplanabilir $remainingLeaves = $totalAllowedLeaves - $usedLeaves; @endphp
{{ $remainingLeaves }}
Kalan İzin Hakkı
{{ $usedLeaves }}
Kullanılan İzin
{{ $pendingLeaves }}
Bekleyen İzin
{{ $employee->attendances()->whereMonth('date', now()->month)->where('status', 'present')->count() }}
Bu Ay Mesai
İzin Başvurularım
Tümünü Gör
@php $myLeaves = $employee->leaves()->with('leaveType')->orderBy('created_at', 'desc')->limit(5)->get(); @endphp @if($myLeaves->count() > 0)
@foreach($myLeaves as $leave) @endforeach
İzin Türü Tarih Süre Durum İşlemler
{{ $leave->leaveType->name }}
{{ $leave->start_date->format('d.m.Y') }} - {{ $leave->end_date->format('d.m.Y') }}
{{ $leave->start_date->diffInDays($leave->end_date) + 1 }} gün @if($leave->status === 'pending') Bekliyor @elseif($leave->status === 'approved') Onaylandı @elseif($leave->status === 'rejected') Reddedildi @elseif($leave->status === 'cancelled') İptal @endif
@if($leave->status === 'pending')
@csrf @method('DELETE')
@endif
@else

Henüz izin başvurusu yapmamışsınız.

İzin Başvurusu Yap
@endif
Kişisel Bilgilerim
{{ $employee->user->name }}

{{ $employee->position }}


Departman
{{ $employee->department ? $employee->department->name : 'Belirtilmemiş' }}
İşe Giriş
{{ $employee->hire_date ? $employee->hire_date->format('d.m.Y') : 'Belirtilmemiş' }}
Telefon
{{ $employee->phone ?? 'Belirtilmemiş' }}
E-posta
{{ $employee->user->email }}

Son Mesai Kayıtlarım
Tümünü Gör
@php $recentAttendance = $employee->attendances()->orderBy('date', 'desc')->limit(7)->get(); @endphp @if($recentAttendance->count() > 0)
@foreach($recentAttendance as $attendance) @endforeach
Tarih Giriş Çıkış Çalışma Süresi Durum
{{ $attendance->date->format('d.m.Y') }}
{{ $attendance->date->format('l') }}
@if($attendance->check_in) {{ $attendance->check_in->format('H:i') }} @else - @endif @if($attendance->check_out) {{ $attendance->check_out->format('H:i') }} @else - @endif @if($attendance->check_in && $attendance->check_out) @php $workHours = $attendance->check_out->diffInHours($attendance->check_in); $workMinutes = $attendance->check_out->diffInMinutes($attendance->check_in) % 60; @endphp {{ $workHours }}:{{ str_pad($workMinutes, 2, '0', STR_PAD_LEFT) }} @else - @endif @if($attendance->status === 'present') Mevcut @elseif($attendance->status === 'absent') Yok @elseif($attendance->status === 'late') Geç @elseif($attendance->status === 'half_day') Yarım Gün @endif
@else

Henüz mesai kaydı bulunmuyor.

@endif
@endsection