@extends('layouts.app') @section('content')

เลื่อนชั้น/จัดห้องปีใหม่

เลือกปี/เทอมต้นทางและปลายทาง ตรวจรายชื่อ แล้วจัดห้องปลายทางก่อนบันทึก

@if (session('status'))
{{ session('status') }}
@endif @if ($errors->any())
{{ $errors->first() }}
@endif
@if ($sourceYear && $targetYear && $sourceYear->id === $targetYear->id)
กรุณาเลือกปี/เทอมต้นทางและปลายทางคนละรายการ
@endif @if ($summary)
{{ $summary['students'] }}นักเรียนต้นทาง
{{ $summary['suggested'] }}มีห้องแนะนำ
{{ $summary['graduated'] }}จบการศึกษา
@if ($targetClassrooms->isEmpty())
ยังไม่มีห้องเรียนในปี/เทอมปลายทาง กรุณาเพิ่มห้องเรียนก่อนจัดห้อง
@endif
@csrf
@php $currentSource = null; @endphp @forelse ($rows as $index => $row) @php $source = $row['source_classroom']; $student = $row['student']; $sourceKey = $source->id; @endphp @if ($currentSource !== $sourceKey) @php $currentSource = $sourceKey; @endphp @endif @empty @endforelse
เลขที่ นักเรียน ห้องเดิม ห้องปลายทาง เลขที่ใหม่
{{ $source->name }} | {{ $source->students->count() }} คน
{{ $row['student_number'] ?? '-' }} {{ $student->full_name }}
{{ $student->student_code }}
{{ $source->name }}
ไม่พบนักเรียนในปี/เทอมต้นทาง
@if ($rows->isNotEmpty())
@endif
@else
เริ่มจากเลือกปี/เทอม

ถ้ายังไม่มีปี/เทอมปลายทางหรือห้องปลายทาง ให้สร้างจากเมนูปีการศึกษาและห้องเรียนก่อน

@endif @endsection