@foreach($article_list as $item)
    <div class="mb-3 mansion-list">
        <table class="p-results-noimage__tbl">
            <tr>
                <td rowspan="2" class="p-results-noimage__tbl-num-date">
                    <p><span class="p-results-noimage__tbl-number">マンションID</span><br><a href="javascript:void(0);" class="target_link_id" id="bttnParentDetail{{$item->building_id}}" >{{$item->building_id}}</a></p>
                    <p class="mt-1">
                        @if($item["room_count"])
                            <a href="javascript:void(0);" class="p-results-current-condition__panel--btn-delete disp_room_noimage" name="show_room_btn">売出({{$item["room_count"]}}) <i class="fa fa-caret-down"></i></a>
                        @else
                            <span class="p-results-current-condition__panel--btn-delete disp_room_noimage" name="show_room_btn">売出({{$item["room_count"]}}) </span>
                        @endif
                    </p>
                </td>
                <th>物件名</th>
                <td colspan="2" class="w270">
                    <div class="d-flex justify-content-between">
                        {{$item->name}}
                        <a href="javascript:void(0);" class="p-results-image__li-link-mansion" id="bttnParentDetail{{$item->building_id}}" class="p-results-noimage__tbl-link-mansion">
                        <!-- <a href="/business/editMansion/{{$item->building_id}}" class="p-results-noimage__tbl-link-mansion"> -->
                            <img src="../../business/img/icon_detail.png">
                        </a>
                    </div>
                </td>
                <th>所在地</th><td colspan="2" class="w300">{{$item->address}}</td>
                <th>築年月</th><td class="w120">{{$item->age_year?? "-"}}年{{$item->age_month?? "-"}}月</td>
                <th>校区</th><td>{{$item->primary_school_name?? "-"}}/{{$item->secondary_school_name?? "-"}}</td>
            </tr>
            <tr>
                <th>種別</th>
                <td colspan="2">
                    @if($item->property == 6)
                        @if($item->property_sub == 1)
                            新築
                        @else
                            中古
                        @endif
                        マンション
                    @elseif($item->property == 7)
                        @if($item->property_sub == 1)
                            新築
                        @else
                            中古
                        @endif
                        タウンハウス
                    @endif
                </td>
                <th>交通</th><td colspan="2">
                    @include('business.objects.projects.traffic-info-summary', ['article' => $item])
                </td>
                <th>総戸数</th><td>{{$item->total_unit?? "-"}}戸</td>
                <th>階数</th><td>
                    @if($item->underground)
                        地上{{$item->floor}}階 地下{{$item->underground}}階建
                    @elseif($item->floor)
                        {{$item->floor}}階建
                    @else
                        -
                    @endif
                </td>
            </tr>
        </table>
        @foreach($item->room_list as $room)
            <div  @if($item->show_ite == true) class="p-mansion-room p-mansion-room-show" @else class="p-mansion-room" @endif >
                <table class="p-mansion-room__tbl">
                    <tr>
                        <td class="p-mansion-room__tbl-number w90">物件番号<br /><span class="room_building_id">{{$room->building_id}}</span></td>
                        <th>部屋</th>
                        <td class="w90">{{$room->room_num?? '-'}}</td>
                        <th>価格</th>
                        <td class="w160">{{number_format($room->price, 0, ",", ",")}}<span>万円@if($room->tax==2)（税込）@endif</span></td>
                        <th>専有</th>
                        <td class="w120">{{$room->total_area_val?? '-'}}m&sup2;</td>
                        <th>間取り</th>
                        <td class="w90">{{$room->floor_plan_text?? '-'}}</td>
                        <th class="w90">階数</th>
                        <td>@if($room->maisonette == 1) {{$room->maisonette_from?? '-'}}階〜{{$room->maisonette_to?? '-'}}階 @else {{$room->whereabouts?? '-'}}階 @endif</td>
                        <td class="w90"><img src="/business/img/icon_camera.png" alt="写真">内{{$room->file_count}}</td>
                        <td colspan="3" class="no-print">
                            <ul class="p-results-image__li-btns d-flex justify-content-end list-unstyled">
                                @if(!isset($print))
                                    <li>
                                        @include('business.objects.components.circle-btn-mansion',
                                            ['id' => 'btnCheck', 'class' => 'c-circle-btn__check-mansion_noimage show_lv_2', 'linkUrl' => '#',
                                            'img' => '../../business/img/icon_check.png', 'title' => '確認'])
                                    </li>
                                    <li>
                                        @include('business.objects.components.circle-btn-mansion',
                                            ['id' => 'btnDetail'.$room->building_id, 'class' => 'c-circle-btn__detail', 'linkUrl' => 'javascript:void(0);',
                                            'img' => '../../business/img/icon_detail.png', 'title' => '詳細'])
                                    </li>
                            @endif
                            <!--<li>
                                @include('business.objects.components.circle-btn-mansion',
                                    ['id' => 'btnDisplay', 'class' => 'c-circle-btn__disp-mansion_noimage', 'linkUrl' => '#',
                                    'img' => '../../business/img/icon_display.png', 'title' => '表示'])
                                </li>-->
                            </ul>
                        </td>
                    </tr>
                </table>

                @php
                    $uuid = \Ramsey\Uuid\Uuid::uuid4();
                @endphp
                {{-- 確認ボタンクリック時に表示する --}}
                @include('business.objects.projects.form-check-mansion', ['data_num' => $uuid, 'history_count' => count($room->history)])
                @include('business.objects.projects.modal-history', ['history' => $room->history, 'data_num' => $uuid])
            </div>
        @endforeach
    </div>
@endforeach
