@extends('layouts.template.main') @section('content')
Danh sách OT
@if(auth()->user()->hasRole('admin') || auth()->user()->hasRole('hr')) @endif
@if (session('success')) @endif
@php $currentSort = request('sort', 'date'); $currentOrder = request('order', 'desc'); $nextOrder = $currentOrder == 'asc' ? 'desc' : 'asc'; @endphp @forelse($overtimes as $overtime) @empty @endforelse
Nhân viên @if($currentSort == 'name') @else @endif Ngày OT @if($currentSort == 'date') @else @endif Thời gian bắt đầu Thời gian kết thúc Số giờ OT Ghi chú Trạng thái Người chấp thuận Thao tác
{{ $overtime?->employee?->name }} {{ \Carbon\Carbon::parse($overtime->date)->format('d/m/Y') }} {{ $overtime->ot_start ? \Carbon\Carbon::parse($overtime->ot_start)->format('H:i') : '' }} {{ $overtime->ot_end ? \Carbon\Carbon::parse($overtime->ot_end)->format('H:i') : '' }} {{ number_format($overtime->hours, 1) }} {{ $overtime->note }} @php $badgeClass = 'bg-warning text-dark'; if($overtime->status == 'Approved' || $overtime->status == 'approved') $badgeClass = 'bg-success'; if($overtime->status == 'Rejected' || $overtime->status == 'rejected') $badgeClass = 'bg-danger'; @endphp {{ ucfirst($overtime->status) }} {{ $overtime?->approvedBy?->name }} @if (strtolower($overtime->status) === 'pending') @else @endif @if (auth()->user()->hasRole('admin'))
@csrf @method('DELETE')
@endif
Chưa có dữ liệu OT nào được tìm thấy
{{ $overtimes->links('pagination::bootstrap-5') }}
@push('scripts') @endpush @endsection