@php
    $vendor_list_text = "";
    foreach($vendor as $row) {
        if($vendor_list_text != "") {
            $vendor_list_text .= ",";
        }
        $vendor_list_text.=$row->vendor_id;
    }
@endphp
<div class="p-regist">
            <span>取引情報</span>
            <div name="vendor_list">
                @include('admin.objects.components.hidden', ['name' => 'save_vendor_list', 'value' => $vendor_list_text])
                @include('admin.objects.components.hidden', ['name' => 'delete_vendor_list'])
@if(count($vendor) == 0)
            <table class="p-regist__table">
                <tbody>
                    <tr>
                        <th rowspan="3" class="p-regist__table-colspan" name="vendor_num">01</th>
                        <th class="p-regist__table-colspan">業者名/取引態様</th>

                        <td>
                            @include('admin.objects.components.hidden', ['name' => 'vendor_num'])
                            @include('admin.objects.components.hidden', ['name' => 'vendor_id[]'])
                            @include('admin.objects.components.input', ['name' => 'vendor_name', 'class' => 'w300', 'other_attr' => 'readonly'])
                            @include('admin.objects.components.modal-btn', ['title' => '業者検索', 'class'=> 'btn_search', 'data' => 9, 'list_num' => 1, 'btn_name' => 'vendor_modal_btn'])
                            @include('admin.objects.components.selectbox', ['name' => 'manner[]', 'options' => $manner, ])
                        </td>
                        <td rowspan="3" class="p-regist__table-registtrader">
                            @include('admin.objects.components.btn', ['name' => 'del_vendor', 'class' => '', 'title' => '削除', 'type' => 'button'])
                        </td>
                    </tr>
                    <tr>
                        <th>電話/FAX/担当</th>
                        <td class="d-flex justify-content-between border-0">
                            <div>
                            電話&nbsp;@include('admin.objects.components.input', ['name' => 'vendor_tel', 'other_attr' => 'readonly'])
                            </div>
                            <div>
                            FAX&nbsp;@include('admin.objects.components.input', ['name' => 'vendor_fax', 'other_attr' => 'readonly'])
                            </div>
                            <div>
                            担当&nbsp;@include('admin.objects.components.input', ['name' => 'vendor_charge[]'])
                            </div>
                        </td>
                    </tr>
                    <tr>
                    <th>広告掲載確認/広告確認日</th>
                        <td>
                            <ul class="d-flex p-regist__table-list">
                                <li>
                                    <p>チラシ</p>
                                    @include('admin.objects.components.selectbox', ['name' => 'flyer[]', 'options' => $ad_conf])
                                </li>
                                <li>
                                    <p>情報誌</p>
                                    @include('admin.objects.components.selectbox', ['name' => 'freepaper[]', 'options' => $ad_conf])
                                </li>
                                <li>
                                    <p>自社HP</p>
                                    @include('admin.objects.components.selectbox', ['name' => 'house_hp[]', 'options' => $ad_conf])
                                </li>
                                <li>
                                    <p>ポータル</p>
                                    @include('admin.objects.components.selectbox', ['name' => 'portal[]', 'options' => $ad_conf])
                                </li>

                                <li>
                                    <p>現地看板</p>
                                    @include('admin.objects.components.selectbox', ['name' => 'signboard[]', 'options' => $ad_conf])
                                </li>
                                <li>
                                    <p></p>
                                    @include('admin.objects.components.btn', ['name' => 'all_ad[]', 'class' => 'btn_allcheck', 'title' => '全不可チェック'])
                                </li>
                                <li>
                                    <p>広告確認日</p>
                                    @include('admin.objects.components.input', ['name' => 'ad_conf_day[]', 'class' => 'cal_picker', 'placeholder' => '0000/00/00'])
                                </li>
                            </ul>
                            
                        </td>
                    </tr>
                </tbody>
            </table>
@endif
            <table class="p-regist__table d-none" id="vendor_template">
                <tbody>
                    <tr>
                        <th rowspan="3" class="p-regist__table-colspan" name="vendor_num"></th>
                        <th class="p-regist__table-colspan">業者名/取引態様</th>
                        <td>
                            @include('admin.objects.components.hidden', ['name' => 'vendor_id[]'])
                            @include('admin.objects.components.input', ['name' => 'vendor_name', 'class' => 'w300', 'other_attr' => 'readonly'])
                            @include('admin.objects.components.modal-btn', ['title' => '業者検索', 'class'=> 'btn_search', 'data' => 9, 'btn_name' => 'vendor_modal_btn'])
                            @include('admin.objects.components.selectbox', ['name' => 'manner[]', 'options' => $manner, ])
                        </td>
                        <td rowspan="3" class="p-regist__table-registtrader">
                            @include('admin.objects.components.btn', ['name' => 'del_vendor', 'class' => '', 'title' => '削除', 'type' => 'button'])
                        </td>
                    </tr>
                    <tr>
                        <th>電話/FAX/担当</th>
                        <td class="d-flex justify-content-between border-0">
                            <div>
                            電話&nbsp;@include('admin.objects.components.input', ['name' => 'vendor_tel', 'other_attr' => 'readonly'])
                            </div>
                            <div>
                            FAX&nbsp;@include('admin.objects.components.input', ['name' => 'vendor_fax', 'other_attr' => 'readonly'])
                            </div>
                            <div>
                            担当&nbsp;@include('admin.objects.components.input', ['name' => 'vendor_charge[]'])
                            </div>
                        </td>
                    </tr>
                    <tr>
                    <th>広告掲載確認/広告確認日</th>
                        <td>
                            <ul class="d-flex p-regist__table-list">
                                <li>
                                    <p>チラシ</p>
                                    @include('admin.objects.components.selectbox', ['name' => 'flyer[]', 'options' => $ad_conf])
                                </li>
                                <li>
                                    <p>情報誌</p>
                                    @include('admin.objects.components.selectbox', ['name' => 'freepaper[]', 'options' => $ad_conf])
                                </li>
                                <li>
                                    <p>自社HP</p>
                                    @include('admin.objects.components.selectbox', ['name' => 'house_hp[]', 'options' => $ad_conf])
                                </li>
                                <li>
                                    <p>ポータル</p>
                                    @include('admin.objects.components.selectbox', ['name' => 'portal[]', 'options' => $ad_conf])
                                </li>

                                <li>
                                    <p>現地看板</p>
                                    @include('admin.objects.components.selectbox', ['name' => 'signboard[]', 'options' => $ad_conf])
                                </li>
                                <li>
                                    <p></p>
                                    @include('admin.objects.components.btn', ['name' => 'all_ad[]', 'class' => 'btn_allcheck', 'title' => '全不可チェック'])
                                </li>
                                <li>
                                    <p>広告確認日</p>
                                    @include('admin.objects.components.input', ['name' => 'ad_conf_day[]', 'class' => 'cal_picker', 'placeholder' => '0000/00/00'])
                                </li>
                            </ul>
                            
                        </td>
                    </tr>
                </tbody>
            </table>
