<div class="p-detail-sold__title d-flex"><h3 class="p-detail-summary__title">{{$item->article_name}}</h3><span class="p-detail-summary__id">No.{{$item->building_id}}</span></div>

<div class="d-flex" style="padding:10px">
    <div class="p-detail-sold__left">
        <p class="sold_list_title">売出中物件</p>
        <div class="swap-table">
            <table class="sold_list">
            <thead>
                <tr>
                    <th width="12%">番号</th>
                    <th>種別</th>
                    <th>売出価格</th>
                    <th>坪単価(売出)</th>
                    <th>土地面積</th>
                    <th>建物面積</th>
                </tr>
            </thead>
            <tbody class="sold_list_con">
                @foreach($item->article_list as $room)
                    <tr id="mansion_{{$item->building_id}}">
                        <td class="w50">
                            <form target="_blank" action="/business/lot/detail/{{$room->building_id}}" id="viewDetail{{$room->building_id}}" method="post">
                                <input type="hidden" name="building_id_print" value="{{ implode(',', $item->article_list->pluck('building_id')->toArray()) }}">
                                <input type="hidden" name="detail_id" value="{{ $room->building_id }}">
                                @csrf
                            </form>
                            <a href="javascript:void(0)" href-id="{{$item->building_id}}" id="btnDetail{{$room->building_id}}" onclick="$('#viewDetail{{$room->building_id}}').submit()">{{$room->building_id}}</a>
                        <td class="w65">
                            @if($room->property < 4)
                                土地
                            @else
                                @if($room->property_sub == 1)
                                    新築戸建
                                @else
                                    中古戸建
                                @endif
                            @endif
                        </td>
                        <td class="w80">@if($room->price){{number_format($room->price, 0, ",", ",")}}万円@else-@endif</td>
                        <td class="w80">@if($room->tsubo){{$room->tsubo}}万円@else-@endif</td>
                        <td class="w75">{{$room->land_area_val}}m&sup2;</td>
                        <td class="w75">{{$room->total_area_val}}m&sup2;</td>
                    </tr>
                @endforeach
                @for ($i = 0; $i < 50-count($item->article_list) ; $i++)
                    <tr>
                        <td class=""></td>
                        <td class=""></td>
                        <td class=""></td>
                        <td class=""></td>
                        <td class=""></td>
                        <td class=""></td>
                    </tr>
                @endfor
            </tbody>
        </table>
        </div>
    </div>
    <div class="p-detail-sold__right">
        <p class="sold_list_title">成約済物件</p>
        <div class="swap-table">
            <table class="sold_list">
                <thead>
                    <tr>
                        <th>番号</th>
                        <th>種別</th>
                        <th>最終価格</th>
                        <th>成約価格</th>
                        <th>坪単価(成約)</th>
                        <th>土地面積</th>
                        <th>建物面積</th>
                        <th>成約年月日</th>
                        <th>ステータス</th>
                    </tr>
                </thead>
                <tbody class="sold_list_con">
                    @foreach($item->sold_lot_list as $room)
                        <tr id="close_{{$item->building_id}}">
                            <td class="w50">
                                <form target="_blank" action="/business/lot/detail/{{$room->building_id}}" id="viewDetail{{$room->building_id}}" method="post">
                                    @csrf
                                    <input type="hidden" name="building_id_print" value="{{ implode(',', $item->sold_lot_list->pluck('building_id')->toArray()) }}">
                                    <input type="hidden" name="detail_id" value="{{ $room->building_id }}">
                                </form>
                                <a href="javascript:void(0)" onclick="$('#viewDetail{{$room->building_id}}').submit()" href-id="{{$item->building_id}}" id="bnDetailClose{{$room->building_id}}">{{$room->building_id}}</a>
                            </td>
                            <td class="w65">
                                @if($room->property < 4)
                                    土地
                                @else
                                    @if($room->sub_property == 1)
                                        新築戸建
                                    @else
                                        中古戸建
                                    @endif
                                @endif
                            </td>
                            <td class="w80">@if($room->price){{number_format($room->price, 0, ",", ",")}}万円@else-@endif</td>
                            <td class="w80">@if($room->price_closing and $room->status==4){{number_format($room->price_closing, 0, ",", ",")}}万円@else-@endif</td>
                            <td class="w100">@if($room->tsubo_closing and $room->status==4){{$room->tsubo_closing}}万円@else-@endif</td>
                            <td class="w80">{{$room->land_area_val}}m&sup2;</td>
                            <td class="w80">{{$room->total_area_val}}m&sup2;</td>
                            <td >{{$room->close_date}}</td>
                            <td >
                                @if($room->status==4)
                                    契約済
                                @elseif($room->status==5)
                                    売りやめ
                                @endif
                            </td>
                        </tr>
                    @endforeach
                    @for ($i = 0; $i < 50-count($item->sold_lot_list) ; $i++)
                        <tr>
                            <td class=""></td>
                            <td class=""></td>
                            <td class=""></td>
                            <td class=""></td>
                            <td class=""></td>
                            <td class=""></td>
                            <td class=""></td>
                            <td></td>
                            <td></td>
                        </tr>
                    @endfor
                </tbody>
            </table>
        </div>
    </div>
</div>
