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


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

<div class="mt5">
    <?php echo $__env->make('admin.objects.components.hp-tab', ['title' => 'HP管理ーリフォーム事例', 'type' => 'reform'], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
    <?php echo $__env->make('admin.objects.components.regist-band', ['title' => 'リフォーム事例一覧', 'conf_url' => '/reform/works'], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>

    <div class="d-flex justify-content-between pager mt10">
        <div class="m-2">
            <span class="recommend_text"> 登録数&nbsp;<?php echo e(count($reform)); ?>件&nbsp;&nbsp;&nbsp;公開中物件数&nbsp;<?php echo e($disp_count); ?>件</span><span class="recommend_text_sub">ドラッグ＆ドロップで並べ替えができます。</span>
        </div>
        <div class="d-flex justify-content-end">
            <a href="<?php echo e(route('reform-regist')); ?>" class="btn_imagesave w120 store_new_btn">新規登録</a>
        </div>
    </div>

    <div class="reform_list">
        <table  id="sortable_reform">
            <thead>
                <tr>
                    <th colspan="2" rowspan="2" class="w150">写真画像</th>
                    <th class="w150">リフォーム番号</th>
                    <th class="">タイトル</th>
                    <th rowspan="2" class="w125">公開</th>
                    <th rowspan="2" class="w250"></th>
                </tr>
                <tr>
                  <th class="w150">カテゴリ</th>
                  <th class="">住所</th>
                </tr>
            </thead>
            <?php $__currentLoopData = $reform; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <tbody class="<?php if($loop->iteration % 2 == 0): ?> even <?php else: ?> odd <?php endif; ?>">
                <tr>
                    <td rowspan="2" class="rank_td">
                        <span class="rank"><?php echo e($loop->iteration); ?></span>
                    </td>
                    <td rowspan="2">
                        <?php if(!empty($item->disp_file)): ?>
                        <img src="<?php echo e($item->disp_file); ?>" width="150" />
                        <?php else: ?>
                        <img src="<?php echo e(root('img/noimage2.jpg')); ?>" width="150" />
                        <?php endif; ?>

                    </td>
                    <td><?php echo e($item->code); ?></td>
                    <td><?php echo e($item->title); ?></td>
                    <td rowspan="2" class="text-center"><?php echo $__env->make('admin.objects.components.switch-disp', ['name' => 'reform_disp', 'checked' => $item->disp], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?></td>
                    <td rowspan="2">
                        <?php echo $__env->make('admin.objects.components.hidden', ['name' => 'reform_id', 'value' => $item->code], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                        <?php echo $__env->make('admin.objects.components.link-btn-nostyle', ['url' => route('reform-edit', ['id' => $item->code]), 'title' => '編集', 'class' => 'edit_news_btn'], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                        <button class="del_news_btn unset-modal-overlay" name="" data-toggle="modal" data-target="#deleteModal<?php echo e($item->code); ?>">削除</button>
                        <form action="<?php echo e(route('reform-delete', $item->code)); ?>" method="post">
                            <?php echo csrf_field(); ?>
                            <?php echo $__env->make('admin.objects.components.modal_confirm_delete', ['id' => $item->code, 'message' => 'このリフォームを削除しますがよろしいですか？'], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                        </form>
                    </td>
                </tr>
                <tr>
                    <td><?php echo e($item->category_name); ?></td>
                    <td><?php echo e($item->area); ?></td>
                </tr>
            </tbody>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </table>
    </div>
</div>
<?php $__env->stopSection(); ?>

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