@extends('layouts.app')
@section('content')
    <div class="panel panel-primary">
        <div class="panel-heading">Vytvořte pokoj ve Vašem ubytování</div>
        <div class="panel-body">
            @if ($accommodation != null)

                {{ Form::open(['route' => 'storeRoom', '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', null,  ['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', null,  ['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', null,  ['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-lg-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">Titulní obrázek</label>
                    <div class="col-md-6">

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

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

                {{ Form::close() }}
            @else
                <div class="panel-warning">Nemáš vytvořeno ubytování. Pokoje můžeš vytvářet až po vytvoření ubytování</div>
            @endif
        </div>
    </div>
@endsection
