@extends('layouts.app')
@section('content')
    {{--
        Zdroj placeholderu:
        Harbour Point Restaurant. Street Myanmar [online]. [cit. 2017-05-12]. Dostupné z: http://streetmyanmar.com/detail/14
    --}}
    @include('flash::message')
    @foreach ($accommodations as $accommodation)
        <div class="row">
            <div class="panel panel-primary">
                <div class="panel-heading">
                    {{$accommodation->accommodation_name}}
                    @if($accommodation->rating != 0)
                        <span class="rating">
                            <a href="{{ url('reviews_list/' . $accommodation->accommodation_id) }}">
                                ({{$accommodation->rating}}
                                <span class="glyphicon glyphicon-star" aria-hidden="true">
                                </span>)
                            </a>
                        </span>
                    @endif

                    <div class="float_right">
                        <a href="{{ url('detail/' . $accommodation->accommodation_id) }}">
                            <div class="btn right_btn">Zobrazit detail</div>
                        </a>
                    </div>
                </div>
                <div class="panel-body">
                    <div class="panel-body">{{$accommodation->accommodation_description}}</div>
                    <div class="float_left col-md-8">
                        <table class="table col-md-7 float_left">
                        @if($rooms != null)
                                <tr>
                                    <td class="col-md-3"><b>Počet pokojů: </b></td>
                                    <td class="col-md-4 ">{{$rooms[$accommodation->accommodation_id]}}</td>
                                </tr>
                            @endif
                            @if($beds != null)
                                <tr>
                                    <td class="col-md-3"> <b>Počet lůžek: </b></td>
                                    <td class="col-md-4">{{$beds[$accommodation->accommodation_id]}}</td>
                                </tr>
                            @endif
                            @if($equipment != null)
                                <tr>
                                    <td class="col-md-3"><b>Vybavení:</b> </td>
                                    <td class="col-md-4 float_right">@foreach($equipment[$accommodation->accommodation_id] as $equip)
                                            <b> > </b> {{$equip->equipment_name}}
                                        @endforeach
                                    </td>
                                </tr>
                            @endif
                        </table>
                    </div>
                    <div class="float_right col-md-4">
                        @if($image[$accommodation->accommodation_id] != null)
                            <img alt="playground" class="float_right image_width" src="data:image/jpeg;base64,{{base64_encode($image[$accommodation->accommodation_id]->image)}}">
                        @else
                            <img alt="playground" class="float_right col-md-8" src="{{ asset('images/img_placeholder.png') }}">
                        @endif
                    </div>
                </div>
            </div>
        </div>
    @endforeach
@endsection
