<!-- resources/views/jadwal/create.blade.php -->

@extends('layouts/contentNavbarLayout')

@section('title', 'Edit Jadwal')

@section('content')
<!-- Your existing content goes here -->
<h4 class="fw-bold py-3 mb-4">
    <span class="text-muted fw-light">Edit Jadwal</span>
</h4>

<div class="card">
    <div class="card-header">
        Form Edit Data Jadwal
    </div>
    <div class="card-body">
        <form action="{{ route('jadwal.update', $jadwal->jadwal_id) }}" method="POST" enctype="multipart/form-data">
            @csrf
            <div class="mb-3">
                <label for="tutor_id" class="form-label">Tutor</label>
                <select id="tutor_id" class="select2 form-select" name="tutor_id">
                    <option value="" disabled selected>Select</option>
                    @foreach ($tutor as $data)
                        @if ($data->nama == $jadwal->nama)
                            <option value="{{$data->id}}" selected>{{$data->nama}}</option>
                        @else
                            <option value="{{$data->id}}">{{$data->nama}}</option>
                        @endif
                    @endforeach
                </select>
            </div>
            <div class="mb-3">
                <label for="kelas" class="form-label">Kelas</label>
                <select id="kelas" class="select2 form-select" name="kelas">
                    <option value="{{$jadwal->kelas}}" disabled selected>{{$jadwal->kelas}} (Select)</option>
                    <option value="Pre-Kids">Pre-Kids</option>
                    <option value="Beginner">Beginner</option>
                    <option value="Intermediate">Intermediate</option>
                </select>
            </div>
            <div class="mb-3">
                <label for="hari" class="form-label">Hari</label>
                <input type="text" class="form-control" id="hari" name="hari" value="{{$jadwal->hari}}">
            </div>
            <div class="mb-3">
                <label for="jam" class="form-label">Jam</label>
                <input type="time" class="form-control" id="jam" name="jam" value="{{$jadwal->jam}}">
            </div>
            <button type="submit" class="btn btn-primary">Submit</button>
        </form>
    </div>
</div>
@endsection