@extends('layouts.public-canvas')

@section('title')
    {{ __('modules')['home']['calendar'] }}
@endsection

@section('styles')
    <link href="{{ asset('css/components/tables/reservation-components.css') }}" rel="stylesheet">
    {{-- <link href="{{ asset('css/components/forms/reservation-form-modal.css') }}" rel="stylesheet"> --}}
    <link href="{{ asset('css/components/custom/harsiScrollBar.css') }}" rel="stylesheet">
    <link href="{{ asset('css/pages/particular/public-calendar.css') }}" rel="stylesheet">
@endsection

@section('php-controls')
    @php
      // Imports
        use \App\Models\Environment\Business;
        use \App\Models\User;

      // Data
        $user_reference_photo = User::where('id', 1)->value('profile_photo');

        $business = Business::select('business_name', 'features_configuration')->first();
        $system_features_helper = (object) $business->features_configuration;

        $has_pax_pricing = $system_features_helper->has_pax_pricing;
        $has_control_hours = $system_features_helper->has_control_hours;
        $has_express_reservations = $system_features_helper->has_express_reservations;
    @endphp
@endsection

@section('navbar')
    @include('shared.components.navbar.public-navbar', ['hotel_name' => $business->business_name, 'hotel_logo' => $user_reference_photo])
@endsection

@section('content')
  {{-- Calendar Structures --}}
    <div class="pt-2 mx-5 my-4">
        {{-- Tabs --}}
        @if ($has_express_reservations)
            <ul id="calendar-type-switch" role="tablist"
                class="mb-3 nav nav-tabs d-flex justify-content-start align-items-end g-1"
            >
                <li class="nav-item">
                    <h4 class="mb-0 rounded legend-titles nav-link disabled ">
                        {{ __('modules')['home']['calendar'] }}:
                    </h4>
                </li>

                <li class="w-20 nav-item active" role="presentation">
                    <button id="normal-calendar-tab" type="button" role="tab"
                        data-bs-toggle="tab" data-bs-target="#normal-calendar-block"
                        class="py-1 nav-link active nav-rounded sanserif w-100"
                    >
                        {{ __('neutral_words')['nights'] }}
                    </button>
                </li>

                <li class="w-20 nav-item" role="presentation">
                    <button type="button" role="tab"
                        data-bs-toggle="tab" data-bs-target="#express-calendar-block"
                        class="py-1 nav-link nav-rounded sanserif w-100"
                    >
                        {{ __('neutral_words')['express'] }}
                    </button>
                </li>
            </ul>
        @endif

        {{--Contenido--}}
        <section class="tab-content">

            <div
                class="tab-pane fade show active"
                id="normal-calendar-block"
                role="tabpanel"
            >
                <div class="calendar-container">
                    <div id="normal-calendar"></div>
                </div>
            </div>

            @if ($has_express_reservations)
                <div
                    class="tab-pane fade"
                    id="express-calendar-block"
                    role="tabpanel"
                >
                    <div class="calendar-container">
                        <div id="express-calendar"></div>
                    </div>
                </div>
            @endif

        </section>
    </div>
@endsection

@section('footer')
    @include('shared.components.footer.basic-footer')
@endsection

@section('import-scripts')
    @include("hotel.public-calendar.complements.shared-calendar-scripts")
    @include("hotel.public-calendar.complements.normal-calendar-scripts")

    @if ($has_express_reservations)
        @include("hotel.public-calendar.complements.express-calendar-scripts")
    @endif
@endsection
