Xem tất cả chấm công
| Name @if($currentSort == 'name') @else @endif | Ngày @if($currentSort == 'date') @else @endif | Checked in | Checked out | Trạng thái | Giờ làm việc | Hành động | |
|---|---|---|---|---|---|---|---|
| {{ $attendance->employee->name ?? '' }} |
{{ $attendance->date ?? '' }}
@php
$key = "{$attendance->employee_id}_{$attendance->date}";
$dayLeaves = $leaveRequestsMap[$key] ?? [];
@endphp
@if(count($dayLeaves) > 0)
@php
$dayLeavesCol = collect($dayLeaves);
$hasPending = $dayLeavesCol->contains('status', 'Pending');
$hasApproved = $dayLeavesCol->contains('status', 'Approved');
$hasRejected = $dayLeavesCol->contains('status', 'Rejected');
if ($hasPending) {
$iconColor = 'text-warning';
$statusText = 'Có đơn đang chờ';
} elseif ($hasApproved) {
$iconColor = 'text-primary';
$statusText = 'Đã có đơn duyệt';
} else {
$iconColor = 'text-danger';
$statusText = 'Đơn bị từ chối';
}
@endphp
|
{{ $attendance->check_in_time ? \Carbon\Carbon::parse($attendance->check_in_time)->format('h:i A') : '' }} | {{ $attendance->check_out_time ? \Carbon\Carbon::parse($attendance->check_out_time)->format('h:i A') : '' }} |
@if(auth()->user()->hasRole('admin') || auth()->user()->hasRole('hr') || auth()->user()->hasRole('manager'))
@else
@if($attendance->status == 'Late')
Đi muộn
@elseif($attendance->status == 'EarlyLeave')
Về sớm
@elseif($attendance->status == 'Present')
Có mặt
@elseif($attendance->status == 'MissingPunch')
Quên chấm công
@else
{{ $attendance->status }}
@endif
@endif
@php
$key = "{$attendance->employee_id}_{$attendance->date}";
$dayLeaves = $leaveRequestsMap[$key] ?? [];
@endphp
@if(count($dayLeaves) > 0)
@php
$dayLeavesCol = collect($dayLeaves);
$hasPending = $dayLeavesCol->contains('status', 'Pending');
$hasApproved = $dayLeavesCol->contains('status', 'Approved');
if ($hasPending) {
$iconColor = 'text-warning';
$statusText = 'Có đơn đang chờ';
} elseif ($hasApproved) {
$iconColor = 'text-success';
$statusText = 'Có đơn đã duyệt';
} else {
$iconColor = 'text-danger';
$statusText = 'Đơn bị từ chối';
}
@endphp
|
@php $hours = floor($attendance->working_hours); $minutes = round(($attendance->working_hours - $hours) * 60); $parts = []; if ($hours > 0) { $parts[] = $hours . ' ' . ($hours === 1 ? 'hr' : 'hrs'); } if ($minutes > 0) { $parts[] = $minutes . ' ' . ($minutes === 1 ? 'min' : 'mins'); } $formattedTime = count($parts) ? implode(' ', $parts) : '0 min'; @endphp {{ $formattedTime }} | @if (auth()->user()->hasRole('manager') || auth()->user()->hasRole('employee'))@else | @endif |