HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/farmfun.komma.pro/resources/views/kms/section/planning.blade.php
@extends('kms.layouts.kms')

@section('content')

    <section class="c-planning">

        <div class="c-planning__popup  js-popup  is-hidden">

            @foreach($reservationItems as $reservationItem)
                @if(!isset($reservationItem->product->translation))
                    @php
                        $reservationItem->product->setRelation('translation',$reservationItem->product->translations()->withTrashed()->first());
                    @endphp
                @endif
                <div class="c-planning__popup-content  js-popup-content  @if(!$loop->first) is-hidden  @endif"
                     data-id="{{ $reservationItem->id }}">

                    <h3>#{{ $reservationItem->reservation->reservation_number }}</h3>
                    <p>
                        {{ $reservationItem->product->translation->name ?? $reservationItem->product->id }}<br/>
                        @if(isset($reservationItem->quantity) && $reservationItem->quantity > 1)
                            {{ $reservationItem->quantity }} personen<br/>
                        @endif
                        @if(isset($reservationItem->start_time) && isset($reservationItem->end_time))
                            {{ $reservationItem->start_time }} - {{ $reservationItem->end_time }}
                        @endif
                        @if(!empty($reservationItem->remarks))
                            <br/><br/>
                            <i>Opmerking:</i><br/>
                            {!! nl2br($reservationItem->remarks) !!}
                        @endif
                    </p>
                </div>
            @endforeach

        </div>

        <div class="c-planning__heading">
            <h1 class="c-planning__title">Planning: {{ $location->city }}</h1>
            <div>
                <a href="{{ route('calendarnotes.create', ['location' => $location->id]) }}" type="button" class="c-planning__block-out-button  js-open-modal">Voeg een opmerking toe</a>
                <a href="{{ route('calendarblockouts.create', ['location' => $location->id]) }}" type="button" class="c-planning__block-out-button  js-open-modal">Voeg een blokkering toe</a>
            </div>
        </div>

        <div class="c-reservation-items__calendar  c-full-calendar">

            <div class="c-calendar  js-full-calendar" data-start="{{ \App\Komma\Reservations\Kms\ReservationService::getStartRange()->format('Y-m-d') }}">
{{--                <div class="c-calendar__nav"></div>--}}
                <data hidden>
                    @foreach($reservationItems as $reservationItem)
                        @if(!isset($reservationItem->product->translation))
                            @php
                                $reservationItem->product->setRelation('translation',$reservationItem->product->translations()->withTrashed()->first());
                            @endphp
                        @endif
                            @php
                                $start = \Carbon\Carbon::create($reservationItem->date . " " . $reservationItem->start_time)->toDateTimeLocalString();
                                $end = \Carbon\Carbon::create($reservationItem->date . " " . $reservationItem->end_time)->toDateTimeLocalString();
                            @endphp
                        <div class="js-reservation-event"
                             data-id="{{ $reservationItem->id }}"
                             data-order-id="{{ $reservationItem->reservation->id }}"
                             data-url="{{ route('reservations.show', ['reservation' => $reservationItem->reservation->id]) }}"
                             data-name="#{{ $reservationItem->reservation->reservation_number }} - {{ $reservationItem->product->translation->name ?? $reservationItem->product->id }}"
                             data-start="{{ $start }}" data-end="{{ $end }}"></div>
                    @endforeach
                    @foreach($blockOutItems as $blockOutItem)
                        <div class="js-block-out"
                             data-id="{{ $blockOutItem->id }}"
                             data-url="{{ route('calendarblockouts.show', ['calendarblockout' => $blockOutItem->id]) }}"
                             data-all-day="{{ $blockOutItem->all_day }}"
                             @if(auth()->user()->isAtLeast(\App\Komma\Users\Models\KmsUserRole::Admin))
                                data-name="{{ $blockOutItem->location->city  }} - {{ isset($blockOutItem->product) ? $blockOutItem->product->translation->name ?? $reservationItem->product->id .' geblokkeerd' : 'Sluiting' }}"
                             @else
                                data-name="{{ isset($blockOutItem->product) ? $blockOutItem->product->translation->name ?? $reservationItem->product->id .' geblokkeerd' : 'Sluiting' }}"
                             @endif
                             data-start="{{ $blockOutItem->start_date->format('Y-m-d') }}T{{ $blockOutItem->start_date->format('H:i:s') }}"
                             data-end="{{ $blockOutItem->end_date->format('Y-m-d') }}T{{ $blockOutItem->end_date->format('H:i:s') }}"></div>
                    @endforeach
                    @foreach($calendarNotes as $calendarNote)
                        <div class="js-calendar-note"
                             data-id="{{ $calendarNote->id }}"
                             data-url="{{ route('calendarnotes.show', ['calendarnote' => $calendarNote->id]) }}"
                             data-all-day="{{ $calendarNote->all_day }}"
                             data-name="Note: {{ $calendarNote->name }}"
                             data-start="{{ $calendarNote->start_date->format('Y-m-d') }}T{{ $calendarNote->start_date->format('H:i:s') }}"
                             data-end="{{ $calendarNote->end_date->format('Y-m-d') }}T{{ $calendarNote->end_date->format('H:i:s') }}"></div>
                    @endforeach
                    @for($i = 0; $i < 7; $i++)
                            <div class="js-location-availability"
                                 data-url="{{ route('locations.show', ['location' => $location->id]) }}#Beschikbaarheid"
                                 data-day-of-week="{{ $i }}"
                                 data-all-day="{{ !$location->availability->{'day_'.$i.'_open'} ? '1' : '0' }}"
                                 data-start="{{ $location->availability->{'day_'.$i.'_from'} }}"
                                 data-end="{{ $location->availability->{'day_'.$i.'_till'} }}"></div>
                    @endfor


{{--                    @foreach($reservedItems as $reservedItem)--}}
{{--                        <div class="js-reserved-event" data-id="{{ $reservedItem->id }}" data-name="#{{ $reservedItem->reservation_id }} - {{ $reservedItem->product->translation->name }}" data-start="{{ $reservedItem->date }}T{{ $reservedItem->start_time }}" data-end="{{ $reservedItem->date }}T{{ $reservedItem->end_time }}"></div>--}}
{{--                    @endforeach--}}
                </data>
            </div>

        </div>


    </section>
@endsection