<?php $__env->startSection('contents-header'); ?>
    <?php echo $__env->make('business.objects.projects.search-results-header', ['title' => $title ?? '売出物件', 'isForSale' => true], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<?php $__env->stopSection(); ?>

<?php
if(isset($_GET['notcondition']) and $_GET['notcondition']=='notHold'){
  $buttons = [
      ['id'=>'notHold', 'title' => '「商談中・契約予定」再表示', 'class' => 'notCondition'],
      ['id'=>'btnAllDisp', 'title' => '全物件表示', 'class' => 'btnAllDisp']
  ];
}else{
  $buttons = [
      //['id'=>'notHold', 'title' => '「済・保」除外', 'class' => 'notCondition'],
      //['id'=>'notClosed', 'title' => '「済」除外', 'class' => 'notCondition'],
      //['id'=>'notEtc', 'title' => '「済等」除外', 'class' => 'notCondition'],
      ['id'=>'notHold', 'title' => '「商談中・契約予定」除外', 'class' => 'notCondition'],
      ['id'=>'btnAllDisp', 'title' => '全物件表示', 'class' => 'btnAllDisp']
  ];
}

// 並び替えデータ
$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 = 'inexpensive';
array_push($sorts, $sort);

$sort = new stdClass();
$sort->name = '駅近い順';
$sort->class = 'station';
array_push($sorts, $sort);

$sort = new stdClass();
$sort->name = '築年浅い順';
$sort->class = 'age';
array_push($sorts, $sort);

$sort = new stdClass();
$sort->name = '土地面積広い順';
$sort->class = 'land';
array_push($sorts, $sort);

$sort = new stdClass();
$sort->name = '延べ床面積広い順';
$sort->class = 'floor';
array_push($sorts, $sort);

$sort = new stdClass();
$sort->name = '物件確認日';
$sort->class = 'conf_day';
array_push($sorts, $sort);

$sort = new stdClass();
$sort->name = '物件登録日';
$sort->class = 'created_at';
array_push($sorts, $sort);

$sort = new stdClass();
$sort->name = '物件種別';
$sort->class = 'property';
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);
*/

$sort = new stdClass();
$sort->name = '業者電話順';
$sort->class = 'vendor_tel';
array_push($sorts, $sort);

?>

<?php $__env->startSection('contents'); ?>

