@php
$target = [
  ['code' => '', 'name' => ''],
  ['code' => '1', 'name' => '未'],
  ['code' => '2', 'name' => '可'],
  ['code' => '3', 'name' => '不可'],
];
@endphp
<div class="p-form-check">
<form data-id = {{ $item['building_id'] }}>
  <div class="d-flex">
  <div class="p-form-check__status d-flex flex-column justify-content-between">
    <p>公開中</p>
    @include('business.objects.components.btn', ['title' => '保存', 'class' => 'btn_pink btnSearchSave', 'id' => ''])
  </div>

  <div class="p-form-check__div">
  @if(isset($lot->vendor_info))
  <table class="p-form-check__tbl">
    @foreach($lot->vendor_info as $vendor)
    <tr>
      <th>業者名</th>
      <td colspan="3" class="p-form-check__tbl-name p-1">{{$vendor['name']}}
      @include('business.objects.components.hidden', ['name' => 'id[]', 'value' => $vendor['vendor_id']])
      </td>
      <th>業者ID</th><td class="p-1">@include('business.objects.components.link', ['url' => '/admin/editVendor/'.$vendor['vendor_id'], 'title' => $vendor['vendor_id'], 'class' => 'p-form-check__tbl-link-id'])</td>
      <th>電話</th><td class="p-form-check__tbl-tel">@include('business.objects.components.input', ['name' => 'vender_tel[]', 'value' => $vendor['vendor_tel1'], 'class' => 'p-form-check__tbl-vender-tel'])</td>
    </tr>
    <tr>
      <th>態様</th><td colspan="3">@include('business.objects.components.selectbox', ['name' => 'manner[]', 'options' => $manner, 'class' => 'ml-1', 'selected' => $vendor['manner']])</td>
      <th>担当</th><td class="p-form-check__tbl-person">@include('business.objects.components.input', ['name' => 'charge[]', 'value' => $vendor['charge'], 'class' => 'p-form-check__tbl-vender-person'])</td>
      <th>FAX</th><td>@include('business.objects.components.input', ['name' => 'vender_fax[]', 'value' => $vendor['vendor_fax'], 'class' => 'p-form-check__tbl-vender-tel'])</td>
    </tr>
    <tr style="height:85px;">
    <td colspan="2">
      <p class="pl-2">物件確認日</p>@include('business.objects.components.input', ['name' => 'article_conf_day[]', 'value' => $vendor['article_conf_day'], 'class' => 'cal_picker p-form-check__tbl-checked-day mt-0'])</td>
      <td colspan="6" class="p-2">
        <ul class="d-flex p-form-check__tbl-list p-0">
          <li><p>チラシ</p>@include('business.objects.components.selectbox', ['name' => 'flyer[]', 'options' => $target, 'selected' => $vendor['flyer']])</li>
          <li><p>情報誌</p>@include('business.objects.components.selectbox', ['name' => 'freepaper[]', 'options' => $target, 'selected' => $vendor['freepaper']])</li>
          <li><p>自社HP</p>@include('business.objects.components.selectbox', ['name' => 'house_hp[]', 'options' => $target, 'selected' => $vendor['house_hp']])</li>
          <li><p>ポータル</p>@include('business.objects.components.selectbox', ['name' => 'portal[]', 'options' => $target, 'selected' => $vendor['portal']])</li>
          <li><p>現地看板</p>@include('business.objects.components.selectbox', ['name' => 'signboard[]', 'options' => $target, 'selected' => $vendor['signboard']])</li>
          <li class=" p-form-check__tbl-list-allx"><a href="javascript:void(0);" name="all_not"><p>全X</p></a></li>
        </ul>
        <ul class="d-flex p-form-check__tbl-list p-0">
          <li><p>確認手法</p>@include('business.objects.components.selectbox', ['name' => 'ad_conf[]', 'options' => $ad_conf, 'title' => '', 'selected' => $vendor['ad_conf']])</li>
          <li class="p-form-check__tbl-flyer-day"><p>広告確認日</p>@include('business.objects.components.input', ['name' => 'ad_conf_day[]', 'value' => $vendor['ad_conf_day'], 'class' => 'cal_picker p-form-check__tbl-flyer-day-txt mt-0'])</li>
        </ul>
      </td>
    </tr>
    @endforeach
  </table>
  @endif
  </div>
  <table class="p-form-check__tblsub">
    <tr>
      <td colspan="2" class="p-form-check__tbl-history">
        <div class="p-form-check__tbl-history-div">
          @include('admin.objects.components.checkbox', ['name' => 'change_flag', 'checkbox' => [['code' => 1, 'name' => '価格変更']]])
          @include('business.objects.components.input', ['name' => 'change_price', 'class' => 'p-form-check__tbl-txt-change-price','placeholder' => '価格変更'])<span>万円</span>
          @include('business.objects.components.input', ['name' => 'change_price_date', 'class' => 'cal_picker p-form-check__tbl-change-day'])
          @include('business.objects.components.link', ['url' => '', 'title' => '履歴('.($history_count?? 0).')', 'class' => 'modal-open-history p-form-check__tbl-link-history', 'data_num' => $data_num??''])
        </div>
      </td>
    </tr>
    <tr>
      <td colspan="2" class="p-form-check__tbl-closed">
      @include('business.objects.components.hidden', ['name' => 'article_id', 'value' => $lot->building_id])
        @include('business.objects.components.selectbox', ['name' => 'status', 'options' => $statuses, 'class' => 'ml-1', 'selected' => $item['status']])
        @include('business.objects.components.input', ['name' => 'price_closing', 'value' => $item['price_closing'], 'class' => 'p-form-check__tbl-txt-closed-price','placeholder' => '成約価格'])<span>万円</span>
        @include('business.objects.components.input', ['name' => 'close_date', 'value' => $item['close_date'], 'class' => 'cal_picker p-form-check__tbl-closed-day'])
      </td>
    </tr>
    <tr style="height:85px;">
      <td colspan="2" class="p-2">
        <dl class="p-form-check__dl">
        <dt>BK</dt><dd>@include('business.objects.components.input', ['name' => 'bk', 'value' => $lot['bk'], 'class' => 'p-form-check__tbl-bk m-0'])</dd>
        <dt>鍵</dt><dd>@include('business.objects.components.input', ['name' => 'key_text', 'value' => $lot['key_text'], 'class' => 'p-form-check__tbl-key m-0'])</dd>
      </dl>
      <dl class="p-form-check__dl mt-2">
        <dt>備考</dt><dd class="p-form-check__dl-long">@include('business.objects.components.input', ['name' => 'memo1', 'value' => $lot['memo1'], 'class' => 'p-form-check__tbl-biko m-0 mt-2'])</dd>
      </dl>
      </td>
    </tr>
  </table>

  </div>
  </form>
</div>
