@extends('business.layouts.base-popup')
{{-- header --}}
@section('contents-header')
    @include('business.objects.projects.detail-header', ['number' => '1', 'totalCount' => '10'])
@endsection
@php
    // tab
    $tabs = [];
    $disp_flag = isset($_GET['open']) ? (int)$_GET['open'] : 0;

    $tab = new stdClass();
    $tab->title = '自社物件シート';
    $tab->id = 'nav-property-tab';
    $tab->href = 'nav-property';
    $tab->active = $disp_flag != 1 ? 'active' : '';
    array_push($tabs, $tab);

    $tab = new stdClass();
    $tab->title = '写真';
    $tab->id = 'nav-photo-tab';
    $tab->href = 'nav-photo';
    $tab->active = '';
    array_push($tabs, $tab);

    $tab = new stdClass();
    $tab->title = '周辺施設';
    $tab->id = 'nav-map-tab';
    $tab->href = 'nav-map';
    $tab->active = '';
    array_push($tabs, $tab);

    $tab = new stdClass();
    $tab->title = '業者物件シート';
    $tab->id = 'nav-sheet-tab';
    $tab->href = 'nav-sheet';
    $tab->active = $disp_flag == 1 ? 'active' : '';
    // $tab->display = $disp_flag == 1;
    array_push($tabs, $tab);

    $tab = new stdClass();
    $tab->title = '物件概要';
    $tab->id = 'nav-summary-tab';
    $tab->href = 'nav-summary';
    $tab->active = '';
    array_push($tabs, $tab);
@endphp

@section('contents')
    <div class="mt-4">
        @include('business.objects.projects.form-to-other', ['action' => route('business-for-sale-detail', ['id' => '']), 'id' => 'link_detail', 'params' => $params])
        @include('business.objects.projects.results-noimage', ['data' => [$item], 'disp_flag' => $disp_flag, 'attr' => 'data-next-btn='.$item->building_id])

        {{-- tab contents --}}
        @include('business.objects.projects.detail-tab', ['tabs' => $tabs])
        <div class="tab-content">
            <div class="tab-pane bg-white {{$disp_flag != 1 ? 'active' : ''}}" id="nav-property" role="tabpanel"
                 aria-labelledby="nav-property-tab">
                @include('business.objects.projects.detail-main-sheet', ['data' => $article_list,'pref' => $pref, 'city' =>$city,'town'=>$town])
            </div>
            <div class="tab-pane bg-white" id="nav-photo" role="tabpanel" aria-labelledby="nav-photo-tab">
                @include('business.objects.projects.detail-photo', ['data' => $article_list])
            </div>
            <div class="tab-pane bg-white" id="nav-map" role="tabpanel" aria-labelledby="nav-map-tab">
                @include('business.objects.projects.detail-map-around', ['data' => $article_list])
            </div>
            <div class="tab-pane bg-white {{$disp_flag == 1 ? 'active' : ''}}" id="nav-sheet" role="tabpanel" aria-labelledby="nav-sheet-tab"
{{--                 @if($disp_flag != 1) style="display: none" @endif--}}
            >
                @include('business.objects.projects.detail-vendor-sheet', ['data' => $article_list])
            </div>
            <div class="tab-pane bg-white" id="nav-summary" role="tabpanel" aria-labelledby="nav-summary-tab">
                @include('business.objects.projects.detail-summary', ['data' => $article_list])
            </div>
        </div>
        @include('business.objects.projects.form-to-other', ['action' => route('business-for-sale-setprint'), 'id' => 'multiPrintForm', 'params' => $params])
        @include('business.objects.projects.form-to-other', ['action' => route('business-for-sale-print'), 'id' => 'singlePrintForm', 'params' => $params])

        @include('business.objects.projects.form-to-other', ['action' => route('business-for-sale-setprint-vendor'), 'id' => 'multiPrintFormVendor', 'params' => $params])
        @include('business.objects.projects.form-to-other', ['action' => route('business-for-sale-print-vendor'), 'id' => 'singlePrintFormVendor', 'params' => $params_single])

        @include('business.objects.projects.form-to-other', ['action' => route('business-for-sale-setprint-set1'), 'id' => 'multiPrintFormSet1', 'params' => $params])
        @include('business.objects.projects.form-to-other', ['action' => route('business-for-sale-print-set1'), 'id' => 'singlePrintFormSet1', 'params' => $params_single])

        @include('business.objects.projects.form-to-other', ['action' => route('business-for-sale-setprint-set2'), 'id' => 'multiPrintFormSet2', 'params' => $params])
        @include('business.objects.projects.form-to-other', ['action' => route('business-for-sale-print-set2'), 'id' => 'singlePrintFormSet2', 'params' => $params_single])

        @include('business.objects.projects.form-to-other', ['action' => route('business-for-sale-setprint-set3'), 'id' => 'multiPrintFormSet3', 'params' => $params])
        @include('business.objects.projects.form-to-other', ['action' => route('business-for-sale-print-set3'), 'id' => 'singlePrintFormSet3', 'params' => $params_single])

        @include('business.objects.projects.form-to-other', ['action' => route('business-for-sale-setpdf'), 'id' => 'multiPdfForm', 'params' => $params])
        @include('business.objects.projects.form-to-other', ['action' => route('business-for-sale-pdf'), 'id' => 'singlePdfForm', 'params' => $params_single])

        @include('business.objects.projects.form-to-other', ['action' => route('business-for-sale-setpdf-vendor'), 'id' => 'multiPdfFormVendor', 'params' => $params])
        @include('business.objects.projects.form-to-other', ['action' => route('business-for-sale-pdf-vendor'), 'id' => 'singlePdfFormVendor', 'params' => $params_single])

        @include('business.objects.projects.form-to-other', ['action' => route('business-for-sale-setpdf-set1'), 'id' => 'multiPdfFormSet1', 'params' => $params])
        @include('business.objects.projects.form-to-other', ['action' => route('business-for-sale-pdf-set1'), 'id' => 'singlePdfFormSet1', 'params' => $params_single])

        @include('business.objects.projects.form-to-other', ['action' => route('business-for-sale-setpdf-set2'), 'id' => 'multiPdfFormSet2', 'params' => $params])
        @include('business.objects.projects.form-to-other', ['action' => route('business-for-sale-pdf-set2'), 'id' => 'singlePdfFormSet2', 'params' => $params_single])

        @include('business.objects.projects.form-to-other', ['action' => route('business-for-sale-setpdf-set3'), 'id' => 'multiPdfFormSet3', 'params' => $params])
        @include('business.objects.projects.form-to-other', ['action' => route('business-for-sale-pdf-set3'), 'id' => 'singlePdfFormSet3', 'params' => $params_single])
    </div>

    @include('business.objects.components.modal-photo-print')

    @php
    $url = Request::url();
    $path = 'for-sale';
    if(preg_match('/close/', $url)) {
        $path = 'close';
    }
    if(preg_match('/mansion/', $url)) {
        $path = 'mansion';
    }
    @endphp
    <form action="/business/{{$path}}" method="post" id="return_form">
        @foreach($params as $key => $value)
            @if(!is_array($value))
                <input type="hidden" name="{{$key}}" value="{{$value}}">
            @else
                @foreach($value as $v)
                    <input type="hidden" name="{{$key}}[]" value="{{$v}}">
                @endforeach
            @endif
        @endforeach
        @csrf
    </form>
@endsection
