@extends('layouts.app') @section('title', 'Atur Jadwal - ' . $kelas->class_name) @section('content') @php $days = App\Models\ClassDaySchedule::DAYS; $maxJp = max(array_values($jpByDay) ?: [8]); $cellMap = []; foreach ($existing as $row) { for ($jp = $row->start_jp; $jp <= $row->end_jp; $jp++) { $cellMap[$row->day_name][$jp] = $row->subject_id; } } $oldInput = old('schedules', []); $hasOld = is_array($oldInput) && count($oldInput) > 0; @endphp
Kembali ke Roster

Jadwal Mingguan · {{ $kelas->class_name }}

Pilih mapel tiap slot. Mapel berurutan akan otomatis digabung menjadi satu blok (mis. jam 1–2).

@if ($subjectOptions->count() === 0)
Belum ada mapel yang diplot untuk kelas ini. Plot mapel + gurunya lewat Guru & Tugas dulu, lalu kembali ke sini.
@else
@csrf
@foreach ($days as $day) @if (($jpByDay[$day] ?? 0) > 0) @endif @endforeach @for ($jp = 1; $jp <= $maxJp; $jp++) @foreach ($days as $day) @if (($jpByDay[$day] ?? 0) > 0) @php $selected = $hasOld ? ($oldInput[$day][(string) $jp] ?? '') : ($cellMap[$day][$jp] ?? ''); @endphp @endif @endforeach @endfor
Jam {{ ucfirst($day) }} {{ $jpByDay[$day] }} JP
Jam {{ $jp }}

Sel bernomor merah = guru bentrok di jam yang sama.

@endif @endsection @section('scripts') @if ($subjectOptions->count() > 0) @endif @endsection