{{-- 並び替え --}}
<div class="p-results-noimage">
  @foreach($data as $item)
  <div class="mb-3 target_list">
    @if(isset($disp_flag) && $disp_flag == 1)
    <div class="clearfix">
        <ul class="p-results-noimage__btns d-flex justify-content-center list-unstyled float-right">
            <li>
                <a href="javascript:void(0);" name="c-circle-btn__check"><img src="/business/img/icon_check.png"></a>
            </li>
            <li>
                <a href="javascript:void(0);" id="btnDetail{{$item['building_id']}}"><img src="/business/img/icon_detail.png"></a>
            </li>
            <li>
            <a href="javascript:void(0);" class="c-circle-btn__display__list" ><img src="/business/img/icon_display.png"></a>
            </li>
        </ul>

    </div>
    @elseif(!isset($disp_flag))
    <div class="clearfix">
        <ul class="p-results-noimage__btns d-flex justify-content-center list-unstyled float-right">
            <li>
                <a href="javascript:void(0);" name="c-circle-btn__check"><img src="/business/img/icon_check.png"></a>
            </li>
            <li>
                <a href="javascript:void(0);" id="btnDetail{{$item['building_id']}}"><img src="/business/img/icon_detail.png"></a>
            </li>
            <li>
                <a href="javascript:void(0);" class="c-circle-btn__display__list" ><img src="/business/img/icon_display.png"></a>
            </li>
        </ul>
    </div>
    @endif
    <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">物件番号</span><br>{{$item->building_id}}</p>
                <p class="mt-1"><span class="p-results-noimage__tbl-date">物件登録日</span><br>{{$item->created_at}}</p>
            </td>
            <th>物件名</th>
            <td colspan="3">
                <div class="d-flex justify-content-between">
                    <p>{{$item->name}}</p>
                    @if($item->property == null)<a href="javascript:void(0);" class="p-results-image__li-link-mansion" id="btnParentDetail{{$item->mansion_id}}"><img src="../../business/img/icon_detail.png"></a>@endif                </div>
            </td>
            <th>所在地</th><td>{{$item->pref_name}}{{$item->city_name}}{{$item->town_name}}</td>
            <th>価格</th><td><span>{{$item->price}}</span>万円</td>
            <th>土地</th><td>{{$item->land_area_val?? "-"}}m&sup2;</td>
            <th>校区</th><td>{{$item->primary_school_name?? "-"}}/{{$item->secondary_school_name?? "-"}}</td>
        </tr>
        <tr>
            <th>種別</th><td>{{$item->property_name?? "-"}}</td>
            <th>間取り</th><td>{{$item->floor_plan_text?? "-"}}</td>
            <th>交通</th><td>{{$item->main_traffic_line?? "-"}}「{{$item->main_traffic_station?? "-"}}」徒歩{{$item->main_traffic_time?? "-"}}分</td>
            <th>築年月</th><td>{{$item->age_year?? "-"}}年{{$item->age_month?? "-"}}月</td>
            <th>延床</th><td>{{$item->total_area_val?? "-"}}m&sup2;</td>
            <th>階数</th><td>{{$item->whereabouts?? "-"}}階</td>
        </tr>
    </table>
    {{-- 確認ボタンクリック時に表示する --}}
    @php
        $count = 0;
        if(isset($item->history)) {
            $count = count($item->history);
        }
    @endphp
    @include('business.objects.projects.form-check', ['data_num' => $loop->iteration, 'history_count' => $count])
    @include('business.objects.projects.modal-history', ['history' => $item->history, 'data_num' => $loop->iteration])
  </div>

  @endforeach
</div>

