{{-- Page Header --}}
{{-- Statistics Overview Cards --}}
{{-- Filters Card --}}
{{-- Work Rules Table --}}
{{-- Pagination --}}
@if($workRules->hasPages())
@endif
Employee Work Rules & Shifts
Configure and manage shift schedules for all staff members
TOTAL RULES
{{ $stats['total'] ?? 0 }}
ACTIVE RULES
{{ $stats['active'] ?? 0 }}
MORNING SHIFT
{{ $stats['morning'] ?? 0 }}
DAY SHIFT
{{ $stats['day'] ?? 0 }}
| Primary ID | Secondary ID | Employee Details | Shift | Weekly Schedule & Timings | Weekly Hours | Grace | Status | Actions |
|---|---|---|---|---|---|---|---|---|
| {{ $primaryId }} | {{-- Secondary ID --}}{{ $secondaryId }} | {{-- Employee Details --}}
{{ $emp->name ?? 'Unknown' }}
{{ $post }}
|
{{-- Shift with High-Contrast Solid Badge --}}
{{ $shiftName }} | {{-- Weekly Schedule --}}
@php
$dayNames = [6 => 'Sat', 0 => 'Sun', 1 => 'Mon', 2 => 'Tue', 3 => 'Wed', 4 => 'Thu', 5 => 'Fri'];
$schedules = $rule->weeklySchedules->keyBy('day_of_week');
@endphp
@foreach($dayNames as $dayNum => $dayLabel)
@php
$sch = $schedules[$dayNum] ?? null;
@endphp
@if($sch && $sch->is_off)
{{ $dayLabel }}: Off
@elseif($sch && $sch->start_time && $sch->end_time)
{{ $dayLabel }}: {{ \Carbon\Carbon::parse($sch->start_time)->format('H:i') }}-{{ \Carbon\Carbon::parse($sch->end_time)->format('H:i') }}
@endif
@endforeach
|
{{-- Weekly Hours --}}
{{ $hoursStr }} | {{-- Grace Time --}}{{ $rule->grace_minutes }}m | {{-- Status Toggle --}}{{-- Actions --}} | |
| No employee work rules found matching the criteria. | ||||||||