Jadwal Shift Kasir

{{-- CONTAINER UNTUK TOAST NOTIFICATION VALIDASI JS --}}
{{-- ALERT SUCCESS SUBMIT PHP BEBAS REFRESH --}} @if (session('success')) @endif
{{-- NAVIGASI BULAN --}}

{{ $date->translatedFormat('Y') }}

@csrf {{-- PEMETAAN WARNA KASIR --}} @php $colorPalettes = [ ['bg' => 'bg-blue-100', 'badge' => 'bg-blue-500', 'text' => 'text-white'], ['bg' => 'bg-emerald-100', 'badge' => 'bg-emerald-500', 'text' => 'text-white'], ['bg' => 'bg-amber-100', 'badge' => 'bg-amber-500', 'text' => 'text-white'], ['bg' => 'bg-purple-100', 'badge' => 'bg-purple-500', 'text' => 'text-white'], ['bg' => 'bg-rose-100', 'badge' => 'bg-rose-500', 'text' => 'text-white'], ['bg' => 'bg-cyan-100', 'badge' => 'bg-cyan-500', 'text' => 'text-white'], ['bg' => 'bg-indigo-100', 'badge' => 'bg-indigo-500', 'text' => 'text-white'], ['bg' => 'bg-fuchsia-100', 'badge' => 'bg-fuchsia-500', 'text' => 'text-white'], ]; $userColors = []; $colorIndex = 0; foreach ($kasirs as $kasir) { $userColors[$kasir->id] = $colorPalettes[$colorIndex % count($colorPalettes)]; $colorIndex++; } @endphp {{-- TOP CONTROLS: PILIH KASIR & LEGENDA WARNA --}}
{{-- Input Pilih Kasir --}}
{{-- Legenda Warna --}}
Mark: @foreach ($kasirs as $kasir) @php $c = $userColors[$kasir->id]; @endphp
{{ $kasir->name }}
@endforeach
{{-- GRID KALENDER --}}
{{-- HEADER HARI --}}
@foreach (['Min', 'Sen', 'Sel', 'Rab', 'Kam', 'Jum', 'Sab'] as $day)
{{ $day }}
@endforeach
{{-- TANGGAL --}}
@foreach ($period as $day) @php $tanggal = $day->format('Y-m-d'); $shift = $shifts[$tanggal] ?? null; $inMonth = $day->month === $date->month; $isToday = $tanggal === now()->format('Y-m-d'); $isPast = $tanggal < now()->format('Y-m-d'); // Default Colors $cellBg = $inMonth ? 'bg-white' : 'bg-gray-50/50 text-gray-400'; $badgeBg = ''; $badgeText = ''; if ($shift) { $shiftColor = $userColors[$shift->user->id] ?? [ 'bg' => 'bg-gray-200', 'badge' => 'bg-gray-500', 'text' => 'text-white', ]; $cellBg = $shiftColor['bg']; $badgeBg = $shiftColor['badge']; $badgeText = $shiftColor['text']; } // Modifikasi Past Day $pastClasses = ''; if ($isPast) { $pastClasses = 'opacity-50 pointer-events-none disabled-cell'; if (!$shift) { $cellBg = 'bg-gray-100'; } else { $pastClasses .= ' grayscale'; } } @endphp
@if ($isToday) @endif {{ $day->day }} @if ($shift)
{{ $shift->user->name }}
@endif
@endforeach

Klik kotak pada kalender (hari yang belum lewat) untuk menandai jadwal, lalu klik "Simpan Jadwal Shift".

{{-- INPUT SHIFT --}}
{{-- TOMBOL SUBMIT --}}
{{-- STYLE SELECTED MENGGUNAKAN WARNA PRIMARY --}}