<?php
    $ad_conf = [
//        ['code' => '', 'name' => ''],
        ['code' => 1, 'name' => '未'],
        ['code' => 2, 'name' => '可'],
        ['code' => 3, 'name' => '不可'],
    ];

    $print = [
        ['code' => 1, 'name' => ''],
    ];

    $all_check = [
        ['code' => 1, 'name' => '全件チェック'],
    ];

    $change_price = [
        ['code' => 1, 'name' => '価格変更'],
    ];

?>
<?php
    $searchArt = true;

    // 並び替えデータ
    $sorts = $sorts ?? [];
    /*
    $sort = new stdClass();
    $sort->name = '新着順';
    $sort->class = 'new';
    array_push($sorts, $sort);

    $sort = new stdClass();
    $sort->name = '新価格';
    $sort->class = 'newprice';
    array_push($sorts, $sort);
    */
    $sort = new stdClass();
    $sort->name = '業者名';
    $sort->class = 'vendor';
    array_push($sorts, $sort);


    $sort = new stdClass();
    $sort->name = '電話番号';
    $sort->class = 'phone_num';
    array_push($sorts, $sort);
    /*
    $sort = new stdClass();
    $sort->name = '物件種別順';
    $sort->class = 'property';
    array_push($sorts, $sort);

    $sort = new stdClass();
    $sort->name = '所在地順';
    $sort->class = 'address';
    array_push($sorts, $sort);

    $sort = new stdClass();
    $sort->name = '沿線・駅順';
    $sort->class = 'line';
    array_push($sorts, $sort);

    $sort = new stdClass();
    $sort->name = '業者順';
    $sort->class = 'vendor';
    array_push($sorts, $sort);
    */

    if(!isset($searchArt)) {
        request()->merge(['url_search' => url()->current()]);
        session(['search_request' => json_encode(request()->all())]);
    }
?>




