<?php $__env->startSection('contents'); ?>
<div class="loading_disp loading_hide"></div>
<div class="mt5">
    <?php echo $__env->make('admin.objects.components.facility-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(); ?>
    <form method="POST" action="<?php echo e(route('facility-edit', ['id' => $facility_info->id])); ?>" enctype="multipart/form-data" id="enter-off">
    <?php echo e(csrf_field()); ?>

    <div id="<?php if(isset($tmp_id)): ?><?php echo e($tmp_id); ?><?php endif; ?>"  class="facility_regist <?php if(isset($add_class)): ?> <?php echo e($add_class); ?> <?php endif; ?>">
        <div id="image_list">
            <table class="p-search-common__tbl">
                <tr>
                    <td rowspan="5">
                        <div class="facility_image_area">
                            <?php echo $__env->make('admin.objects.components.add-facility-image', ['id' => 'imageArea'], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                        </div>
                        <div class="facility_image_area_sub">
                            <?php echo $__env->make('admin.objects.components.hidden', ['name' => 'del_img'], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                            <?php echo $__env->make('admin.objects.components.btn', ['name' => 'del_facility_img', 'type' => 'button', 'title' => '削除'], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                        </div>
                    </td>
                    <th>施設ID</th>
                    <td colspan="3">
                        <?php echo e($facility_info->id); ?>

                    </td>
                </tr>
                <tr>
                    <th>施設名</th>
                    <td>
                        <?php echo $__env->make('admin.objects.components.input', ['name' => 'name', 'class' => 'w200', 'value' => $facility_info->name], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                    </td>
                    <th>施設種別</th>
                    <td>
                        <?php echo $__env->make('admin.objects.components.selectbox', ['name' => 'kind', 'options' => $kind, 'title' => '施設種別', 'selected' => $facility_info->kind], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                    </td>
                </tr>
                <tr>
                    <th>住所</th>
                    <td colspan="3">
                        <div>
                            &#12306;<?php echo $__env->make('admin.objects.components.input', ['name' => 'zip', 'class' => 'mb-2', 'placeholder' => '000-0000', 'class' => 'zip', 'value' => $facility_info['zip']], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                            <?php echo $__env->make('admin.objects.components.btn', ['title' => '郵便番号から住所決定', 'class' => 'btn_decision', 'id'=>'zipToAddress', 'type' => 'button', 'class' => 'zipToAddress btn_decision'], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                            <?php echo $__env->make('admin.objects.components.btn', ['title' => '住所から郵便番号決定', 'class' => 'btn_decision', 'id' => 'addressToZip', 'type' => 'button', 'class' => 'addressToZip btn_decision'], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                        </div>
                        <div class="d-flex p-search-common__tbl border-0">
                            <?php echo $__env->make('admin.objects.components.selectbox', ['name' => 'address1', 'class' => 'mb-2 address1', 'options' => $pref, 'selected' => !empty($facility_info['address1']) ? $facility_info['address1'] : Config::get('const.DEFAULT_PREF')], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                            <?php if(auth()->user()->isOwnerOfSaiKyoto()): ?>
                                <div class="h-100 data-address ml-2">
                                    <?php echo $__env->make('admin.objects.components.data-list', ['name' => 'list-address2[]', 'options' => $city, 'placeholder' => '市区郡選択',
                                    'class' => 'list-address2', 'value' => !empty(request()->get('list-address2')[0]) ? request()->get('list-address2')[0] : (!empty($facility_info['address2']) ? $facility_info['address2'] : ""),
                                    'code' => !empty(request()->get('address2')[0]) ? request()->get('address2')[0] : (!empty($facility_info['address2']) ? $facility_info['address2'] : "")], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                                    <div style="display: none">
                                        <?php echo $__env->make('admin.objects.components.selectbox', ['name' => 'address2', 'class' => 'mb-2 sai-kyoto address2', 'options' => $city, 'title' => '市区郡', 'selected' => $facility_info['address2']], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                                    </div>
                                </div>
                                <div class="h-100 data-address ml-2">
                                    <?php echo $__env->make('admin.objects.components.data-list', ['name' => 'list-address3[]', 'placeholder' => '町村選択', 'options' => $town,
                                    'class' => 'list-address3', 'value' => !empty(request()->get('list-address3')[0]) ? request()->get('list-address3')[0] : (!empty($facility_info['address3']) ? $facility_info['address3'] : ""),
                                    'code' => !empty(request()->get('address3')[0]) ? request()->get('address3')[0] : (!empty($facility_info['address3']) ? $facility_info['address3'] : "")], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                                    <div style="display: none">
                                        <?php echo $__env->make('admin.objects.components.selectbox', ['name' => 'address3', 'class' => 'mb-2 address3', 'options' => $town, 'title' => '町村', 'selected' => $facility_info['address3']], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                                    </div>
                                </div>
                            <?php else: ?>

                                <div class="h-100 data-address ml-2">
                                    <?php echo $__env->make('admin.objects.components.data-list', ['name' => 'list-address2[]', 'options' => $city, 'placeholder' => '市区郡選択',
                                    'class' => 'list-address2', 'value' => !empty(request()->get('list-address2')[0]) ? request()->get('list-address2')[0] : (!empty($facility_info['address2']) ? $facility_info['address2'] : ""),
                                    'code' => !empty(request()->get('address2')[0]) ? request()->get('address2')[0] : (!empty($facility_info['address2']) ? $facility_info['address2'] : "")], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                                    <div style="display: none">
                                        <?php echo $__env->make('admin.objects.components.selectbox', ['name' => 'address2', 'class' => 'mb-2 address2', 'options' => $city, 'title' => '市区郡', 'selected' => $facility_info['address2']], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                                    </div>
                                </div>
                                <div class="h-100 data-address ml-2">
                                    <?php echo $__env->make('admin.objects.components.data-list', ['name' => 'list-address3[]', 'placeholder' => '町村選択', 'options' => $town,
                                    'class' => 'list-address3', 'value' => !empty(request()->get('list-address3')[0]) ? request()->get('list-address3')[0] : (!empty($facility_info['address3']) ? $facility_info['address3'] : ""),
                                    'code' => !empty(request()->get('address3')[0]) ? request()->get('address3')[0] : (!empty($facility_info['address3']) ? $facility_info['address3'] : "")], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                                    <div style="display: none">
                                        <?php echo $__env->make('admin.objects.components.selectbox', ['name' => 'address3', 'class' => 'mb-2 address3', 'options' => $town, 'title' => '町村', 'selected' => $facility_info['address3']], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                                    </div>
                                </div>
                            <?php endif; ?>

                        </div>
                        <div>
                            <?php echo $__env->make('admin.objects.components.input', ['name' => 'address4', 'class' => 'w-50', 'placeholder' => '町村以降を入力', 'value' => $facility_info['address4']], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                        </div>
                        <script src="<?php echo e(asset("admin/js/forsale_address.js")); ?>"></script>

                    </td>
                </tr>
                <tr>
                    <th>物件位置情報</th>
                    <td colspan="3">
                        緯度&nbsp;<?php echo $__env->make('admin.objects.components.input', ['name' => 'lat', 'value' => $facility_info->lat], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?><span class="d-none" name="lat_text">未設定</span>経度&nbsp;<?php echo $__env->make('admin.objects.components.input', ['name' => 'lng', 'value' => $facility_info->lng], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?><span class="d-none" name="lng_text">未設定</span>
                        <?php echo $__env->make('admin.objects.components.modal-btn', ['title' => '位置確認・修正', 'class' => 'btn_position', 'data' => 2], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                    </td>

                </tr>
                <tr>
                    <th>キャプション</th>
                    <td colspan="3">
                        <?php echo $__env->make('admin.objects.components.textarea', ['name' => 'memo', 'class' => 'w500', 'count' => 100, 'placeholder' => 'キャプションを入力してください', 'value' => $facility_info->memo], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                    </td>

                </tr>
            </table>
        </div>
    </div>
        <div class="regist__div">
            <?php echo $__env->make('admin.objects.components.regist-btn', ['class' => '', 'title' => '登録・保存'], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
        </div>
    </form>
</div>
<?php echo $__env->make('admin.objects.projects.modal-map', ['no' => 2], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<?php if(session('message')): ?>
    <?php echo $__env->make('admin.objects.projects.modal-message', \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
    <script type="text/javascript">
        window.onload = function(){
            var message = '登録・保存しました。';
            $('#saved_message').text(message);
            openMessageModal();
        };

    </script>
<?php endif; ?>
<?php $__env->stopSection(); ?>

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