@extends('layouts.app')
@section('content')
    <div class="panel panel-primary">
        <div class="panel-heading">Správa pokojů ve Vašem ubytování
            <a href="new_room">
                <button type="button" class="btn right_btn float_right">Vytvořit pokoj</button>
            </a>
        </div>

        <div class="panel-body">
            @include('flash::message')
            <div class="table-responsive">
                <table class="table">
                    <tr>
                        <th>Název pokoje</th>
                        <th>Počet lůžek</th>
                        <th>Cena</th>
                        <th>Typ</th>
                        <th>Upravit</th>
                        <th>Odstranit</th>
                    </tr>
                    @foreach($rooms as $room)
                        <tr>
                            <td>
                                {{$room->room_name}}
                            </td>
                            <td>
                                {{$room->beds}}
                            </td>
                            <td>
                                {{$room->price}}
                            </td>
                            <td>
                                {{$room->room_type}}
                            </td>
                            <td>{{ Form::open(array('method'=>'post', 'route' => array('showEditRoom', $room->room_id))) }}
                                {{ Form::submit('Upravit', array('class'=>'btn btn-primary')) }}
                                {{ Form::close() }}
                            </td>

                            <td>{{ Form::open(['route' => 'deleteRoom', 'class' => 'form-horizontal']) }}
                                {{ Form::hidden('room_id', $room->room_id) }}
                                {{ Form::submit('Odstranit', array('class'=>'btn btn-primary')) }}
                                {{ Form::close() }}
                            </td>
                        </tr>
                    @endforeach
                </table>
            </div>
        </div>
    </div>
@endsection