<?php $__env->startSection('contents'); ?>
    
    <div class="mt5">
        <input type="hidden" name="" id="url-delete-vendor" value="<?php echo e(route('vendor-delete')); ?>">
        <?php echo $__env->make('admin.objects.components.vendor-tab', ['title' => '業者管理'], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
        <?php echo $__env->make('admin.objects.components.regist-band', ['title' => '検索一覧'], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
        <div class="result_vendor">
            <div class="d-flex justify-content-between pager mt10">
                <div class="m-2"><span class="pager-total">検索結果&nbsp;<?php echo e($list->total()); ?></span><span>件中&nbsp; <?php echo e($first); ?>〜<?php echo e($last); ?>件表示</span>
                </div>
                <div class="mt-2"><?php echo e($list->appends($params)->links()); ?></div>
            </div>
            <?php echo $__env->make('admin.objects.projects.results-sort', ['sorts' => $sorts, 'multipleSort' => false], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
            <?php echo $__env->make('business.objects.projects.form-to-other', ['action' => route('business-for-sale-detail', ['id' => '']), 'id' => 'link_detail', 'params' => $params], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
            <div class="d-flex mb10">
                <div class="pt-3 pl-2">
                    <?php echo $__env->make('admin.objects.components.checkbox', ['name' => 'all_check_vendor', 'checkbox' => $all_check], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                </div>
                <form method="POST" action="<?php echo e(route('vendor-print')); ?>?<?php echo e(http_build_query($params)); ?>"
                      target="_blank">
                    <?php echo e(csrf_field()); ?>

                    <?php if(!empty($params)): ?>
                        <?php $__currentLoopData = $params; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $vl): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <input type="hidden" name="<?php echo e($key); ?>" value="<?php echo e($vl); ?>">
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    <?php endif; ?>
                    <?php echo $__env->make('admin.objects.components.btn', ['name' => 'print_fax', 'type' => 'button', 'class' => 'w300i btn_allcheck', 'title' => 'チェックした業者へ一括FAX'], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                    <?php echo $__env->make('admin.objects.components.hidden', ['name' => 'print_id_list'], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                    <?php echo $__env->make('admin.objects.components.hidden', ['name' => 'target_shop', 'value' => $search_shop], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                </form>
            </div>
            <?php $__currentLoopData = $list; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <?php if($disp_flag): ?>
                    <table class="p-vendor-list">
                        <tr class="p-vendor-list__headline">
                            <td rowspan="<?php echo e(count($row->article)+1); ?>" class="parent_td p-vendor-list__checkarea">
                                <?php echo $__env->make('admin.objects.components.checkbox', ['name' => 'print', 'checkbox' => $print], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                                <?php echo $__env->make('admin.objects.components.hidden', ['name' => 'print_id', 'value' => $row->id], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                            </td>
                            <td class="w80">
                                <p>登録数</p>
                                <span><a href="#searchPanel" name="" class="target_link_id p-vendor-list__displink"><?php echo e(count($row->article)); ?>件</a></span>
                            </td>
                            <td class="w80">
                                <p>業者番号</p>
                                <span><a href="/admin/editVendor/<?php echo e($row->id); ?>"
                                         class="target_link_id"><?php echo e($row->id); ?></a></span>
                            </td>
                            <td class="td_title">業者名</td>
                            <td class="w280"><?php echo e($row->name); ?></td>
                            <td class="td_title">電話</td>
                            <td class="w150"><?php echo e($row->vendor_tel1); ?></td>
                            <td class="td_title">FAX</td>
                            <td class="w150"><?php echo e($row->vendor_fax); ?></td>
                            <td>
                                <div class="d-flex justify-content-center">
                                    <a href="/admin/editVendor/<?php echo e($row->id); ?>" class="edit_vendor_btn "
                                       name="edit_vendor">編集</a>
                                    <?php if(auth()->user()->isAdministrator()): ?>
                                        <button class="del_vendor_btn delete_vendor unset-modal-overlay" name=""
                                                data-toggle="modal" data-target="#deleteModal<?php echo e($row->id); ?>">削除
                                        </button>
                                        <div class="delete-vendor-item">
                                            <?php echo csrf_field(); ?>
                                            <?php echo $__env->make('admin.objects.components.modal_confirm_delete', ['id' => $row->id, 'message' => 'この業者を削除しますがよろしいですか？'], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                                        </div>
                                        
                                        
                                        
                                        
                                    <?php endif; ?>
                                </div>
                            </td>
                        </tr>
                        <?php $__currentLoopData = $row->article; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $article): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <tr class="child row-house">
                                <td colspan="9" class="article_list p-0" style="display: none;">
                                    <form>
                                        <?php echo $__env->make('admin.objects.components.hidden', ['name' => 'article_id', 'value' => $article->building_id], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                                        <?php echo $__env->make('admin.objects.components.hidden', ['name' => 'vendor_id', 'value' => $row->id], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                                        <table class="p-vendor-list__subtbl">
                                            <tr>
                                                <td rowspan="6" class="w30 p-vendor-list__subtbl-nm">
                                                    <span class="row_iteration"><?php echo e($loop->iteration); ?></span><br>
                                                </td>
                                                <td rowspan="6" class="w85">
                                                    物件番号<br>
                                                    <a href="
                                    <?php if($article->property == null): ?>
                                    <?php echo e(route('showEditRoom', ['mid' => $article->mansion_id, 'id' => $article->building_id])); ?>

                                    <?php elseif($article->property == 1): ?>
                                    <?php echo e(route('showEditLand', ['id' => $article->building_id])); ?>

                                    <?php elseif($article->property == 2): ?>
                                    <?php echo e(route('showEditLand', ['id' => $article->building_id])); ?>

                                    <?php elseif($article->property == 3): ?>
                                    <?php echo e(route('showEditLand', ['id' => $article->building_id])); ?>

                                    <?php elseif($article->property == 4): ?>
                                    <?php echo e(route('showEditHouse', ['id' => $article->building_id])); ?>

                                    <?php elseif($article->property == 5): ?>
                                    <?php echo e(route('showEditHouse', ['id' => $article->building_id])); ?>

                                    <?php elseif($article->property == 6): ?>
                                    <?php echo e(route('showEditMansion', ['id' => $article->building_id])); ?>

                                    <?php elseif($article->property == 7): ?>
                                    <?php echo e(route('showEditMansion', ['id' => $article->building_id])); ?>

                                    <?php endif; ?>
                                    " class="target_link_id" target="_blank"><?php echo e($article->building_id); ?></a><br>
                                                    物件登録日<br>
                                                    <span
                                                        class="p-vendor-list__subtbl__createdtext"><?php echo e($article->created_at); ?></span>
                                                    <span><?php echo e($article->shop_name); ?></span>
                                                    <div class="p-vendor-list__subtbl__savearea_ad">
                                                        <span class="p-vendor-list__subtbl__select">物件確認日</span><br>
                                                        <?php $acd = $article->conf_day; ?>
                                                        <?php echo $__env->make('admin.objects.components.input', ['name' => 'article_conf_day', 'class' => 'cal_picker w115', 'placeholder' => '0000/00/00', 'value' => $acd], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                                                    </div>
                                                    <input type="button" value="保存" class="p-vendor-list__subtbl__btn">
                                                </td>

                                                <th>物件名</th>
                                                <td class="w220"><?php echo e($article->name); ?></td>
                                                <th>所在地</th>
                                                <td colspan="2"><?php echo e($article->address_info); ?></td>

                                                <th>価格</th>
                                                <td class="w120"><?php echo e(number_format($article->newPrice, 0, ",", ",")); ?>万円
                                                </td>
                                                <th>土地</th>
                                                <td class="w120"><?php echo e($article->land_area_val); ?>m&sup2;</td>
                                            </tr>
                                            <tr>
                                                <th>種別</th>
                                                <td>
                                                    <?php if($article->property == 1): ?>
                                                        土地
                                                    <?php elseif($article->property == 2): ?>
                                                        土地（借地権）
                                                    <?php elseif($article->property == 3): ?>
                                                        土地（底地権）
                                                    <?php elseif($article->property == 4): ?>
                                                        <?php if($article->property_sub == 1): ?>
                                                            新築一戸建て
                                                        <?php else: ?>
                                                            中古一戸建て
                                                        <?php endif; ?>
                                                    <?php elseif($article->property == 5): ?>
                                                        <?php if($article->property_sub == 1): ?>
                                                            新築テラスハウス
                                                        <?php else: ?>
                                                            中古テラスハウス
                                                        <?php endif; ?>
                                                    <?php elseif(isset($article->mansion) && $article->propertyMansion == 6 && $article->propertySubMansion == 1): ?>
                                                        新築マンション
                                                    <?php elseif(isset($article->mansion) && $article->propertyMansion == 6 && $article->propertySubMansion == 2): ?>
                                                        中古マンション
                                                    <?php elseif(isset($article->mansion) && $article->propertyMansion == 7 && $article->propertySubMansion == 1): ?>
                                                        新築タウンハウス
                                                    <?php elseif(isset($article->mansion) && $article->propertyMansion == 7 && $article->propertySubMansion == 2): ?>
                                                        中古タウンハウス
                                                        
                                                        
                                                    <?php endif; ?>
                                                </td>
                                                <th rowspan="2">交通</th>
                                                <td rowspan="2" colspan="2">
                                                    <?php if(!empty($article->main_traffic_line) and !empty($article->main_traffic_station) and ($article->main_traffic == 1 and $article->main_traffic_time or ($article->main_traffic == 2 and ($article->main_traffic_bus_time or $article->main_traffic_bus_walk)))): ?>
                                                        <?php echo e($article->main_traffic_line); ?>

                                                        「<?php echo e($article->main_traffic_station); ?>」駅　
                                                        <?php if($article->main_traffic == 1): ?>
                                                            徒歩<?php echo e($article->main_traffic_time); ?>分
                                                        <?php else: ?>
                                                            バス<?php echo e($article->main_traffic_bus_time); ?>分
                                                            <?php if($article->main_traffic_bus): ?>
                                                                「<?php echo e($article->main_traffic_bus); ?>」
                                                            <?php endif; ?>
                                                            停歩<?php echo e($article->main_traffic_bus_walk); ?>分
                                                        <?php endif; ?>
                                                        <?php if(!empty($article->sub_traffic1_line) and !empty($article->sub_traffic1_station) and ($article->sub_traffic1 == 1 and $article->sub_traffic1_time or ($article->sub_traffic1 == 2 and ($article->sub_traffic1_bus_time or $article->sub_traffic1_bus_walk)))): ?>
                                                            <br/><?php echo e($article->sub_traffic1_line); ?>

                                                            「<?php echo e($article->sub_traffic1_station); ?>」駅　
                                                            <?php if($article->sub_traffic1 == 1): ?>
                                                                徒歩<?php echo e($article->sub_traffic1_time); ?>分
                                                            <?php else: ?>
                                                                バス<?php echo e($article->sub_traffic1_bus_time); ?>分
                                                                <?php if($article->sub_traffic1_bus): ?>
                                                                    「<?php echo e($article->sub_traffic1_bus); ?>」
                                                                <?php endif; ?>
                                                                停歩<?php echo e($article->sub_traffic1_bus_walk); ?>分
                                                            <?php endif; ?>
                                                        <?php endif; ?>
                                                        <?php if(!empty($article->sub_traffic2_line) and !empty($article->sub_traffic2_station) and ($article->sub_traffic2 == 1 and $article->sub_traffic2_time or ($article->sub_traffic2 == 2 and ($article->sub_traffic2_bus_time or $article->sub_traffic2_bus_walk)))): ?>
                                                            <br/><?php echo e($article->sub_traffic2_line); ?>

                                                            「<?php echo e($article->sub_traffic2_station); ?>」駅　
                                                            <?php if($article->sub_traffic2 == 1): ?>
                                                                徒歩<?php echo e($article->sub_traffic2_time); ?>分
                                                            <?php else: ?>
                                                                バス<?php echo e($article->sub_traffic2_bus_time); ?>分
                                                                <?php if($article->sub_traffic2_bus): ?>
                                                                    「<?php echo e($article->sub_traffic2_bus); ?>」
                                                                <?php endif; ?>
                                                                停歩<?php echo e($article->sub_traffic2_bus_walk); ?>分
                                                            <?php endif; ?>
                                                        <?php endif; ?>
                                                    <?php elseif(!empty($article->else_traffic_line) and !empty($article->else_traffic_station) and ($article->else_traffic == 1 and $article->else_traffic_time or ($article->else_traffic == 2 and ($article->else_traffic_bus_time or $article->else_traffic_bus_walk)))): ?>
                                                        <?php echo e($article->else_traffic_line); ?>

                                                        「<?php echo e($article->else_traffic_station); ?>」駅　
                                                        <?php if($article->else_traffic == 1): ?>
                                                            徒歩<?php echo e($article->else_traffic_time); ?>分
                                                        <?php else: ?>
                                                            バス<?php echo e($article->else_traffic_bus_time); ?>分
                                                            <?php if($article->else_traffic_bus): ?>
                                                                「<?php echo e($article->else_traffic_bus); ?>」
                                                            <?php endif; ?>
                                                            停歩<?php echo e($article->else_traffic_bus_walk); ?>分
                                                        <?php endif; ?>
                                                    <?php endif; ?>
                                                </td>
                                                <th>築年月</th>
                                                <td>
                                                    <?php if(isset($article->age_year)): ?>
                                                        <?php echo e($article->age_year); ?>/<?php echo e($article->age_month); ?>

                                                    <?php else: ?>
                                                        -
                                                    <?php endif; ?>
                                                </td>
                                                <th>延床</th>
                                                <td>
                                                    <?php echo e($article->total_area_val?? '-'); ?>m&sup2;
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>校区</th>
                                                <td>
                                                    <?php if(isset($article->primary_school_name) || isset($article->secondary_school_name)): ?>
                                                        <?php echo e($article->primary_school_name?? "-"); ?>/<?php echo e($article->secondary_school_name?? "-"); ?>

                                                    <?php elseif(isset($article->other_primary_school_2) || isset($article->other_secondary_school_2)): ?>
                                                        <?php echo e($article->other_primary_school_2 ?? "-"); ?>/<?php echo e($article->other_secondary_school_2 ?? "-"); ?>

                                                    <?php else: ?>
                                                        -/-
                                                    <?php endif; ?>
                                                </td>
                                                <th>階数</th>
                                                <td>
                                                    <?php if($article->property==1 || $article->property==2 || $article->property==3): ?>
                                                        -
                                                    <?php elseif($article->property==4 || $article->property==5): ?>
                                                        <?php echo e($article->floor?? "-"); ?>階建
                                                    <?php else: ?>
                                                        <?php if($article->maisonette==1): ?>
                                                            <?php echo e($article->maisonette_from ? $article->maisonette_from : ''); ?>

                                                            〜<?php echo e($article->maisonette_to ? $article->maisonette_to : ''); ?>

                                                        <?php else: ?>
                                                            <?php echo e($article->whereabouts?? "-"); ?>

                                                        <?php endif; ?>
                                                        階/<?php echo e($article->floor?? "-"); ?>階建
                                                    <?php endif; ?>
                                                </td>
                                                <th>間取り</th>
                                                <td>
                                                    <?php if(isset($article->floor_plan)): ?>
                                                        <?php echo e($article->floor_plan); ?><?php if($article->floor_plan_type != null): ?>
                                                            <?php echo e($floor_type[$article->floor_plan_type]); ?>

                                                        <?php endif; ?>
                                                    <?php else: ?>
                                                        -
                                                    <?php endif; ?>
                                                </td>
                                            </tr>
                                            <tr class="p-vendor-list__subtbl__savearea">
                                                <td colspan="4" rowspan="2">

                                                    <div class="d-flex">
                                                        <div class="p-vendor-list__subtbl__savearea__ad">
                                                            <span class="p-vendor-list__subtbl__select">チラシ</span><br>
                                                            <?php echo $__env->make('admin.objects.components.selectbox', ['name' => 'flyer', 'options' => $ad_conf, 'selected' => $article->flyer], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                                                        </div>
                                                        <div class="p-vendor-list__subtbl__savearea__ad">
                                                            <span class="p-vendor-list__subtbl__select">情報誌</span><br>
                                                            <?php echo $__env->make('admin.objects.components.selectbox', ['name' => 'freepaper', 'options' => $ad_conf, 'selected' => $article->freepaper], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                                                        </div>
                                                        <div class="p-vendor-list__subtbl__savearea__ad">
                                                            <span class="p-vendor-list__subtbl__select">自社HP</span><br>
                                                            <?php echo $__env->make('admin.objects.components.selectbox', ['name' => 'house_hp', 'options' => $ad_conf, 'selected' => $article->house_hp], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                                                        </div>
                                                        <div class="p-vendor-list__subtbl__savearea__ad">
                                                            <span class="p-vendor-list__subtbl__select">ポータル</span><br>
                                                            <?php echo $__env->make('admin.objects.components.selectbox', ['name' => 'portal', 'options' => $ad_conf, 'selected' => $article->portal], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                                                        </div>
                                                        <div class="p-vendor-list__subtbl__savearea__ad">
                                                            <span class="p-vendor-list__subtbl__select">現地看板</span><br>
                                                            <?php echo $__env->make('admin.objects.components.selectbox', ['name' => 'signboard', 'options' => $ad_conf, 'selected' => $article->signboard], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                                                        </div>
                                                        <div class="">
                                                            <span class="p-vendor-list__subtbl__select">確認手法</span><br>
                                                            <?php echo $__env->make('admin.objects.components.selectbox', ['name' => 'ad_conf', 'options' => $method_conf, 'selected' => $article->ad_conf], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                                                        </div>
                                                        <div>
                                                            <span class="p-vendor-list__subtbl__select">広告確認日</span><br>
                                                            <?php echo $__env->make('admin.objects.components.input', ['name' => 'ad_conf_day', 'class' => 'cal_picker w115', 'placeholder' => '0000/00/00', 'value' => $article->ad_conf_day], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                                                        </div>
                                                    </div>
                                                </td>
                                                <td class="w125">
                                                    <?php echo $__env->make('admin.objects.components.input', ['name' => 'charge', 'value' => $article->charge, 'placeholder' => '', 'class' => 'w125','placeholder' => '担当'], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                                                </td>
                                                <td colspan="4">
                                                    <?php echo $__env->make('admin.objects.components.checkbox', ['name' => 'change_flag', 'checkbox' => [['code' => 1, 'name' => '価格変更', 'data_id' => $article->building_id]]], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                                                    <span class="box-price-history-<?php echo e($article->building_id); ?>"
                                                          style="display: none">
                                        <?php echo $__env->make('admin.objects.components.input', ['name' => 'change_price', 'placeholder' => '価格変更', 'class' => 'w65' ], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>万円
                                        <?php echo $__env->make('admin.objects.components.input', ['name' => 'change_price_date', 'class' => 'cal_picker w115', 'placeholder' => '価格変更日'], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                                                        <?php echo $__env->make('business.objects.components.link', ['url' => '', 'title' => '履歴('.(count($article->history)?? 0).')',
                                                    'class' => 'modal-open-history p-form-check__tbl-link-history', 'history_count' => count($article->history)?? 0, 'data_num' => $article->id??'', 'history_price_change' => 'room_building_id'], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                                    </span>
                                                </td>
                                            </tr>
                                            <tr class="p-vendor-list__subtbl__savearea">
                                                <td>
                                                    <?php echo $__env->make('admin.objects.components.selectbox', ['name' => 'manner', 'options' => $manner, 'title' => '取引態様', 'selected' => $article->manner], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                                                </td>
                                                <td colspan="4">
                                                    <?php echo $__env->make('admin.objects.components.selectbox', ['name' => 'status', 'options' => $statuses, 'selected' => $article->status], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                                                    <?php echo $__env->make('admin.objects.components.input', ['name' => 'price_closing', 'value' => $article->price_closing, 'placeholder' => '成約価格', 'class' => 'w65', 'value' => $article->price_closing], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                                                    万円
                                                    <?php echo $__env->make('admin.objects.components.input', ['name' => 'close_date', 'value' => $article->price_closing, 'class' => 'cal_picker w115', 'value' => $article->close_date, 'placeholder' => '成約日'], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>備考</th>
                                                <td colspan="8">
                                                    <?php echo $__env->make('admin.objects.components.input', ['name' => 'home_note', 'value' => $article->home_note ,'placeholder' => '備考', 'class' => 'w-100' ], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                                                </td>
                                            </tr>
                                        </table>
                                    </form>
                                    <?php echo $__env->make('admin.objects.projects.modal-history', ['history' => $article->history, 'data_num' => $article->id], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                                </td>
                            </tr>

                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </table>
                <?php else: ?>
                    <?php if($row->count > 0 && count($row->article)>0): ?>
                        <table class="p-vendor-list">
                            <tr>
                                <td rowspan="<?php echo e(count($row->article)+1); ?>" class="parent_td p-vendor-list__checkarea">
                                    <?php echo $__env->make('admin.objects.components.checkbox', ['name' => 'print', 'checkbox' => $print], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                                    <?php echo $__env->make('admin.objects.components.hidden', ['name' => 'print_id', 'value' => $row->id], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                                </td>
                                <td class="w80">
                                    <p>登録数</p>
                                    <span><a href="#searchPanel" name="" class="target_link_id p-vendor-list__displink"><?php echo e($row->count); ?>件</a></span>
                                </td>
                                <td class="w80">
                                    <p>業者番号</p>
                                    <span><a href="/admin/editVendor/<?php echo e($row->id); ?>"
                                             class="target_link_id"><?php echo e($row->id); ?></a></span>
                                </td>
                                <td class="td_title">業者名</td>
                                <td><?php echo e($row->name); ?></td>
                                <td class="td_title">電話</td>
                                <td class="w200"><?php echo e($row->vendor_tel1); ?></td>
                                <td class="td_title">FAX</td>
                                <td class="w200"><?php echo e($row->vendor_fax); ?></td>
                            </tr>
                            <?php $__currentLoopData = $row->article; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $article): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <tr class="child row-house">
                                    <td colspan="8" class="article_list p-0" style="display: none;">
                                        <form>
                                            <?php echo $__env->make('admin.objects.components.hidden', ['name' => 'article_id', 'value' => $article->building_id], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                                            <?php echo $__env->make('admin.objects.components.hidden', ['name' => 'vendor_id', 'value' => $row->id], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                                            <table class="p-vendor-list__subtbl">
                                                <tr>
                                                    <td rowspan="6" class="w30 p-vendor-list__subtbl-nm">
                                                        <span class="row_iteration"><?php echo e($loop->iteration); ?></span><br>
                                                    </td>
                                                    <td rowspan="6" class="w85">
                                                        物件番号<br>
                                                        <a href="
                                    <?php if($article->property == null): ?>
                                    <?php echo e(route('showEditRoom', ['mid' => $article->mansion_id, 'id' => $article->building_id])); ?>

                                    <?php elseif($article->property == 1): ?>
                                    <?php echo e(route('showEditLand', ['id' => $article->building_id])); ?>

                                    <?php elseif($article->property == 2): ?>
                                    <?php echo e(route('showEditLand', ['id' => $article->building_id])); ?>

                                    <?php elseif($article->property == 3): ?>
                                    <?php echo e(route('showEditLand', ['id' => $article->building_id])); ?>

                                    <?php elseif($article->property == 4): ?>
                                    <?php echo e(route('showEditHouse', ['id' => $article->building_id])); ?>

                                    <?php elseif($article->property == 5): ?>
                                    <?php echo e(route('showEditHouse', ['id' => $article->building_id])); ?>

                                    <?php elseif($article->property == 6): ?>
                                    <?php echo e(route('showEditMansion', ['id' => $article->building_id])); ?>

                                    <?php elseif($article->property == 7): ?>
                                    <?php echo e(route('showEditMansion', ['id' => $article->building_id])); ?>

                                    <?php endif; ?>
                                    " class="target_link_id" target="_blank"><?php echo e($article->building_id); ?></a><br>
                                                        物件登録日<br>
                                                        <span
                                                            class="p-vendor-list__subtbl__createdtext"><?php echo e($article->created_at); ?></span>
                                                        <span><?php echo e($article->shop_name); ?></span>
                                                        <div class="p-vendor-list__subtbl__savearea_ad">
                                                            物件確認日<br>
                                                            <?php echo $__env->make('admin.objects.components.input', ['name' => 'article_conf_day', 'class' => 'cal_picker w115', 'placeholder' => '0000/00/00', 'value' => $article->conf_day], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                                                        </div>
                                                        <input type="button" value="保存"
                                                               class="p-vendor-list__subtbl__btn">
                                                    </td>

                                                    <th>物件名</th>
                                                    <td class="w220"><?php echo e($article->name); ?></td>
                                                    <th>所在地</th>
                                                    <td colspan="2"><?php echo e($article->address_info); ?></td>

                                                    <th>価格</th>
                                                    <td class="w120"><?php echo e($article->price); ?>万円</td>
                                                    <th>土地</th>
                                                    <td class="w120"><?php echo e($article->land_area_val); ?>m&sup2;</td>
                                                </tr>
                                                <tr>
                                                    <th>種別</th>
                                                    <td>
                                                        <?php if($article->property == 1): ?>
                                                            土地
                                                        <?php elseif($article->property == 2): ?>
                                                            土地（借地権）
                                                        <?php elseif($article->property == 3): ?>
                                                            土地（底地権）
                                                        <?php elseif($article->property == 4): ?>
                                                            <?php if($article->property_sub == 1): ?>
                                                                新築一戸建て
                                                            <?php else: ?>
                                                                中古一戸建て
                                                            <?php endif; ?>
                                                        <?php elseif($article->property == 5): ?>
                                                            <?php if($article->property_sub == 1): ?>
                                                                新築テラスハウス
                                                            <?php else: ?>
                                                                中古テラスハウス
                                                            <?php endif; ?>
                                                        <?php elseif(isset($article->mansion) && $article->propertyMansion == 6 && $article->propertySubMansion == 1): ?>
                                                            新築マンション
                                                        <?php elseif(isset($article->mansion) && $article->propertyMansion == 6 && $article->propertySubMansion == 2): ?>
                                                            中古マンション
                                                        <?php elseif(isset($article->mansion) && $article->propertyMansion == 7 && $article->propertySubMansion == 1): ?>
                                                            新築タウンハウス
                                                        <?php elseif(isset($article->mansion) && $article->propertyMansion == 7 && $article->propertySubMansion == 2): ?>
                                                            中古タウンハウス
                                                            
                                                            
                                                        <?php endif; ?>
                                                    </td>
                                                    <th rowspan="2">交通</th>
                                                    <td rowspan="2" colspan="2">
                                                        <?php if(!empty($article->main_traffic_line) and !empty($article->main_traffic_station) and ($article->main_traffic == 1 and $article->main_traffic_time or ($article->main_traffic == 2 and ($article->main_traffic_bus_time or $article->main_traffic_bus_walk)))): ?>
                                                            <?php echo e($article->main_traffic_line); ?>

                                                            「<?php echo e($article->main_traffic_station); ?>」駅　
                                                            <?php if($article->main_traffic == 1): ?>
                                                                徒歩<?php echo e($article->main_traffic_time); ?>分
                                                            <?php else: ?>
                                                                バス<?php echo e($article->main_traffic_bus_time); ?>分
                                                                <?php if($article->main_traffic_bus): ?>
                                                                    「<?php echo e($article->main_traffic_bus); ?>」
                                                                <?php endif; ?>
                                                                停歩<?php echo e($article->main_traffic_bus_walk); ?>分
                                                            <?php endif; ?>
                                                            <?php if(!empty($article->sub_traffic1_line) and !empty($article->sub_traffic1_station) and ($article->sub_traffic1 == 1 and $article->sub_traffic1_time or ($article->sub_traffic1 == 2 and ($article->sub_traffic1_bus_time or $article->sub_traffic1_bus_walk)))): ?>
                                                                <br/><?php echo e($article->sub_traffic1_line); ?>

                                                                「<?php echo e($article->sub_traffic1_station); ?>」駅　
                                                                <?php if($article->sub_traffic1 == 1): ?>
                                                                    徒歩<?php echo e($article->sub_traffic1_time); ?>分
                                                                <?php else: ?>
                                                                    バス<?php echo e($article->sub_traffic1_bus_time); ?>分
                                                                    <?php if($article->sub_traffic1_bus): ?>
                                                                        「<?php echo e($article->sub_traffic1_bus); ?>」
                                                                    <?php endif; ?>
                                                                    停歩<?php echo e($article->sub_traffic1_bus_walk); ?>分
                                                                <?php endif; ?>
                                                            <?php endif; ?>
                                                            <?php if(!empty($article->sub_traffic2_line) and !empty($article->sub_traffic2_station) and ($article->sub_traffic2 == 1 and $article->sub_traffic2_time or ($article->sub_traffic2 == 2 and ($article->sub_traffic2_bus_time or $article->sub_traffic2_bus_walk)))): ?>
                                                                <br/><?php echo e($article->sub_traffic2_line); ?>

                                                                「<?php echo e($article->sub_traffic2_station); ?>」駅　
                                                                <?php if($article->sub_traffic2 == 1): ?>
                                                                    徒歩<?php echo e($article->sub_traffic2_time); ?>分
                                                                <?php else: ?>
                                                                    バス<?php echo e($article->sub_traffic2_bus_time); ?>分
                                                                    <?php if($article->sub_traffic2_bus): ?>
                                                                        「<?php echo e($article->sub_traffic2_bus); ?>」
                                                                    <?php endif; ?>
                                                                    停歩<?php echo e($article->sub_traffic2_bus_walk); ?>分
                                                                <?php endif; ?>
                                                            <?php endif; ?>
                                                        <?php elseif(!empty($article->else_traffic_line) and !empty($article->else_traffic_station) and ($article->else_traffic == 1 and $article->else_traffic_time or ($article->else_traffic == 2 and ($article->else_traffic_bus_time or $article->else_traffic_bus_walk)))): ?>
                                                            <?php echo e($article->else_traffic_line); ?>

                                                            「<?php echo e($article->else_traffic_station); ?>」駅　
                                                            <?php if($article->else_traffic == 1): ?>
                                                                徒歩<?php echo e($article->else_traffic_time); ?>分
                                                            <?php else: ?>
                                                                バス<?php echo e($article->else_traffic_bus_time); ?>分
                                                                <?php if($article->else_traffic_bus): ?>
                                                                    「<?php echo e($article->else_traffic_bus); ?>」
                                                                <?php endif; ?>
                                                                停歩<?php echo e($article->else_traffic_bus_walk); ?>分
                                                            <?php endif; ?>
                                                        <?php endif; ?>
                                                    </td>
                                                    <th>築年月</th>
                                                    <td>
                                                        <?php if(isset($article->age_year)): ?>
                                                            <?php echo e($article->age_year); ?>/<?php echo e($article->age_month); ?>

                                                        <?php else: ?>
                                                            -
                                                        <?php endif; ?>
                                                    </td>
                                                    <th>延床</th>
                                                    <td>
                                                        <?php echo e($article->total_area_val?? '-'); ?>m&sup2;
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <th>校区</th>
                                                    <td>
                                                        <?php if(isset($article->primary_school_name) || isset($article->secondary_school_name)): ?>
                                                            <?php echo e($article->primary_school_name?? "-"); ?>/<?php echo e($article->secondary_school_name?? "-"); ?>

                                                        <?php elseif(isset($article->other_primary_school_2) || isset($article->other_secondary_school_2)): ?>
                                                            <?php echo e($article->other_primary_school_2 ?? "-"); ?>/<?php echo e($article->other_secondary_school_2 ?? "-"); ?>

                                                        <?php else: ?>
                                                            -/-
                                                        <?php endif; ?>
                                                    </td>
                                                    <th>階数</th>
                                                    <td>
                                                        <?php if($article->property==1 || $article->property==2 || $article->property==3): ?>
                                                            -
                                                        <?php elseif($article->property==4 || $article->property==5): ?>
                                                            <?php echo e($article->floor?? "-"); ?>階建
                                                        <?php else: ?>
                                                            <?php if($article->maisonette==1): ?>
                                                                <?php echo e($article->maisonette_from ? $article->maisonette_from : ''); ?>

                                                                〜<?php echo e($article->maisonette_to ? $article->maisonette_to : ''); ?>

                                                            <?php else: ?>
                                                                <?php echo e($article->whereabouts?? "-"); ?>

                                                            <?php endif; ?>
                                                            階/<?php echo e($article->floor?? "-"); ?>階建
                                                        <?php endif; ?>
                                                    </td>
                                                    <th>間取り</th>
                                                    <td>
                                                        <?php if(isset($article->floor_plan)): ?>
                                                            <?php echo e($article->floor_plan); ?><?php if($article->floor_plan_type != null): ?>
                                                                <?php echo e($floor_type[$article->floor_plan_type]??'-'); ?>

                                                            <?php endif; ?>
                                                        <?php else: ?>
                                                            -
                                                        <?php endif; ?>
                                                    </td>
                                                </tr>
                                                <tr class="p-vendor-list__subtbl__savearea">
                                                    <td colspan="4" rowspan="2">

                                                        <div class="d-flex">
                                                            <div class="p-vendor-list__subtbl__savearea__ad">
                                                                <span
                                                                    class="p-vendor-list__subtbl__select">チラシ</span><br>
                                                                <?php echo $__env->make('admin.objects.components.selectbox', ['name' => 'flyer', 'options' => $ad_conf, 'selected' => $article->flyer], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                                                            </div>
                                                            <div class="p-vendor-list__subtbl__savearea__ad">
                                                                <span
                                                                    class="p-vendor-list__subtbl__select">情報誌</span><br>
                                                                <?php echo $__env->make('admin.objects.components.selectbox', ['name' => 'freepaper', 'options' => $ad_conf, 'selected' => $article->freepaper], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                                                            </div>
                                                            <div class="p-vendor-list__subtbl__savearea__ad">
                                                                <span
                                                                    class="p-vendor-list__subtbl__select">自社HP</span><br>
                                                                <?php echo $__env->make('admin.objects.components.selectbox', ['name' => 'house_hp', 'options' => $ad_conf, 'selected' => $article->house_hp], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                                                            </div>
                                                            <div class="p-vendor-list__subtbl__savearea__ad">
                                                                <span
                                                                    class="p-vendor-list__subtbl__select">ポータル</span><br>
                                                                <?php echo $__env->make('admin.objects.components.selectbox', ['name' => 'portal', 'options' => $ad_conf, 'selected' => $article->portal], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                                                            </div>
                                                            <div class="p-vendor-list__subtbl__savearea__ad">
                                                                <span
                                                                    class="p-vendor-list__subtbl__select">現地看板</span><br>
                                                                <?php echo $__env->make('admin.objects.components.selectbox', ['name' => 'signboard', 'options' => $ad_conf, 'selected' => $article->signboard], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                                                            </div>
                                                            <div class="">
                                                                <span
                                                                    class="p-vendor-list__subtbl__select">確認手法</span><br>
                                                                <?php echo $__env->make('admin.objects.components.selectbox', ['name' => 'ad_conf', 'options' => $method_conf, 'selected' => $article->ad_conf], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                                                            </div>
                                                            <div>
                                                                <span class="p-vendor-list__subtbl__select">広告確認日</span><br>
                                                                <?php echo $__env->make('admin.objects.components.input', ['name' => 'ad_conf_day', 'class' => 'cal_picker w115', 'placeholder' => '0000/00/00', 'value' => $article->ad_conf_day], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                                                            </div>
                                                        </div>
                                                    </td>
                                                    <td class="w125">
                                                        <?php echo $__env->make('admin.objects.components.input', ['name' => 'charge', 'value' => $article->charge, 'placeholder' => '', 'class' => 'w125'], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                                                    </td>
                                                    <td colspan="4">
                                                        <?php echo $__env->make('admin.objects.components.checkbox', ['name' => 'change_flag', 'checkbox' => $change_price], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                                                        <?php echo $__env->make('admin.objects.components.input', ['name' => 'change_price', 'placeholder' => '価格変更', 'class' => 'w65' ], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                                                        万円
                                                        <?php echo $__env->make('admin.objects.components.input', ['name' => 'change_price_date', 'class' => 'cal_picker w115', 'placeholder' => '価格変更日'], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>

                                                        <?php echo $__env->make('business.objects.components.link', ['url' => '', 'title' => '履歴('.(count($article->history)?? 0).')',
                                                              'class' => 'modal-open-history p-form-check__tbl-link-history', 'history_count' => count($article->history)?? 0, 'data_num' => $article->id??'', 'history_price_change' => 'room_building_id'], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                                                    </td>
                                                </tr>
                                                <tr class="p-vendor-list__subtbl__savearea">
                                                    <td>
                                                        <?php echo $__env->make('admin.objects.components.selectbox', ['name' => 'manner', 'options' => $manner, 'selected' => $article->manner], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                                                    </td>
                                                    <td colspan="4">
                                                        <?php echo $__env->make('admin.objects.components.selectbox', ['name' => 'status', 'options' => $statuses, 'selected' => $article->status], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                                                        <?php echo $__env->make('admin.objects.components.input', ['name' => 'price_closing', 'value' => $article->price_closing, 'placeholder' => '成約価格', 'class' => 'w65', 'value' => $article->price_closing], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                                                        万円
                                                        <?php echo $__env->make('admin.objects.components.input', ['name' => 'close_date', 'value' => $article->price_closing, 'class' => 'cal_picker w115', 'value' => $article->close_date, 'placeholder' => '成約日'], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <th>備考</th>
                                                    <td colspan="8">
                                                        <?php echo $__env->make('admin.objects.components.input', ['name' => 'home_note', 'value' => $article->home_note ,'placeholder' => '備考', 'class' => 'w-100' ], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                                                    </td>
                                                </tr>
                                            </table>
                                        </form>
                                        <?php echo $__env->make('admin.objects.projects.modal-history', ['history' => $article->history, 'data_num' => $article->id], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                                    </td>
                                </tr>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                        </table>
                    <?php endif; ?>
                <?php endif; ?>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            <div class="d-flex justify-content-between pager mt10">
                <div class="m-2"><span class="pager-total">検索結果&nbsp;<?php echo e($list->total()); ?></span><span>件中&nbsp; <?php echo e($first); ?>〜<?php echo e($last); ?>件表示</span>
                </div>
                <div class="mt-2"><?php echo e($list->appends($params)->links()); ?></div>
            </div>
        </div>
    </div>
    <?php echo $__env->make('admin.objects.projects.modal-message', \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('admin.layouts.base', \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>