<?php echo $__env->make('business.objects.projects.results-switching', ['buttons' => $buttons], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>


<?php echo $__env->make('business.objects.projects.results-current-condition', ['title' => $title ?? '売出物件'], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>

<?php echo $__env->make('business.objects.projects.results-sort', ['sorts' => $sorts], \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(); ?>

<script>
    localStorage.setItem("is_opended", 0);
</script>

<?php echo $__env->make('business.objects.components.loading', \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<div class="d-none" id="url-ajax-pagination" url="<?php echo e(route('business.ajax.for-sale')); ?>"></div>


<div id="url-delete-article" url="<?php echo e(route('buyer.delete-article')); ?>"></div>
<?php if(strpos(url()->full(), '/for-sale') !== false  && !empty($article_list)): ?>
    <div class="buyer-action mb-3 d-flex align-items-center justify-content-between">
        <div class="container" style="max-width: 1200px; padding: 0">
            <div class="d-flex align-items-center justify-content-between">
                <?php echo $__env->make('business.pages.buyer.partials.form-save-article', \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                <div class="st-count">該当物件：
                    <span class="p-search-results-header__results-total">
                            <span id="count-article-show" class="count-article-show"><?php echo e($article_list->total() - count($article_list->whereIn('building_id', $hide_items))); ?></span>
                        </span>件表示
                    <span>/</span>
                    <?php echo e($article_list->total()); ?>件中
                </div>
            </div>
        </div>
    </div>
    <?php if(session('buyer_active')): ?>
        <?php
            $buyer = session('buyer_active');
            $buyerArticle = $buyer->articles;
        ?>
        <?php echo $__env->make('business.pages.buyer.partials.modal-save-buyer', \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
    <?php endif; ?>
<?php endif; ?>
<div class="tab-content mt-3">
  <div class="tab-pane u-bg-default <?php echo e(!isset($type_page) || (isset($type_page) && $type_page == 1) ? "active" : ""); ?>" id="nav-image" role="tabpanel" aria-labell edby="nav-image-tab">
    <?php echo $__env->make('business.objects.projects.results-image', [
        'type' => 'for-sale',
        'flag' => 1,
        'isShowOwnCompany' => true,
    ], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
  </div>
  <div class="tab-pane u-bg-default <?php echo e((isset($type_page) && $type_page == 2) ? "active" : ""); ?>" id="nav-list" role="tabpanel" aria-labelledby="nav-list-tab">
    <?php echo $__env->make('business.objects.projects.results-noimage', [
        'data' => $article_list,
        'flag' => 1,
        'controlArticleBuyer' => true,
        'isShowOwnCompany' => true,
    ], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
  </div>
    <?php $params_single = [] ?>
    <?php echo $__env->make('business.objects.projects.form-to-other', ['action' => route('business-for-sale-setprint'), 'id' => 'multiPrintForm', 'params' => $params], \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-print'), 'id' => 'singlePrintForm', 'params' => $params], \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-setprint-vendor'), 'id' => 'multiPrintFormVendor', 'params' => $params], \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-print-vendor'), 'id' => 'singlePrintFormVendor', 'params' => $params], \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-setprint-set1'), 'id' => 'multiPrintFormSet1', 'params' => $params], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
    <?php if(count($article_list) > 0): ?>
        <?php echo $__env->make('business.objects.components.btn_more', \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
    <?php endif; ?>
    <div id="all-items" items="<?php echo e($article_list_id ?? ""); ?>"></div>
</div>
<?php if(!empty($article_list) && strpos(url()->full(), '/for-sale') !== false): ?>
    <div class="mb-3">
        <?php echo $__env->make('business.pages.buyer.partials.form-save-article', ['bottom' => true], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
    </div>
<?php endif; ?>
<div id="modal-content" class="modal-contents">
    <input type="hidden" value="" id="type" >
    <div id="modal_open" class="p-print-modal">
        <header id="modal_header" style="text-align:right;">
            <button type="button" class="btn btn-default" data-dismiss="modal" id="modal-close" style="color:gray; font-weight:bold; font-size:30px; padding:0px; line-height:20px;background:none;">×</button>
        </header>
        <main id="modal_main">
            <p class="p-print-modal__title">レイアウトをお選びください。</p>
            <ul class="p-print-modal__menus d-flex">
                <li>
                    <p class="p-print-modal__menus-icon">
                        <a href="javascript:void(0);" class="btnPhotoPrint" data-n="4">
                            <span class="p-print-modal__menus-text">４枚ずつ</span>
                            <img src="/business/img/layout2x2.png" width="120">
                        </a>
                    </p>
                </li>
                <li>
                    <p class="p-print-modal__menus-icon">
                        <a href="javascript:void(0);" class="btnPhotoPrint" data-n="8">
                            <span class="p-print-modal__menus-text">８枚ずつ</span>
                            <img src="/business/img/layout2x4.png" width="120">
                        </a>
                    </p>
                </li>
                <li>
                    <p class="p-print-modal__menus-icon">
                        <a href="javascript:void(0);" class="btnPhotoPrint" data-n="18">
                            <span class="p-print-modal__menus-text">１８枚ずつ</span>
                            <img src="/business/img/layout3x6.png" width="120">
                        </a>
                    </p>
                </li>
            </ul>
        </main>
        <footer id="modal_footer">
        </footer>
    </div>
</div>
<form action="<?php echo e(route('search_again', ['path' => 'for-sale'])); ?>" method="post" id="search_again_form">
    <?php if(!isset($params['search_sort'])): ?>
        <input type="hidden" name="search_sort" value="<?php echo e(!empty(request()->get('search_sort')) ? request()->get('search_sort') : "desc"); ?>">
    <?php endif; ?>
    <?php echo csrf_field(); ?>
    <?php $__currentLoopData = $params; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $k => $v): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
        <?php if(is_array($v)): ?>
            <?php $__currentLoopData = $v; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $vv): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <input type="hidden" name="<?php echo e($k); ?>[]" value="<?php echo e($vv); ?>">
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        <?php else: ?>
            <input type="hidden" name="<?php echo e($k); ?>" value="<?php echo e($v); ?>">
        <?php endif; ?>
    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</form>

</form>
<form action="<?php echo e(route('business-for-sale-list')); ?>" method="post" id="search_forsale_form">
    <?php echo csrf_field(); ?>
    <?php $__currentLoopData = $params; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $k => $v): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
        <?php if(is_array($v)): ?>
            <?php $__currentLoopData = $v; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $vv): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <input type="hidden" name="<?php echo e($k); ?>[]" value="<?php echo e($vv); ?>">
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        <?php else: ?>
            <input type="hidden" name="<?php echo e($k); ?>" value="<?php echo e($v); ?>">
        <?php endif; ?>
    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</form>
<script>
    $(document).ready(function () {

        $(".cal_picker").datepicker({
            format: "yyyy-mm-dd",
            locale: 'ja',
            language: 'ja',
            weekStart: 1,
            todayHighlight: true,
            autoclose: true,
        });

    })
</script>
<?php $__env->stopSection(); ?>
<?php $__env->startPush('scripts'); ?>
    <script src="<?php echo e(asset('/business/js/buyer.js')); ?>"></script>
<?php $__env->stopPush(); ?>

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