@extends('layouts.app')

@section('content')
    <div class="container-fluid p-4">
        <div class="card shadow-sm p-3">
            <h4 class="fw-bold" style="color: #063986;">Tambah Booking</h4>
            <form action="{{ route('admin.storebooking') }}" method="POST">
                @csrf
                
                <div class="mb-3">
                    <label for="id_user" class="form-label">Nama Customer</label>
                    <select name="id_user" id="id_user" class="form-control" required>
                        <option value="">Pilih Customer</option>
                        @foreach($users as $user)
                            <option value="{{ $user->id_user }}">{{ $user->name }}</option>
                        @endforeach
                    </select>
                </div>

                <div class="mb-3">
                    <label for="id_kamar" class="form-label">Nomor Kamar</label>
                    <select name="id_kamar" id="id_kamar" class="form-control" required>
                        <option value="">Pilih Kamar</option>
                        @foreach($rooms as $room)
                            <option value="{{ $room->id_kamar }}">{{ $room->room_number }}</option>
                        @endforeach
                    </select>
                </div>

                <div class="mb-3">
                    <label for="tanggal_booking" class="form-label">Tanggal Booking</label>
                    <input type="date" name="tanggal_booking" id="tanggal_booking" class="form-control" required>
                </div>

                <div class="mb-3">
                    <label for="tanggal_checkin" class="form-label">Tanggal Check-in</label>
                    <input type="date" name="tanggal_checkin" id="tanggal_checkin" class="form-control" required>
                </div>

                <div class="mb-3">
                    <label for="tanggal_checkout" class="form-label">Tanggal Check-out</label>
                    <input type="date" name="tanggal_checkout" id="tanggal_checkout" class="form-control" required>
                </div>

                <div class="mb-3">
                    <label for="status_booking" class="form-label">Status</label>
                    <select name="status_booking" id="status_booking" class="form-control" required>
                        <option value="Pending">Pending</option>
                        <option value="Dikonfirmasi">Dikonfirmasi</option>
                        <option value="Dibatalkan">Dibatalkan</option>
                    </select>
                </div>

                <div class="d-flex justify-content-between">
                    <a href="{{ route('admin.booking') }}" class="btn btn-secondary">Batal</a>
                    <button type="submit" class="btn text-white" style="background: linear-gradient(135deg, #8AC0DF, #48499B);">Simpan</button>
                </div>
            </form>
        </div>
    </div>
@endsection
