@extends('layouts.app')
@section('content')
    <div class="panel panel-primary">
        <div class="panel-heading">Upravte pokoj ve Vašem ubytování</div>
        <div class="panel-body">
            {{ Form::open(['route' => 'editRoom', 'class' => 'form-horizontal', 'files' => true, 'enctype'=>'multipart/form-data']) }}

            <div class="form-group{{ $errors->has('room_name') ? ' has-error' : '' }}">
                <label class="col-md-4 control-label">Název pokoje</label>
                <div class="col-md-6">
                    {{ Form::text('room_name', $room->room_name,  ['class' => 'form-control']) }} @if ($errors->has('room_name'))
                        <span class="help-block">
                            <strong>{{ $errors->first('room_name') }}</strong>
                        </span>
                    @endif
                </div>
            </div>

            <div class="form-group{{ $errors->has('beds') ? ' has-error' : '' }}">
                <label class="col-md-4 control-label">Počet lůžek</label>
                <div class="col-md-6">
                    {{ Form::text('beds', $room->beds, ['class' => 'form-control']) }}  @if ($errors->has('beds'))
                        <span class="help-block">
                            <strong>{{ $errors->first('beds') }}</strong>
                        </span>
                    @endif
                </div>
            </div>

            <div class="form-group{{ $errors->has('price') ? ' has-error' : '' }}">
                <label class="col-md-4 control-label">Cena za lůžko a noc [Kč]</label>
                <div class="col-md-6">
                    {{ Form::text('price', $room->price,  ['class' => 'form-control']) }}  @if ($errors->has('price'))
                        <span class="help-block">
                            <strong>{{ $errors->first('price') }}</strong>
                        </span>
                    @endif
                </div>
            </div>


            <div class="form-group">
                <label class="col-md-4 control-label">Typ ubytování</label>
                <div class="col-md-6">
                    {{ Form::select('select', ['pokoj' => 'pokoj', 'apartman' => 'apartmán'],  null, ['class' => 'form-control' ]) }}
                </div>
            </div>

            <div class="form-group{{ $errors->has('image') ? ' has-error' : '' }}">
                <label class="col-md-4 control-label">Změnit současný titulní obrázek</label>
                <div class="col-md-6">

                    {!! Form::file('image', ['enctype' => 'multipart/form-data', 'class' => 'form-control']) !!}
                    Odebrat obrázek: {{Form::checkbox('delete_img')}}@if ($errors->has('image'))
                        <span class="help-block">
                            <strong>{{ $errors->first('image') }}</strong>
                        </span>
                    @endif
                </div>
            </div>

            {{ Form::hidden('room_id', $room->room_id) }}

            <div class="form-group">
                <div class="col-md-6 col-md-offset-4">
                    {{ Form::submit('Upravit pokoj', array('class'=>'btn btn-primary')) }}
                </div>
            </div>

            {{ Form::close() }}
        </div>
    </div>
@endsection
