@extends('admin.layout') @section('style') @parent @endsection @section('title') Reservations @endsection @section('content_title') Reservations @endsection @section('main')
{!! $calendar->get_content_of_thead() !!} {!! $calendar->get_content_of_tbody() !!}

{!! $calendar->get_back_btn() !!} {{ $calendar->get_table_title() }} {!! $calendar->get_next_btn() !!}

@isset($reservations) @php $startTime = strtotime(env('opening_time')); //env or config working hours $endTime = strtotime(env('closing_time')); //env or config working hours $interval = 30 * 60; // 30分を秒に変換 $name = ''; $email = ''; $service = ''; @endphp @for ($time = $startTime; $time < $endTime; $time += $interval) @php $slotStartTime = date("H:i", $time); $slotEndTime = date("H:i", $time + $interval); $isReserved = false; // 予約チェック foreach ($reservations as $reservation) { $start = strtotime(date('H:i:s', strtotime($reservation->start))); $end = strtotime(date('H:i:s', strtotime($reservation->end))); if ($time >= $start && $time < $end) { $isReserved = true; $name = $reservation->name; $email = $reservation->email; $service = $reservation->service->name; break; } } @endphp @if ($isReserved) @else @endif @endfor

{{ Request::input('year') . '年' . Request::input('month') . '月' . Request::input('day') . '日' }}

開始時刻 空き状況
{{ $slotStartTime }}{{ $name . ' ' . $email . ' ' . $service }}
@endisset @endsection @section('script') @endsection