@foreach($vendor as $vendor_row)
            <table class="p-regist__table">
                <tbody>
                    <tr>
                        <th rowspan="3" class="p-regist__table-colspan" name="vendor_num">0{{$loop->iteration}}</th>
                        <th class="p-regist__table-colspan">業者名/取引態様</th>

                        <td>
                            @include('admin.objects.components.hidden', ['name' => 'vendor_id[]', 'value' => $vendor_row->vendor_id])
                            @include('admin.objects.components.input', ['name' => 'vendor_name', 'class' => 'w300', 'value' => $vendor_row->name, 'other_attr' => 'readonly'])
                            @include('admin.objects.components.modal-btn', ['title' => '業者検索', 'class'=> 'btn_search', 'data' => 9, 'list_num' => $loop->iteration, 'btn_name' => 'vendor_modal_btn'])
                            @include('admin.objects.components.selectbox', ['name' => 'manner[]', 'options' => $manner, 'selected' => $vendor_row->manner])
                        </td>
                        <td rowspan="3" class="p-regist__table-registtrader">
                            @include('admin.objects.components.btn', ['name' => 'del_vendor', 'class' => '', 'title' => '削除', 'type' => 'button'])
                        </td>
                    </tr>
                    <tr>
                        <th>電話/FAX/担当</th>
                        <td class="d-flex justify-content-between border-0">
                            <div>
                            電話&nbsp;@include('admin.objects.components.input', ['name' => 'vendor_tel1', 'value' => $vendor_row->vendor_tel1, 'other_attr' => 'readonly'])
                            </div>
                            <div>
                            FAX&nbsp;@include('admin.objects.components.input', ['name' => 'vendor_fax', 'value' => $vendor_row->fax, 'other_attr' => 'readonly'])
                            </div>
                            <div>
                            担当&nbsp;@include('admin.objects.components.input', ['name' => 'vendor_charge[]', 'value' => $vendor_row->charge])
                            </div>
                        </td>
                    </tr>
                    <tr>
                    <th>広告掲載確認/広告確認日</th>
                        <td>
                            <ul class="d-flex p-regist__table-list">
                                <li>
                                    <p>チラシ</p>
                                    @include('admin.objects.components.selectbox', ['name' => 'flyer[]', 'options' => $ad_conf, 'selected' => $vendor_row->flyer])
                                </li>
                                <li>
                                    <p>情報誌</p>
                                    @include('admin.objects.components.selectbox', ['name' => 'freepaper[]', 'options' => $ad_conf, 'selected' => $vendor_row->freepaper])
                                </li>
                                <li>
                                    <p>自社HP</p>
                                    @include('admin.objects.components.selectbox', ['name' => 'house_hp[]', 'options' => $ad_conf, 'selected' => $vendor_row->house_hp])
                                </li>
                                <li>
                                    <p>ポータル</p>
                                    @include('admin.objects.components.selectbox', ['name' => 'portal[]', 'options' => $ad_conf, 'selected' => $vendor_row->portal])
                                </li>

                                <li>
                                    <p>現地看板</p>
                                    @include('admin.objects.components.selectbox', ['name' => 'signboard[]', 'options' => $ad_conf, 'selected' => $vendor_row->signboard])
                                </li>
                                <li>
                                    <p></p>
                                    @include('admin.objects.components.btn', ['name' => 'all_ad[]', 'class' => 'btn_allcheck', 'title' => '全不可チェック'])
                                </li>
                                <li>
                                    <p>広告確認日</p>
                                    @include('admin.objects.components.input', ['name' => 'ad_conf_day[]', 'class' => 'cal_picker', 'placeholder' => '0000/00/00', 'value' => $vendor_row->ad_conf_day])
                                </li>
                            </ul>
                            
                        </td>
                    </tr>
                </tbody>
            </table>
@endforeach
            </div>
            <div class="addvendor__div">
                @include('admin.objects.components.btn', ['class' => 'btn_addvendor', 'title' => '業者を追加入力', 'name' => 'add_vendor'])
            </div>
            <span>広告関連</span>
            <table class="p-regist__table">
                <tbody>
                @include('admin.objects.projects.ad-disp')    
                </tbody>
            </table>
        </div>