@extends('layouts.app')

@section('content')
<!-- Background seluruh halaman -->
<div style="background-color: #e0e0e0; width: 100%; min-height: 100vh; border-radius: 15px; padding: 1rem;">

    <!-- Header -->
    <div style="background-color: #000; color: #fff; padding: 0.1rem; border-radius: 0.5rem;">
        <h1 class="m-0">Edit Jadwal Harian</h1>
    </div>

    <!-- Konten utama -->
    <div class="container mt-4">
        <div class="card p-4 border border-secondary" style="border-radius: 15px; background-color: #fff;">
            <form action="{{ route('jadwalharian.update', $jadwal->id) }}" method="POST">
            @csrf
            @method('PUT')

            <div class="form-group">
                <label>Waktu</label>
                <select name="waktu" class="form-control" required>
                    <option value="Subuh" {{ $jadwal->waktu == 'Subuh' ? 'selected' : '' }}>Subuh</option>
                    <option value="Dzuhur" {{ $jadwal->waktu == 'Dzuhur' ? 'selected' : '' }}>Dzuhur</option>
                    <option value="Ashar" {{ $jadwal->waktu == 'Ashar' ? 'selected' : '' }}>Ashar</option>
                    <option value="Maghrib" {{ $jadwal->waktu == 'Maghrib' ? 'selected' : '' }}>Maghrib</option>
                    <option value="Isya" {{ $jadwal->waktu == 'Isya' ? 'selected' : '' }}>Isya</option>
                </select>
            </div>

            <div class="form-group">
                <label>Imam</label>
                <input type="text" name="imam" class="form-control" value="{{ $jadwal->imam }}" required>
            </div>

            <div class="form-group">
                <label>Muadzin</label>
                <input type="text" name="muadzin" class="form-control" value="{{ $jadwal->muadzin }}" required>
            </div>

            <button type="submit" class="btn btn-success">Update</button>
            <a href="{{ route('jadwalharian.index') }}" class="btn btn-secondary">Kembali</a>
            </form>
        </div>
    </div>
</div>
@endsection
