@include('admin.objects.components.hidden', ['name' => 'delete_facility_list'])
<table class="p-regist__table mt10">
    <tbody id="facility_list">
    <tr>
            <th colspan="2" rowspan="99">施設写真</th>
            <td>
                <div id="facilty_tmp" class="d-flex regist-facility">
                    <div class="w150 mr10">
                        <img src="{{root('img/noimage2.jpg')}}" width="150" name="facility_img">
                    </div>
                    <div class="w250">
                        <dl class="regist-facility__list">
                            <dt class="">エリア</dt>
                            <dd class="">@include('admin.objects.components.selectbox', ['name' => 'facility_area', 'class' => 'w150', 'options' => $facility_area, 'title' => 'エリア'])</dd>
                            <dt class="">施設種別</dt>
                            <dd class="">@include('admin.objects.components.selectbox', ['name' => 'facility_property', 'class' => 'w150', 'options' => $facility_property, 'title' => '施設種別'])</dd>
                            <dt class="">施設名</dt>
                            <dd class="">@include('admin.objects.components.selectbox', ['name' => 'facility', 'class' => 'w150', 'options' => $facility, 'title' => '施設名'])</dd>   
                        </dl>
                    </div>
                    <div class="w350">
                        <dl class="regist-facility__list">
                            <dt class="mr10">現地までの距離</dt>
                            <dd>@include('admin.objects.components.input', ['name' => 'facility_distance', 'class' => 'w100'])&nbsp;m&nbsp;（徒歩<span name="facility_time">0</span>分）</dd>
                            <dt class="mr10">施設番号</dt>
                            <dd>@include('admin.objects.components.input', ['name' => 'facility_num', 'class' => '', 'other_attr' => 'readonly'])</dd>
                        </dl>
                    </div>
                    <div>
                        @include('admin.objects.components.btn', ['type' => 'button', 'class' => 'add_facility', 'title' => 'この施設を登録'])
                    </div>
                </div>
            </td>
        </tr>
        <tr id="facilty_tmplate" class="d-none">
            <td>
                <div class="d-flex regist-facility" >
                    @include('admin.objects.components.hidden', ['name' => 'save_facility_id[]'])
                    <div class="w150 mr10">
                        <img src="{{root('img/noimage2.jpg')}}" width="150" name="save_facility_img">
                    </div>
                    <div class="w250">
                        <dl class="regist-facility__list">
                            <dt class="">施設種別</dt>
                            <dd class="" name="save_facility_property"></dd>
                            <dt class="">施設名</dt>
                            <dd class="" name="save_facility_name"></dd>   
                        </dl>
                    </div>
                    <div class="w350">
                        <dl class="regist-facility__list">
                            <dt class="mr10">現地までの距離</dt>
                            <dd>@include('admin.objects.components.input', ['name' => 'save_facility_distance[]', 'class' => 'w100'])&nbsp;m&nbsp;（徒歩<span name="save_facility_time">0</span>分）</dd>
                            <dt class="mr10">施設番号</dt>
                            <dd name="save_facility_num"></dd>
                        </dl>
                    </div>
                    <div>
                        @include('admin.objects.components.btn', ['type' => 'button', 'class' => 'del_article_facility', 'title' => '削除'])
                    </div>
                </div>
            </td>
        </tr>
@foreach($facility as $row)
        <tr>
            <td>
                <div class="d-flex regist-facility" >
                    @include('admin.objects.components.hidden', ['name' => 'save_facility_id[]', 'value' => $row->facility_id])
                    <div class="w150 mr10">
                        @if(!empty($row->disp_file_path))
                        <img src="{{$row->disp_file_path}}" width="150" name="save_facility_img">
                        @else
                        <img src="{{root('img/noimage2.jpg')}}" width="150" name="save_facility_img">
                        @endif
                    </div>
                    <div class="w250">
                        <dl class="regist-facility__list">
                            <dt class="">施設種別</dt>
                            <dd class="" name="save_facility_property">{{$row->kind_name}}</dd>
                            <dt class="">施設名</dt>
                            <dd class="" name="save_facility_name">{{$row->name}}</dd>   
                        </dl>
                    </div>
                    <div class="w350">
                        <dl class="regist-facility__list">
                            <dt class="mr10">現地までの距離</dt>
                            <dd>@include('admin.objects.components.input', ['name' => 'save_facility_distance[]', 'class' => 'w100', 'value' => $row->distance])&nbsp;m&nbsp;（徒歩<span name="save_facility_time">{{$row->time}}</span>分）</dd>
                            <dt class="mr10">施設番号</dt>
                            <dd name="save_facility_num">{{$row->facility_id}}</dd>
                        </dl>
                    </div>
                    <div>
                        @include('admin.objects.components.btn', ['type' => 'button', 'class' => 'del_article_facility', 'title' => '削除'])
                    </div>
                </div>
            </td>
        </tr>
@endforeach
    </tbody>
</table>