@extends('admin.layouts.base')
@section('contents')

    @php
        // Place area
        $place_area = [
            ['code' => "", 'name' => '未選択'],
            ['code' => "安朱", 'name' => '安朱'],
            ['code' => "音羽", 'name' => '音羽'],
            ['code' => "勧修寺", 'name' => '勧修寺'],
            ['code' => "御陵", 'name' => '御陵'],
            ['code' => "四ノ宮", 'name' => '四ノ宮'],
            ['code' => "小山", 'name' => '小山'],
            ['code' => "上花山", 'name' => '上花山'],
            ['code' => "厨子奥", 'name' => '厨子奥'],
            ['code' => "西野", 'name' => '西野'],
            ['code' => "西野山", 'name' => '西野山'],
            ['code' => "川田", 'name' => '川田'],
            ['code' => "大宅", 'name' => '大宅'],
            ['code' => "大塚", 'name' => '大塚'],
            ['code' => "醍醐", 'name' => '醍醐'],
            ['code' => "竹鼻", 'name' => '竹鼻'],
            ['code' => "東野", 'name' => '東野'],
            ['code' => "藤尾", 'name' => '藤尾'],
            ['code' => "日ノ岡", 'name' => '日ノ岡'],
            ['code' => "北花山", 'name' => '北花山'],
            ['code' => "椥辻", 'name' => '椥辻'],
            ['code' => "小野", 'name' => '小野'],
        ];

        if (auth()->user()->isOwnerOfSaiKyoto()) {
            $place_area = [
                ['code' => "", 'name' => '未選択'],
                ['code' => "上花山", 'name' => '上花山'],
                ['code' => "勧修寺", 'name' => '勧修寺'],
                ['code' => "北花山", 'name' => '北花山'],
                ['code' => "厨子奥", 'name' => '厨子奥'],
                ['code' => "四ノ宮", 'name' => '四ノ宮'],
                ['code' => "大塚", 'name' => '大塚'],
                ['code' => "大宅", 'name' => '大宅'],
                ['code' => "安朱（＋上野）", 'name' => '安朱（＋上野）'],
                ['code' => "小山（＋髭茶屋＋八軒屋敷）", 'name' => '小山（＋髭茶屋＋八軒屋敷）'],
                ['code' => "小野", 'name' => '小野'],
                ['code' => "川田", 'name' => '川田'],
                ['code' => "御陵", 'name' => '御陵'],
                ['code' => "日ノ岡", 'name' => '日ノ岡'],
                ['code' => "東野", 'name' => '東野'],
                ['code' => "椥辻", 'name' => '椥辻'],
                ['code' => "竹鼻", 'name' => '竹鼻'],
                ['code' => "藤尾（大津市）", 'name' => '藤尾（大津市）'],
                ['code' => "西野", 'name' => '西野'],
                ['code' => "西野山", 'name' => '西野山'],
                ['code' => "醍醐（＋小栗栖）", 'name' => '醍醐（＋小栗栖）'],
                ['code' => "音羽", 'name' => '音羽'],
            ];
        }

        //// 1 基本情報
        $property_sub = [
            ['code' => 1, 'name' => '新築'],
            ['code' => 2, 'name' => '中古']
        ];

        //// 2 価格

        $running_cost_unit = [
            ['code' => 1, 'name' => '月'],
            ['code' => 2, 'name' => '年'],
        ];


        // その他諸費用
        $cost_unit = [
            ['code' => 1, 'name' => '月'],
            ['code' => 2, 'name' => '年'],
            ['code' => 3, 'name' => '一括'],
            ['code' => 0, 'name' => '未選択'],
        ];


        //// 3 物件概要

        // 土地面積
        $land_area = [
            ['code' => 1, 'name' => '登記'],
            ['code' => 2, 'name' => '実測'],
            ['code' => 0, 'name' => '未選択'],
        ];

        // 土地条件
        $land_condition_unit = [['code' => 2, 'name' => 'm&sup2;'], ['code' => 3, 'name' => '％'], ['code' => 0, 'name' => '未選択'],];
        $land_condition1 = [['code' => 1, 'name' => 'うち傾斜部分'],];
        $land_condition2 = [['code' => 2, 'name' => 'うち路地状部分'],];
        $land_condition3 = [['code' => 3, 'name' => 'うち高圧線下'],];

        // 国土法
        // $kokudoho = [
        //     ['code' => 1, 'name' => '届出要'],
        //     ['code' => 2, 'name' => '届出不要'],
        //     ['code' => 0, 'name' => '未選択'],
        // ];
        $kokudoho = [
            ['code' => 1, 'name' => '要'],
            ['code' => 2, 'name' => '届出中'],
            ['code' => 3, 'name' => '不要'],
            ['code' => 0, 'name' => '未選択']
        ];

        // 建築面積
        $total_area = [
            ['code' => 1, 'name' => '登記'],
            ['code' => 2, 'name' => '実測'],
            ['code' => 0, 'name' => '未選択'],
        ];

        // 建築条件
        $building_condition_unit = [['code' => 1, 'name' => 'm&sup2;'], ['code' => 1, 'name' => '％'], ['code' => 0, 'name' => '未選択'],];
        $building_condition1 = [['code' => 1, 'name' => 'うち地下室'],];
        $building_condition2 = [['code' => 2, 'name' => 'うち１F車庫'],];
        $building_condition3 = [['code' => 3, 'name' => 'うち地下車庫'],];
        $building_condition4 = [['code' => 4, 'name' => 'うち居住用途以外'],];
        $building_use = [
            ['code' => 0, 'name' => '未選択'],
            ['code' => 1, 'name' => '店舗'],
            ['code' => 2, 'name' => '事務所'],
            ['code' => 3, 'name' => '倉庫'],
            ['code' => 4, 'name' => '工場'],
            ['code' => 5, 'name' => '診療所'],
            ['code' => 6, 'name' => '賃貸'],
            ['code' => 9, 'name' => 'その他'],
        ];

        // 引渡し
        $move_in = [
            ['code' => 1, 'name' => '即', 'add_text' => '検索', 'add_class' => ''],
            ['code' => 2, 'name' => '相談'],
            ['code' => 3, 'name' => '指定有'],
            ['code' => 4, 'name' => '契約後'],
            ['code' => 0, 'name' => '未選択'],
        ];

        // 条件外し
        $land_condition_not = [
            ['code' => 1, 'name' => '可'],
            ['code' => 2, 'name' => '不可'],
        ];

        // 再建築不可
        $land_not = [
            ['code' => 1, 'name' => '再建築不可'],
        ];

        // 引渡し
        $land_delivery = [
            ['code' => 1, 'name' => '即'],
            ['code' => 2, 'name' => '相談'],
            ['code' => 3, 'name' => '指定有'],
        ];

        // 建築条件
        $land_condition = [
            ['code' => 0, 'name' => '条件なし'],
            ['code' => 1, 'name' => '建築条件付き'],
        ];

        // 地目
        $ground = [
            ['code' => 1, 'name' => '宅地'],
            ['code' => 2, 'name' => '田'],
            ['code' => 3, 'name' => '畑'],
            ['code' => 4, 'name' => '山林'],
            ['code' => 5, 'name' => '雑種地'],
            ['code' => 6, 'name' => '原野'],
            ['code' => 7, 'name' => 'その他'],
            ['code' => 0, 'name' => '未選択'],
        ];

        // 地勢
        $terrain = [
            ['code' => 1, 'name' => '平坦'],
            ['code' => 2, 'name' => '高台'],
            ['code' => 3, 'name' => '低地'],
            ['code' => 4, 'name' => 'ひな壇'],
            ['code' => 5, 'name' => '傾斜地'],
            ['code' => 9, 'name' => 'その他'],
            ['code' => 0, 'name' => '未選択'],
        ];

        // 地役権
        $easement = [
            ['code' => 1, 'name' => '無'],
            ['code' => 2, 'name' => '地役権'],
            ['code' => 3, 'name' => '通行地役権'],
            ['code' => 4, 'name' => '引水地役権'],
            ['code' => 5, 'name' => '眺望地役権'],
            ['code' => 6, 'name' => '通路賃借権'],
            ['code' => 0, 'name' => '未選択'],
        ];

        // 上水道
        $water_supply = [
            ['code' => 1, 'name' => '公営水道'],
            ['code' => 2, 'name' => '私設水道'],
            ['code' => 3, 'name' => '井戸'],
            ['code' => 0, 'name' => '未選択'],
        ];

        // 下水道
        $sewerage = [
            ['code' => 1, 'name' => '本下水'],
            ['code' => 2, 'name' => '集中浄化槽'],
            ['code' => 3, 'name' => '個別浄化槽'],
            ['code' => 0, 'name' => '未選択'],
        ];

        // ガス・オール電化
        $gas = [
            ['code' => 1, 'name' => '都市ガス'],
            ['code' => 2, 'name' => '集中ＬＰＧ'],
            ['code' => 3, 'name' => '個別ＬＰＧ'],
            ['code' => 4, 'name' => 'オール電化'],
            ['code' => 0, 'name' => '未選択'],

        ];

        // 車庫
        $garage = [
            ['code' => 1, 'name' => '掘込車庫'],
            ['code' => 0, 'name' => '未選択'],
        ];

        // セットバック
        $set = [
            ['code' => 1, 'name' => '不要'],
            ['code' => 2, 'name' => '要'],
            ['code' => 3, 'name' => '済'],
            ['code' => 0, 'name' => '未選択'],
        ];



        //リフォーム
        $reform = [
            ['code' => 1, 'name' => '無'],
            ['code' => 2, 'name' => '済'],
            ['code' => 3, 'name' => '完了予定'],
        ];

        //// 4 投資・事業用
        // 区分
        $classification = [
            ['code' => 1, 'name' => '居住用'],
            ['code' => 2, 'name' => '事業用'],
            ['code' => 3, 'name' => '投資用'],
        ];

        // 売買区分
        $buy_class = [
            ['code' => 1, 'name' => '一棟売'],
            ['code' => 2, 'name' => '一括売'],
        ];

        // 事業用用途
        $use_method = [
            ['code' => 4, 'name' => '店舗'],
            ['code' => 5, 'name' => '事務所'],
            ['code' => 8, 'name' => '倉庫'],
            ['code' => 7, 'name' => '工場'],
            ['code' => 9, 'name' => 'その他'],
            ['code' => 0, 'name' => '未選択'],
        ];

        // 事業用引き渡し状態
        $use_status = [
            ['code' => 1, 'name' => '造作譲渡あり'],
            ['code' => 2, 'name' => '造作譲渡なし'],
            ['code' => 3, 'name' => '設備無償譲渡'],
            ['code' => 4, 'name' => 'スケルトン渡し'],
            ['code' => 0, 'name' => '未選択'],
        ];

        // 投資用現況
        $investment = [
            ['code' => 1, 'name' => '貸借人なし'],
            ['code' => 2, 'name' => '貸借人あり（オーナーチェンジ）'],
        ];

        $investment_unit = [
            ['code' => 1, 'name' => '月'],
            ['code' => 2, 'name' => '年'],
        ];

        //// 5 取引情報
        // 広告掲載確認
        $ad_conf = [
            ['code' => 1, 'name' => '未'],
            ['code' => 2, 'name' => '可'],
            ['code' => 3, 'name' => '不可'],
        ];

        // 会員物件
        $members = [
            ['code' => 0, 'name' => '全員に公開'],
            ['code' => 1, 'name' => '会員限定'],
        ];

        $ad_instructions = [
            ['code' => 1, 'name' => '未'],
            ['code' => 2, 'name' => '入稿'],
        ];
        $own_instructions = [
            ['code' => 1, 'name' => '未掲載'],
            ['code' => 2, 'name' => '掲載'],
        ];



        //// 6 画像
        // 画像種類
        $image_kind = [
            ['code' => 1, 'name' => '区画図'],
            ['code' => 2, 'name' => '間取り'],
            ['code' => 3, 'name' => '参考プラン'],
            ['code' => 0, 'name' => '未選択'],
        ];

        //// 7 イベント
        // イベントカテゴリ
        $event_category = [
            ['code' => 1, 'name' => '現地見学会'],
            ['code' => 2, 'name' => '現地案内会'],
            ['code' => 3, 'name' => '現地販売会'],
            ['code' => 4, 'name' => 'オープンハウス'],
            ['code' => 5, 'name' => 'オープンルーム'],
            ['code' => 0, 'name' => '未選択'],
        ];
        // イベント日程
        $event_schedule = [
            ['code' => 1, 'name' => '毎週土日祝'],
            ['code' => 2, 'name' => '毎週土日'],
            ['code' => 3, 'name' => '日時指定'],
            ['code' => 4, 'name' => '期間限定'],
            ['code' => 5, 'name' => '公開中'],
            ['code' => 0, 'name' => '未選択'],
        ];
        // イベント予約
        $reservation = [
            ['code' => 1, 'name' => '完全予約制'],
        ];

        $vendor_building_photo = [
            ['code' => 1, 'name' => '優先使用'],
            ['code' => 2, 'name' => '不使用'],
        ];
    @endphp
    @if((isset($messArray) && count($messArray) > 0) || $errors->any())
        @php $errorKeyArr = [] @endphp
        <div class="error">
            <ul class="mb-0">
                @if(isset($messArray) && count($messArray) > 0)
                    @foreach($messArray as $key => $err)
                        <li><a class="error-link" href="#{{$key}}">{{ $err }}</a></li>
                        @php array_push($errorKeyArr, $key) @endphp
                    @endforeach
                @endif
                @if($errors->any())
                    @foreach($errors->getMessages() as $key => $message)
                        @if(!in_array($key, $errorKeyArr))
                            @php $key = \Illuminate\Support\Str::contains($key, "address") ? "address2" : $key @endphp
                            <li><a class="error-link" href="#{{$key}}">{{ $message[0] }}</a></li>
                        @endif
                    @endforeach
                @endif
            </ul>
        </div>
    @endif

    @php
        $provisional = '';
        if(!empty(request()->get('provisional'))){
            $provisional = '?provisional=1';
        }
        if(!empty(request()->cookie()['current_params'])) {
            $current_params = json_decode(request()->cookie()['current_params']);
            $action = $current_params->url_search;
            $method = "post";
        } else {
            $action = url()->previous();
            $method = "get";
        }
        if (strpos(url()->previous(), route('showProvisional')) !== false || strpos(url()->previous(), route('recommend')) !== false) {
            $action = url()->previous();
            $method = "get";
        }
        if(!empty(request()->get('provisional'))){
            $action = '/admin/provisional?store='.$article->shop;
            $method = "get";
        }
    @endphp
    @if(!isset($copy) && !isset($_GET['back']))
        @include('admin.objects.components.button-back', ['action' => $action, 'method' => $method])
    @endif
    <table class="p-regist__table d-none" id="vendor_template">
        <tbody>
        <tr>
            <th rowspan="4" class="p-regist__table-colspan" name="vendor_num"></th>
            <th class="p-regist__table-colspan">業者名/取引態様</th>
            <td>
                @include('admin.objects.components.hidden', ['name' => 'vendor_id[]'])
                @include('admin.objects.components.input', ['name' => 'vendor_name', 'class' => 'w300', 'other_attr' => 'readonly'])
                @include('admin.objects.components.modal-btn', ['title' => '業者検索', 'class'=> 'btn_search', 'data' => 9, 'btn_name' => 'vendor_modal_btn'])
                @include('admin.objects.components.selectbox', ['name' => 'manner[]', 'required' => 'required', 'options' => $manner, 'title' => '取引態様'])
            </td>
            <td rowspan="4" class="p-regist__table-registtrader">
                @include('admin.objects.components.btn', ['name' => 'del_vendor', 'class' => '', 'title' => '削除', 'type' => 'button'])
            </td>
        </tr>
        <tr>
            <th>電話/FAX/担当</th>
            <td class="d-flex justify-content-between border-0">
                <div>
                    電話&nbsp;@include('admin.objects.components.input', ['name' => 'vendor_tel', 'other_attr' => 'readonly', 'class' =>'w180'])
                </div>
                <div>
                    FAX&nbsp;@include('admin.objects.components.input', ['name' => 'vendor_fax', 'other_attr' => 'readonly', 'class' =>'w180'])
                </div>
                <div>
                    担当&nbsp;@include('admin.objects.components.input', ['name' => 'vendor_charge[]', 'class' =>'w120'])
                </div>
            </td>
        </tr>
        <tr>
            <th>広告掲載確認/広告確認日</th>
            <td>
                <ul class="d-flex p-regist__table-list">
                    <li>
                        <p>チラシ</p>
                        @include('admin.objects.components.selectbox', ['name' => 'flyer[]', 'options' => $ad_conf])
                    </li>
                    <li>
                        <p>情報誌</p>
                        @include('admin.objects.components.selectbox', ['name' => 'freepaper[]', 'options' => $ad_conf])
                    </li>
                    <li>
                        <p>自社HP</p>
                        @include('admin.objects.components.selectbox', ['name' => 'house_hp[]', 'options' => $ad_conf])
                    </li>
                    <li>
                        <p>ポータル</p>
                        @include('admin.objects.components.selectbox', ['name' => 'portal[]', 'options' => $ad_conf])
                    </li>

                    <li>
                        <p>現地看板</p>
                        @include('admin.objects.components.selectbox', ['name' => 'signboard[]', 'options' => $ad_conf])
                    </li>
                    <li>
                        <p></p>
                        @include('admin.objects.components.btn', ['name' => 'all_ad[]', 'class' => 'btn_allcheck', 'title' => '全不可チェック'])
                    </li>
                    <li>
                        <p>広告確認日</p>
                        @include('admin.objects.components.input', ['name' => 'ad_conf_day[]', 'class' => 'cal_picker', 'placeholder' => '0000/00/00'])
                    </li>
                </ul>

            </td>
        </tr>
        <tr>
            <th>備考</th>
            <td class="d-flex justify-content-between border-0">
                <div class="w-100">
                    @include('admin.objects.components.input', ['name' => 'home_note[]', 'class' =>'w-100'])
                </div>
            </td>
        </tr>
        </tbody>
    </table>
    <form method="POST" action="{{ $route ?? route('editHouse', ['id' => $article->building_id]).$provisional }}"
          enctype="multipart/form-data" id="enter-off">
        {{ csrf_field() }}
        @if(isset($copy))
            @include('admin.objects.components.hidden', ['name' => 'company_id', 'value' => Auth::user()->company_id])
        @endif
        @include('admin.objects.components.base-tab-edit')
        @include('admin.objects.components.regist-tab', ['title' => '物件登録-戸建', 'active' => 'base','edit' => true])
        <div>
            @include('admin.objects.components.regist-band', ['title' => '１.基本情報', 'save_lot' => true])
            <div class="p-regist">
                <table class="p-regist__table">
                    <tbody>
                    <tr>
                        <th colspan="2">物件番号</th>
                        <td>
                            <span id="target_id">{{$article->building_id}}</span>
                            <a href="/business/for-sale/detail/{{$article->building_id}}" class="p-regist__table-link"
                               target="_blank">住まいの情報DB「物件詳細ページ」を見る</a>
                        </td>
                    </tr>
                    <tr>
                        <th colspan="2">分譲地番号</th>
                        <td>
                            <span class="lh55 lot_id"
                                  name="disp_sale_no">@if(isset($article->sale_no)){{$article->sale_no}}@else
                                    未設定 @endif</span>
                            <span class="lh55 ml10">@if(isset($article->sale_name)) {{$article->sale_name}} @endif</span>
                            @if(isset($article->sale_no))
                                <a href="/business/lot/parentDetail/{{$article->sale_no}}" class="p-regist__table-link"
                                   target="_blank">住まいの情報DB「分譲地ページ」を見る</a>
                            @endif
                            <div class="d-flex">
                                @if(isset($article->sale_no))
                                    <button type="button" class="c-base-tab__image unset-modal-overlay"
                                            data-toggle="modal" data-target="#editModal">保存して「分譲地」編集
                                    </button>
                                    @include('admin.objects.components.modal_confirm_edit', [
                                                'mansion' => $article, 'message' => 'この物件を保存して「分譲地」ページに移動します',
                                                'cancel'=> 'キャンセル', 'class_open' => ''])
                                @endif
                                @include('admin.objects.components.hidden', ['name' => 'sale_no', 'value' => $article->sale_no])
                                @include('admin.objects.components.hidden', ['name' => 'name_bunjyou', 'value' => $article->sale_name])
                                @include('admin.objects.components.modal-btn', ['title' => '分譲地検索', 'class'=> 'btn_search', 'data' => 1])
                                <button type="button" class="btn_clear" data-n="1" data-num="" name="">番号解除</button>
                            </div>
                        </td>
                    </tr>
                    <!--<tr>
                        <th colspan="2">分譲地名</th>
                        <td>
                            <span>@if(isset($article->sale_name)) {{$article->sale_name}} @else 未設定 @endif</span>
                            @include('admin.objects.components.hidden', ['name' => 'name_bunjyou', 'value' => $article->sale_name])
                            </td>
                        </tr>-->
                    <tr>
                        <th colspan="2" rowspan="2">
                            <div class="d-flex justify-content-between">
                                <div>物件種別</div>
                                <span class="require">必須</span>
                            </div>
                        </th>
                        <td>
                            @include('admin.objects.components.radio', ['name' => 'property', 'radio' => $property, 'default' => 4, 'checked' => $article->property])
                        </td>
                    </tr>
                    <tr>
                        <td>
                            @include('admin.objects.components.radio', ['name' => 'property_sub', 'radio' => $property_sub, 'default' => 1, 'checked' => $article->property_sub])
                        </td>
                    </tr>
                    <tr class="{{$article->name == null ? 'require_error': ''}}" id="name_article">
                        <th colspan="2">
                            <div class="d-flex justify-content-between">
                                <div>物件名</div>
                                <span class="require">必須</span>
                            </div>
                        </th>
                        <td>
                            @include('admin.objects.components.input', ['name' => 'name', 'class' => 'w-50', 'count' => 30, 'placeholder' => '物件名を３０文字以内で入力', 'value' => $article->article_name])
                            @include('admin.objects.components.input', ['name' => 'name_gouchi', 'value' => $article->name_gouchi])
                            号地
                        </td>
                    </tr>
                    <tr>
                        <th colspan="2">物件名（ポータル用）</th>
                        <td>
                            @include('admin.objects.components.input', ['name' => 'name_portal', 'class' => 'w-50', 'count' => 30, 'placeholder' => '物件名を３０文字以内で入力', 'value' => $article->name_portal])
                        </td>
                    </tr>
                    <tr>
                        <th colspan="2">未入居</th>
                        <td class="">
                            @include('admin.objects.components.checkbox', ['name' => 'occupied', 'checkbox' => $occupied, 'checked' => $article->occupied])
                            <div>
                                ※「未入居」とは、建築後１年以上経過したものであって、かつ居住の用に供されたことがない物件のことを指します。<br>
                                居住の用に供されたことのあるリフォーム済・リノベーション済物件は「中古」
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <th colspan="2">収益物件</th>
                        <td>
                            @include('admin.objects.components.checkbox', ['name' => 'revenue', 'checkbox' => $revenue, 'checked' => $article->revenue])
                        </td>
                    </tr>
                    <tr>
                        <th colspan="2">ステータス</th>
                        <td>
                            @include('admin.objects.components.selectbox', ['name' => 'status', 'options' => $statuses, 'selected' => $article->status])
                            @include('admin.objects.components.input', ['name' => 'price_closing', 'class' => 'ml10 w100 half-size', 'value' => $article->price_closing, 'placeholder' => '成約価格'])
                            <label class="u-checkbox">万円</label>
                            <div class="d-inline-block">
                                <div class="d-flex">
                                    @include('admin.objects.components.input', ['name' => 'close_date', 'class' => 'cal_picker', 'placeholder' => '成約日', 'value' => $article->close_date, 'showBtnToday' => true])
                                </div>
                            </div>
                        </td>
                    </tr>
                    <tr class="{{$article->shop == null ? 'require_error' : ''}}" id="shop">
                        <th colspan="2">
                            <div class="d-flex justify-content-between">
                                <div>物件取扱店舗名</div>
                                <span class="require">必須</span>
                            </div>
                        </th>
                        <td>
                            @include('admin.objects.components.selectbox', ['name' => 'shop', 'options' => $shops, 'selected' => $article->shop, 'title' => ''])
                        </td>
                    </tr>
                    @include('admin.objects.projects.form-address-edit')
                    @include('admin.objects.projects.latlng')
                    <tr>
                        <th rowspan="{{ auth()->user()->isOwnerOfSaiKyoto() ? 7 : 4 }}">交通</th>
                        <th>交通</th>
                        <td>
                            @include('admin.objects.components.modal-btn', ['title' => '路線をまとめて検索', 'class'=> 'btn_search', 'data' => 3])
                        </td>
                    </tr>
                    <tr class="{{($article->main_traffic_line == null && $article->else_traffic_line == null) ? 'require_error' : ''}}"
                        id="main_traffic_line">
                        <th>
                            <div class="d-flex justify-content-between">
                                <div>主要交通</div>
                                <span class="require">必須</span>
                            </div>
                        </th>
                        <td>
                            @include('admin.objects.projects.search-station-edit', ['data' => 4, 'name' => 'main_traffic'])
                        </td>
                    </tr>
                    <tr>
                        <th>補助交通１</th>
                        <td>
                            @include('admin.objects.projects.search-station-edit', ['data' => 5, 'name' => 'sub_traffic1'])
                        </td>
                    </tr>
                    <tr>
                        <th>補助交通２</th>
                        <td>
                            @include('admin.objects.projects.search-station-edit', ['data' => 6, 'name' => 'sub_traffic2'])
                        </td>
                    </tr>
                    @if (auth()->user()->isOwnerOfSaiKyoto())
                        <tr>
                            <th>補助交通３</th>
                            <td>
                                @include('admin.objects.projects.search-station-edit', ['data' => 13, 'name' => 'sub_traffic3'])
                            </td>
                        </tr>
                        <tr>
                            <th>補助交通 4</th>
                            <td>
                                @include('admin.objects.projects.search-station-edit', ['data' => 14, 'name' => 'sub_traffic4'])
                            </td>
                        </tr>
                        <tr>
                            <th>補助交通５</th>
                            <td>
                                @include('admin.objects.projects.search-station-edit', ['data' => 15, 'name' => 'sub_traffic5'])
                            </td>
                        </tr>
                    @endif
                    <tr>
                        <th colspan="2">交通<br/>（上記以外のエリアの場合）<br/>※検索できません</th>
                        <td>
                            <div class="d-flex mb5 ml10 mr10" style="border-bottom: 1px dotted #ccc;">
                                <div class="mr10 mb10">
                                    沿線名 @include('admin.objects.components.input', ['name' => 'else_traffic_line', 'class' => 'w150', 'value' => $article['else_traffic_line']])</div>
                                <div class="mr10">@include('admin.objects.components.input', ['name' => 'else_traffic_station', 'class' => 'w150', 'value' => $article['else_traffic_station']])
                                    駅
                                </div>
                                {{--                              @include('admin.objects.components.hidden', ['name' => 'else_traffic_line', 'class' => 'line_name', 'value' => $article['else_traffic_line']])--}}
                                {{--                              @include('admin.objects.components.hidden', ['name' => 'else_traffic_station', 'class' => 'station_name', 'value' => $article['else_traffic_station']])--}}
                            </div>
                            <div class="d-flex">
                                <input type="radio" class="u-radio" name="else_traffic"
                                       @if($article['else_traffic'] == 1 || old('else_traffic', '1')=='1') checked
                                       @endif value="1" id="else_traffic_1" checked>
                                <label for="else_traffic_1" class="u-radio__label">徒歩</label>
                                <div class="">@include('admin.objects.components.input', ['name' => 'else_traffic_time', 'class' => 'w50 walk_time half-size', 'value' => $article['else_traffic_time']])
                                    分
                                </div>
                            </div>
                            <div class="d-flex">
                                <input type="radio" class="u-radio" name="else_traffic"
                                       @if($article['else_traffic'] == 2 || old('else_traffic', '1')=='2') checked
                                       @endif value="2" id="else_traffic_2">
                                <label for="else_traffic_2" class="u-radio__label">バス</label>
                                <div class="mr38">@include('admin.objects.components.input', ['name' => 'else_traffic_bus_time', 'class' => 'w50 half-size', 'value' => $article['else_traffic_bus_time']])
                                    分乗車
                                </div>
                                <div class="mr10">
                                    バス停@include('admin.objects.components.input', ['name' => 'else_traffic_bus', 'class' => 'w150', 'value' => $article['else_traffic_bus']])
                                    停
                                </div>
                                <div class="">
                                    停歩@include('admin.objects.components.input', ['name' => 'else_traffic_bus_walk', 'class' => 'w50 half-size', 'value' => $article['else_traffic_bus_walk']])
                                    分
                                </div>
                            </div>
                        </td>
                    </tr>
                    @include('admin.objects.projects.set-school')
                    <tr>
                        <th colspan="2">備考1(社内用)</th>
                        <td>
                            @include('admin.objects.components.textarea', ['name' => 'memo1', 'class' => 'ta500', 'count' => 500, 'placeholder' => '備考を５００文字以内で入力してください', 'value' => $article->memo1])
                        </td>
                    </tr>
                    <tr>
                        <th colspan="2">備考2(社内用)</th>
                        <td>
                            @include('admin.objects.components.textarea', ['name' => 'memo2', 'class' => 'ta500', 'count' => 500, 'placeholder' => '備考を５００文字以内で入力してください', 'value' => $article->memo2])
                        </td>
                    </tr>
                    <tr>
                        <th colspan="2">BK</th>
                        <td>
                            @include('admin.objects.components.input', ['name' => 'bk', 'class' => 'w500', 'value' => $article->bk])
                        </td>
                    </tr>
                    <tr>
                        <th colspan="2">鍵</th>
                        <td>
                            @include('admin.objects.components.input', ['name' => 'key_text', 'class' => 'w500', 'value' => $article->key_text])
                        </td>
                    </tr>
                    @if (auth()->user()->isOwnerOfSaiKyoto())
                        <tr>
                            <th colspan="2">所在地エリア</th>
                            <td>
                                @include('admin.objects.components.selectbox', ['name' => 'place_area', 'class' => 'w150', 'options' => $place_area, 'selected' => $article->place_area])
                            </td>
                        </tr>
                    @endif
                    <tr>
                        <th colspan="2">レインズ番号</th>
                        <td>
                            {{$article->rains_id}}
                        </td>
                    </tr>
                    @include('admin.objects.projects.original-edit')
                    <tr>
                        <th colspan="2">
                            <div class="d-flex justify-content-between">
                                <div class="search_target_title">物件登録日</div>
                                <span class="search_target">検索</span>
                            </div>
                        </th>
                        <td>@if(isset($article->disp_create)){{$article->disp_create}}@endif</td>
                    </tr>
                    <tr class="{{$article->company_manner == null ? 'require_error': ''}}" id="company_manner">
                        <th colspan="2">
                            <div class="d-flex justify-content-between">
                                <div>取引態様</div>
                                <span class="require">必須</span>
                            </div>
                        </th>
                        <td>
                            @include('admin.objects.components.selectbox', ['name' => 'company_manner', 'options' => $manner, 'title' => '取引態様', 'selected' => $article->company_manner])
                            <span class="require_alart">※先物の場合は仲介を選択。※「自社」の取引態様を選択してください。「業者」の取引態様ではありません。</span>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
        @include('admin.objects.components.regist-tab', ['active' => 'price','edit' => true])
        <div>
            @include('admin.objects.components.regist-band', ['title' => '２.価格'])
            <div class="p-regist">
                <table class="p-regist__table">
                    <tbody>
                    <tr class="{{($article->price == null) ? 'require_error': ''}}" id="price">
                        <th colspan="2">
                            <div class="d-flex justify-content-between">
                                <div>物件価格</div>
                                <span class="require">必須</span>
                            </div>
                        </th>
                        <td>
                            {{--                            @include('admin.objects.components.input', ['name' => 'price', 'class' => 'w100', 'value' => $article->price])万円&nbsp;--}}
                            @include('admin.objects.components.input', ['name' => 'price', 'class' => 'w100 half-size', 'value' => $article->price])
                            万円&nbsp;
                            @include('admin.objects.components.selectbox', ['name' => 'tax', 'options' => $tax, 'selected' => $article->tax])
                        </td>
                    </tr>
                    <tr>
                        <th colspan="2">物件価格変更履歴</th>
                        <td>
                            @foreach($article->histories() as $p)
                                @if ($loop->last)
                                    登録：{{number_format($p->price, 0)}}
                                    万円 {{ !empty($p->regist_date) ? '('.date('Y/m/d', strtotime($p->regist_date)).')' : "" }}
                                @else
                                    変更：{{number_format($p->price, 0)}}
                                    万円 {{ !empty($p->regist_date) ? '('.date('Y/m/d', strtotime($p->regist_date)).')' : "" }}
                                @endif
                                <br>
                            @endforeach
                            @include('admin.objects.components.hidden', ['name' => 'name_bunjyou'])
                        </td>
                    </tr>
                    <!--<tr>
                        <th colspan="2">
                           <div class="d-flex justify-content-between">
                                 <div>有線放送に係る費用</div>
                                 <span class="require_applicable">該当必須</span>
                             </div>
                        </th>
                        <td>
                            @include('admin.objects.projects.umu-radio-cost', ['name' => 'broadcasting', 'default' => 2, 'checked' => $article->broadcasting?? 2])
                            <div class="initial_cost">
                                初期費用@include('admin.objects.projects.umu-money-radio', ['name' => 'broadcasting_presence', 'default' => 0, 'checked' => $article->broadcasting_presence?? 0])
                            <div class="initial_cost_detail">
@include('admin.objects.components.input', ['name' => 'broadcasting_cost', 'value' => $article->broadcasting_cost])円
                                </div>
                            </div>

                            <div class="running_cost">
                                定額費用@include('admin.objects.projects.umu-money-radio', ['name' => 'broadcasting_fixed_presence', 'default' => 0, 'checked' => $article->broadcasting_fixed_presence?? 0])
                            <div class="running_cost_detail">
@include('admin.objects.components.input', ['name' => 'broadcasting_fixed_cost', 'value' => $article->broadcasting_fixed_cost])円&#047;
                                    @include('admin.objects.components.radio', ['name' => 'broadcasting_fixed_cost_unit', 'radio' => $running_cost_unit, 'default' => 1, 'checked' => $article->broadcasting_fixed_cost_unit])
                            </div>
                        </div>
                    </td>
                </tr>
                <tr>
                    <th colspan="2">
                       <div class="d-flex justify-content-between">
                             <div>インターネットに係る費用</div>
                             <span class="require_applicable">該当必須</span>
                         </div>
                    </th>
                    <td>
@include('admin.objects.projects.umu-radio-cost', ['name' => 'internet', 'default' => 2, 'checked' => $article->internet?? 2])
                            <div class="initial_cost">
                                初期費用@include('admin.objects.projects.umu-share-radio', ['name' => 'internet_presence', 'default' => 0, 'checked' => $article->internet_presence])
                            <div class="initial_cost_detail">
@include('admin.objects.components.input', ['name' => 'internet_cost', 'value' => $article->internet_cost])円
                                </div>
                            </div>
                            <div class="running_cost">
                                定額費用@include('admin.objects.projects.umu-share-radio', ['name' => 'internet_fixed_presence', 'default' => 0, 'checked' => $article->internet_fixed_presence])
                            <div class="running_cost_detail">
@include('admin.objects.components.input', ['name' => 'internet_fixed_cost', 'value' => $article->internet_fixed_cost])円&#047;
                                    @include('admin.objects.components.radio', ['name' => 'internet_fixed_cost_unit', 'radio' => $running_cost_unit, 'default' => 1, 'checked' => $article->internet_fixed_cost_unit])
                            </div>
                         </div>
                     </td>
                 </tr>
                 <tr>
                     <th colspan="2">
                        <div class="d-flex justify-content-between">
                              <div>CATVに係る費用</div>
                              <span class="require_applicable">該当必須</span>
                          </div>
                     </th>
                     <td>
@include('admin.objects.projects.umu-radio-cost', ['name' => 'catv', 'default' => 2, 'checked' => $article->catv?? 2])
                            <div class="initial_cost">
                                初期費用@include('admin.objects.projects.umu-share-radio', ['name' => 'catv_presence', 'default' => 0, 'checked' => $article->catv_presence])
                            <div class="initial_cost_detail">
@include('admin.objects.components.input', ['name' => 'catv_cost', 'value' => $article->catv_cost])円
                                </div>
                            </div>
                            <div class="running_cost">
                                定額費用@include('admin.objects.projects.umu-share-radio', ['name' => 'catv_fixed_presence', 'default' => 0, 'checked' => $article->catv_fixed_presence])
                            <div class="running_cost_detail">
@include('admin.objects.components.input', ['name' => 'catv_fixed_cost', 'value' => $article->catv_fixed_cost])円&#047;
                                    @include('admin.objects.components.radio', ['name' => 'catv_fixed_cost_unit', 'radio' => $running_cost_unit, 'default' => 1, 'checked' => $article->catv_fixed_cost_unit])
                            </div>
                        </div>
                    </td>
                </tr>
                <tr>
                    <th colspan="2">
                       <div class="d-flex justify-content-between">
                             <div>町会費など</div>
                             <span class="require_applicable">該当必須</span>
                         </div>
                    </th>
                    <td>
                        <div>
@include('admin.objects.components.radio', ['name' => 'council', 'radio' => $council_cost, 'checked' => $article->council, 'default' => 0])
                            </div>
                            <div id="council_presence_area">
                                @include('admin.objects.projects.umu-money-radio', ['name' => 'council_presence', 'default' => 0, 'checked' => $article->council_presence?? 0])
                            </div>
                            <div id="council_cost_area">
                                @include('admin.objects.components.input', ['name' => 'council_cost', 'value' => $article->council_cost])円&#047;
                                @include('admin.objects.components.radio', ['name' => 'council_cost_unit', 'radio' => $cost_unit, 'checked' => $article->council_cost_unit, 'default' => 0])
                            </div>

                        </td>
                    </tr>
                    <tr>
                        <th colspan="2">
                           <div class="d-flex justify-content-between">
                                 <div>温泉</div>
                                 <span class="require_applicable">該当必須</span>
                             </div>
                        </th>
                        <td>
                            <div>
                                @include('admin.objects.components.radio', ['name' => 'spring', 'radio' => $spring_cost, 'checked' => $article->spring, 'default' => 0])
                            </div>
                            <div id="spring_area">
                            @include('admin.objects.projects.umu-money-radio', ['name' => 'spring_presence', 'default' => 0, 'checked' => $article->spring_presence?? 0])
                            </div>
                            <div id="spring_cost_area">
                                @include('admin.objects.components.input', ['name' => 'spring_cost', 'value' => $article->spring_cost])円&#047;
                                @include('admin.objects.components.radio', ['name' => 'spring_cost_unit', 'radio' => $cost_unit, 'checked' => $article->spring_cost_unit, 'default' => 0])
                            </div>
                            <div id="spring_kind_area">
                                <p class="mb-0">天然温泉ではない場合は選択</p>
                                @include('admin.objects.components.checkbox', ['name' => 'spring_kind', 'checkbox' => $spring_kind])
                            </div>
                        </td>
                    </tr>-->
                    <tr class="{{ (is_null($article->another_cost1) && !empty($article->another_cost_unit1)) || (!is_null($article->another_cost1) && empty($article->another_cost_unit1)) ? 'require_error' : '' }} require_tr">
                        <th colspan="2">
                            <div class="d-flex justify-content-between">
                                <div>その他諸費用１</div>
                                <span class="require_applicable">該当必須</span>
                            </div>
                        </th>
                        <td>
                            <div>
                                名称
                                @include('admin.objects.components.input', ['name' => 'another_cost_name1', 'value' => $article->another_cost_name1, 'id' => 'another_cost_name1'])
                            </div>
                            <div>
                                金額
                                @include('admin.objects.components.input', ['name' => 'another_cost1', 'class' => 'half-size', 'value' => $article->another_cost1, 'id' => 'another_cost1'])
                                円&#047;
                                @include('admin.objects.components.radio', ['name' => 'another_cost_unit1', 'radio' => $cost_unit, 'checked' => $article->another_cost_unit1, 'default' => 0, 'id' => 'another_cost_unit1'])
                            </div>
                        </td>
                    </tr>
                    <tr class="{{ (is_null($article->another_cost2) && !empty($article->another_cost_unit2)) || (!is_null($article->another_cost2) && empty($article->another_cost_unit2)) ? 'require_error' : '' }} require_tr">
                        <th colspan="2">
                            <div class="d-flex justify-content-between">
                                <div>その他諸費用２</div>
                                <span class="require_applicable">該当必須</span>
                            </div>
                        </th>
                        <td>
                            <div>
                                名称
                                @include('admin.objects.components.input', ['name' => 'another_cost_name2', 'value' => $article->another_cost_name2, 'id' => 'another_cost_name2'])
                            </div>
                            <div>
                                金額
                                @include('admin.objects.components.input', ['name' => 'another_cost2', 'class' => 'half-size', 'value' => $article->another_cost2, 'id' => 'another_cost2'])
                                円&#047;
                                @include('admin.objects.components.radio', ['name' => 'another_cost_unit2', 'radio' => $cost_unit, 'checked' => $article->another_cost_unit2, 'default' => 0, 'id' => 'another_cost_unit2'])
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <th colspan="2">その他諸費用３</th>
                        <td>
                            @include('admin.objects.components.textarea', ['name' => 'another_cost3', 'class' => 'ta500', 'placeholder' => 'その他諸費用', 'value' => $article->another_cost3])
                        </td>
                    </tr>
                    <tr>
                        <th colspan="2">価格備考(社内用)</th>
                        <td>
                            @include('admin.objects.components.textarea', ['name' => 'price_note', 'class' => 'ta500', 'placeholder' => '価格備考', 'value' => $article->price_note])
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
        @include('admin.objects.components.regist-tab', ['active' => 'overview','edit' => true])
        <div>
            @include('admin.objects.components.regist-band', ['title' => '３.物件概要'])
            <div class="p-regist">
                <table class="p-regist__table">
                    <tbody>
                    @include('admin.objects.projects.land-right')
                    </tbody>
                </table>
                <span>土地情報</span>
                <table class="p-regist__table">
                    <tbody>
                    <tr class="{{$article->land_area_val == null ? 'require_error': ''}}" id="land_area_val">
                        <th colspan="2">
                            <div class="d-flex justify-content-between">
                                <div>土地面積</div>
                                <span class="require">必須</span>
                            </div>
                        </th>
                        <td>
                            @include('admin.objects.components.radio', ['name' => 'land_area', 'radio' => $land_area, 'checked' => $article->land_area])
                            @include('admin.objects.components.input', ['name' => 'land_area_val', 'class' => 'half-size', 'placeholder' => '000.00', 'value' => $article->land_area_val])
                            &nbsp;m&sup2;<span>※私道面積は含めない</span>
                        </td>
                    </tr>
                    <tr>
                        <th colspan="2">土地条件<span class="require_applicable">該当必須</span></th>
                        <td>
                            <span>以下の項目があれば記入してください。</span>
                            <div>
                                @include('admin.objects.components.checkbox', ['name' => 'land_condition1', 'checkbox' => $land_condition1, 'checked' => $article->land_condition1])
                                <span>※傾斜地部分が３割以上の場合は面積のm&sup2;か％表記が必須</span>
                                <div id="land_condition1_area">
                                    @include('admin.objects.components.input', ['name' => 'land_condition_area1', 'value' => $article->land_condition_area1])
                                    @include('admin.objects.components.radio', ['name' => 'land_condition_unit1', 'radio' => $land_condition_unit, 'checked' => $article->land_condition_unit1])
                                </div>
                            </div>
                            <div>
                                @include('admin.objects.components.checkbox', ['name' => 'land_condition2', 'checkbox' => $land_condition2, 'checked' => $article->land_condition2])
                                <span>※路地状部分が３割以上の場合は面積のm&sup2;か％表記が必須</span>
                                <div id="land_condition2_area">
                                    @include('admin.objects.components.input', ['name' => 'land_condition_area2', 'value' => $article->land_condition_area2])
                                    @include('admin.objects.components.radio', ['name' => 'land_condition_unit2', 'radio' => $land_condition_unit, 'checked' => $article->land_condition_unit2])
                                </div>
                            </div>
                            <div>
                                @include('admin.objects.components.checkbox', ['name' => 'land_condition3', 'checkbox' => $land_condition3, 'checked' => $article->land_condition3])
                                <span>※高圧線下があればm&sup2;表記が必須</span>
                                <div id="land_condition3_area">
                                    @include('admin.objects.components.input', ['name' => 'land_condition_area3', 'value' => $article->land_condition_area3])
                                    m&sup2;
                                </div>
                            </div>
                        </td>
                    </tr>
                    {{-- @if (auth()->user()->isOwnerOfSaiKyoto())
                        <tr>
                            <th colspan="2">
                                <div class="d-flex justify-content-between">
                                    <div>国土法</div>
                                </div>
                            </th>
                            <td>
                                @include('admin.objects.components.radio', ['name' => 'kokudoho', 'radio' => $kokudoho, 'checked' => $article->kokudoho])
                            </td>
                        </tr>
                    @endif --}}
                    <tr>
                        <th colspan="2">再建築不可</th>
                        <td>
                            @include('admin.objects.components.checkbox', ['name' => 'land_not', 'checkbox' => $land_not, 'checked' => $article->land_not])
                        </td>
                    </tr>
                    <tr class="{{$article->ground == 0 ? 'require_error' : ''}}" id="ground">
                        <th colspan="2">
                            <div class="d-flex justify-content-between">
                                <div>地目</div>
                                <span class="require">必須</span>
                            </div>
                        </th>
                        <td>
                            @include('admin.objects.components.radio', ['name' => 'ground', 'radio' => $ground, 'checked' => $article->ground, 'default' => 0])
                        </td>
                    </tr>
                    @if (auth()->user()->isOwnerOfSaiKyoto())
                        <tr>
                            <th colspan="2">
                                <div class="d-flex justify-content-between">
                                    <div>地勢</div>
                                </div>
                            </th>
                            <td>
                                @include('admin.objects.components.radio', ['name' => 'terrain', 'radio' => $terrain, 'checked' => $article->terrain, 'default' => 0])
                            </td>
                        </tr>
                    @endif
                    <tr>
                        <th colspan="2">建ぺい率<span class="require_applicable">該当必須</span></th>
                        <td>
                            @include('admin.objects.components.input', ['name' => 'building_rate', 'id' => 'building_rate', 'class' => 'w100 half-size', 'value' => $article->building_rate])
                            ％
                            <span class="ml10">※「都市計画区域外」以外は必須</span>
                        </td>
                    </tr>
                    <tr>
                        <th colspan="2">容積率<span class="require_applicable">該当必須</span></th>
                        <td>
                            @include('admin.objects.components.input', ['name' => 'volume_rate', 'id' => 'volume_rate', 'class' => 'w100 half-size', 'value' => $article->volume_rate])
                            ％
                            <span class="ml10">※「都市計画区域外」以外は必須</span>
                        </td>
                    </tr>
                    <tr>
                        <th colspan="2">私道負担<span class="require_applicable">該当必須</span></th>
                        <td>
                            @include('admin.objects.projects.umu-share-radio-road', ['name' => 'road_burden', 'default' => 3, 'checked' => $article->road_burden?? 3])
                            <div id="road_burden_area1" class="mb10">
                                私道面積&nbsp;@include('admin.objects.components.input', ['name' => 'road_burden_area', 'class' => 'w100 half-size', 'placeholder' => '000.00', 'value' => $article->road_burden_area])
                                m&sup2;
                            </div>
                            <div id="road_burden_area2">
                                私道持分比率&nbsp;持分@include('admin.objects.components.input', ['name' => 'road_numerator', 'class' => 'w50 half-size', 'placeholder' => '0.0', 'value' => $article->road_numerator])
                                /全体@include('admin.objects.components.input', ['name' => 'road_denominator', 'class' => 'w50 half-size', 'placeholder' => '0.0', 'value' => $article->road_denominator])
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <th colspan="2">地役権<span class="require_applicable">該当必須</span></th>
                        <td>
                            @include('admin.objects.components.radio', ['name' => 'easement', 'radio' => $easement, 'default' => 0, 'checked' => $article->easement])
                            <div id="easement_area">
                                @include('admin.objects.components.input', ['name' => 'easement_area', 'class' => 'half-size', 'value' => $article->easement_area])
                                m&sup2;
                            </div>
                        </td>
                    </tr>
                    @include('admin.objects.projects.set-load-edit')
                    <tr>
                        <th colspan="2">上水道</th>
                        <td>
                            @include('admin.objects.components.radio', ['name' => 'water_supply', 'radio' => $water_supply, 'default' => 0, 'checked' => $article->water_supply])
                        </td>
                    </tr>
                    <tr>
                        <th colspan="2">下水道</th>
                        <td>
                            @include('admin.objects.components.radio', ['name' => 'sewerage', 'radio' => $sewerage, 'default' => 0, 'checked' => $article->sewerage])
                        </td>
                    </tr>
                    <tr>
                        <th colspan="2">ガス・オール電化</th>
                        <td>
                            @include('admin.objects.components.radio', ['name' => 'gas', 'radio' => $gas, 'default' => 0, 'checked' => $article->gas])
                        </td>
                    </tr>
                    <tr>
                        <th colspan="2">セットバック<span class="require_applicable">該当必須</span></th>
                        <td>
                            @include('admin.objects.components.radio', ['name' => 'set', 'radio' => $set, 'default' => 0, 'checked' => $article->set])
                            <div id="set_area">
                                面積&nbsp;@include('admin.objects.components.input', ['name' => 'set_area', 'class' => 'half-size', 'value' => $article->set_area])
                                m&sup2;
                                <span>※面積10％以上の場合は表記必須です。</span>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <th colspan="2">
                            <div class="d-flex justify-content-between">
                                <div>国土法</div>
                            </div>
                        </th>
                        <td>
                            @include('admin.objects.components.radio', ['name' => 'kokudoho', 'radio' => $kokudoho, 'checked' => $article->kokudoho])
                        </td>
                    </tr>
                    @include('admin.objects.projects.set-use-area')
                    <tr>
                        <th colspan="2">
                            <div class="d-flex justify-content-between">
                                <div>都市計画</div>
                                <span class="require_applicable">該当必須</span>
                            </div>
                        </th>
                        <td>
                            @include('admin.objects.components.selectbox', ['name' => 'city_plan', 'options' => $city_plan, 'title' => '都市計画', 'selected' => $article->city_plan])
                            <div id="city_plan_area">
                                建築許可理由
                                @include('admin.objects.components.selectbox', ['name' => 'city_plan_reason', 'options' => $city_plan_reason, 'title' => '建築許可理由', 'selected' => $article->city_plan_reason])
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <th colspan="2">土地備考(社内用)</th>
                        <td>
                            @include('admin.objects.components.textarea', ['name' => 'land_note', 'class' => 'ta500', 'placeholder' => '土地備考', 'value' => $article->land_note])
                        </td>
                    </tr>
                    </tbody>
                </table>
                <span>建物情報</span>
                <table class="p-regist__table">
                    <tbody>
                    <tr class="{{($article->total_area_val == null || $article->total_area == 0) ? 'require_error': ''}}"
                        id="total_area_val">
                        <th colspan="2">
                            <div class="d-flex justify-content-between">
                                <div>建物面積</div>
                                <span class="require">必須</span>
                            </div>
                        </th>
                        <td>
                            @include('admin.objects.components.radio', ['name' => 'total_area', 'radio' => $total_area, 'default' => 0, 'checked' => $article->total_area])
                            @include('admin.objects.components.input', ['name' => 'total_area_val', 'class' => 'half-size', 'placeholder' => '000.00', 'value' => $article->total_area_val])
                            &nbsp;m&sup2;
{{--                            <span>※私道面積は含めない</span>--}}
                        </td>
                    </tr>
                    <tr>
                        <th colspan="2">
                            <div class="d-flex justify-content-between">
                                <div>建物条件</div>
                                <span class="require_applicable">該当必須</span>
                            </div>
                        </th>
                        <td>
                            <span>以下の項目があれば記入してください。</span>
                            <div class="d-flex">
                                @include('admin.objects.components.checkbox', ['name' => 'building_condition1', 'checkbox' => $building_condition1, 'checked' => $article->building_condition1])
                                <div id="building_condition1_area">
                                    @include('admin.objects.components.input', ['name' => 'building_condition_area1', 'class' => 'half-size', 'value' => $article->building_condition_area1])
                                    m&sup2;
                                </div>
                            </div>
                            <div class="d-flex">
                                @include('admin.objects.components.checkbox', ['name' => 'building_condition2', 'checkbox' => $building_condition2, 'checked' => $article->building_condition2])
                                <div id="building_condition2_area">
                                    @include('admin.objects.components.input', ['name' => 'building_condition_area2', 'class' => 'half-size', 'value' => $article->building_condition_area2])
                                    m&sup2;
                                </div>
                            </div>
                            <div class="d-flex">
                                @include('admin.objects.components.checkbox', ['name' => 'building_condition3', 'checkbox' => $building_condition3, 'checked' => $article->building_condition3])
                                <div id="building_condition3_area">
                                    @include('admin.objects.components.input', ['name' => 'building_condition_area3', 'class' => 'half-size', 'value' => $article->building_condition_area3])
                                    m&sup2;
                                </div>
                            </div>
                            <div class="d-flex">
                                @include('admin.objects.components.checkbox', ['name' => 'building_condition4', 'checkbox' => $building_condition4, 'checked' => $article->building_condition4])
                                <div id="building_condition3_area">
                                    @include('admin.objects.components.selectbox', ['name' => 'building_condition_select', 'options' => $building_use, 'selected' => $article->building_condition_select])
                                </div>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <th colspan="2">
                            <div class="d-flex justify-content-between">
                                <div>間取り</div>
                                <!--<span class="require">必須</span>-->
                            </div>
                        </th>
                        <td>
                            @include('admin.objects.components.selectbox', ['name' => 'floor_plan', 'options' => $floor_plan, 'selected' => $article->floor_plan])
                            @include('admin.objects.components.selectbox', ['name' => 'floor_plan_type', 'options' => $floor_type, 'title' => '間取りタイプ', 'selected' => $article->floor_plan_type])
                        </td>
                    </tr>
                    <tr>
                        <th colspan="2">総戸数</th>
                        <td>
                            @include('admin.objects.components.input', ['name' => 'total_unit', 'class' => 'w100 half-size', 'value' => $article->total_unit])
                            戸
                        </td>
                    </tr>
                    <tr>
                        <th colspan="2">
                            <div class="d-flex justify-content-between">
                                <div>築年月（完成年月）</div>
                                <span class="require_applicable">該当必須</span>
                            </div>
                        </th>
                        <td>
                            <span class="require_alart">西暦</span>
                            @include('admin.objects.components.input', ['name' => 'age_year', 'class' => 'w100 half-size', 'value' => $article->age_year])
                            年
                            @include('admin.objects.components.selectbox', ['name' => 'age_month', 'options' => Config::get('const.MONTH'), 'class' => 'mr10', 'selected' => $article->age_month, 'title' => '築年月（月）'])
                            月
                            <span>
                                または契約後
                                @include('admin.objects.components.selectbox', ['name' => 'completed_contract_month', 'selected' => $article->completed_contract_month, 'options' => Config::get('const.KAGETSU'), 'title' => '完成時期'])ヶ月
                            </span>
                        </td>
                    </tr>
                    <tr class="{{$article->move_in == 0 ? 'require_error': ''}}" id="move_in">
                        <th colspan="2">
                            <div class="d-flex justify-content-between">
                                <div>引渡し</div>
                                <span class="require">必須</span>
                            </div>
                        </th>
                        <td>
                            @include('admin.objects.components.radio', ['name' => 'move_in', 'radio' => $move_in, 'default' => 0, 'checked' => $article->move_in])
                            <div id="move_in_year" class="mb10">
                                @include('admin.objects.components.selectbox', ['name' => 'move_in_year', 'options' => Config::get('const.YEAR'), 'selected' => $article->move_in_year, 'title' => '引渡し（年）'])
                                年
                                @include('admin.objects.components.selectbox', ['name' => 'move_in_month', 'options' => Config::get('const.MONTH'), 'selected' => $article->move_in_month, 'title' => '引渡し（月）'])
                                月
                            </div>
                            <div id="move_in_month">
                                @include('admin.objects.components.selectbox', ['name' => 'move_in_contract_month', 'options' => Config::get('const.MONTH'), 'selected' => $article->move_in_contract_month])
                                ヶ月
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <th colspan="2">
                            <div class="d-flex justify-content-between">
                                <div>引渡し条件</div>
                            </div>
                        </th>
                        <td>
                            @include('admin.objects.components.input', ['name' => 'move_in_conditions', 'class' => 'w300', 'value' => $article->move_in_conditions])
                        </td>
                    </tr>
                    <tr>
                        <th colspan="2">現況</th>
                        <td>
                            @include('admin.objects.components.selectbox', ['name' => 'current_status', 'options' => $genkyou, 'default' => 1, 'title' => '現況', 'selected' => $article->current_status])
                            <div id="current_status_area" class="mt5">
                                <div class="mb5">
                                    賃料&nbsp;@include('admin.objects.components.input', ['name' => 'current_status_val', 'class' => 'w100 half-size', 'value' => $article->current_status_val])
                                    円 / 月
                                </div>
                                <div class="">
                                    利回り&nbsp;@include('admin.objects.components.input', ['name' => 'current_status_rate', 'class' => 'w100 half-size', 'value' => $article->current_status_rate])
                                    ％
                                </div>
                            </div>
                        </td>
                    </tr>
                    <tr class="{{($article->construction == null) ? 'require_error' : ''}}" id="construction">
                        <th colspan="2">
                            <div class="d-flex justify-content-between">
                                <div>構造</div>
                                <span class="require">必須</span>
                            </div>
                        </th>
                        <td>
                            <div>
                                主要@include('admin.objects.components.selectbox', ['name' => 'construction', 'options' => $construction, 'class' => 'ml10', 'selected' => $article->construction])
                                <span class="require_alart">※1つ目のみ必須</span>
                            </div>
                            <div>
                                一部@include('admin.objects.components.selectbox', ['name' => 'construction_sub', 'options' => $construction_sub, 'title' => '構造一部', 'class' => 'ml10', 'selected' => $article->construction_sub])
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <th colspan="2">
                            <div class="d-flex justify-content-between">
                                <div>階数</div>
                                <!--<span class="require">必須</span>-->
                            </div>
                        </th>
                        <td>
                            <div class="d-flex">
                                <div>
                                    地上@include('admin.objects.components.selectbox', ['name' => 'floor', 'options' => Config::get('const.FLOOR'), 'class' => 'ml10 mr10', 'selected' => $article->floor])
                                    階&nbsp;&nbsp;
                                </div>
                                <div>
                                    地下@include('admin.objects.components.selectbox', ['name' => 'underground', 'options' => Config::get('const.FLOOR2'), 'class' => 'ml10 mr10', 'selected' => $article->underground, 'max' => 6])
                                    階
                                </div>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <th colspan="2">駐車場</th>
                        <td>
                            @include('admin.objects.components.radio', ['name' => 'parking', 'radio' => $parking, 'class' => 'ml10', 'default' => 0, 'checked' => $article->parking??0])
                        </td>
                    </tr>
                    <tr>
                        <th colspan="2">駐車可能台数</th>
                        <td>
                            @php
                                $parkingNumSai = [
                                    ['code' => 10, 'name' => '10'],
                                    ['code' => 11, 'name' => '11'],
                                    ['code' => 12, 'name' => '12'],
                                    ['code' => 13, 'name' => '13'],
                                    ['code' => 14, 'name' => '14'],
                                    ['code' => 15, 'name' => '15'],
                                ];
                            @endphp
                            @include('admin.objects.components.selectbox', ['name' => 'parking_num', 'options' => auth()->user()->isOwnerOfSaiKyoto() ? array_merge(Config::get('const.PARKING_NUM') , $parkingNumSai): Config::get('const.PARKING_NUM'), 'selected' => $article->parking_num, 'title' => '駐車可能台数'])
                            &nbsp;台
                        </td>
                    </tr>
                    <tr>
                        <th colspan="2">
                            <div class="d-flex justify-content-between">
                                <div>建築確認番号</div>
                                <span class="require_applicable">該当必須</span>
                            </div>
                        </th>
                        <td>
                            @include('admin.objects.components.input', ['name' => 'architecture_no', 'class' => 'w300', 'value' => $article->architecture_no])
                            <span class="require_alart">※新築戸建で未完成の場合、必須</span>
                        </td>
                    </tr>


                    <tr>
                        <th rowspan="2">リフォーム<span class="search_target">検索</span></th>
                        <th>外装</th>
                        <td>
                            <div>
                                @include('admin.objects.components.radio', ['name' => 'exterior', 'radio' => $reform, 'default' => 1, 'checked' => $article->exterior])
                            </div>
                            <div id="exterior_detail">
                                外装年月
                                @include('admin.objects.components.selectbox', ['name' => 'exterior_year', 'options' => Config::get('const.REFORM_YEAR'), 'selected' => $article->exterior_year])
                                年
                                @include('admin.objects.components.selectbox', ['name' => 'exterior_month', 'options' => Config::get('const.MONTH'), 'selected' => $article->exterior_month])
                                月
                                <br>
                                外装箇所
                                @include('admin.objects.components.checkbox', ['name' => 'exterior_place', 'checkbox' => $exterior])
                                @include('admin.objects.components.input', ['name' => 'exterior_text', 'class' => 'w100', 'value' => $article->exterior_text])
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <th>内装</th>
                        <td>
                            <div>
                                @include('admin.objects.components.radio', ['name' => 'interior', 'radio' => $reform, 'default' => 1, 'checked' => $article->interior])
                            </div>
                            <div id="interior_detail">
                                内装年月
                                @include('admin.objects.components.selectbox', ['name' => 'interior_year', 'options' => Config::get('const.REFORM_YEAR'), 'selected' => $article->interior_year])
                                年
                                @include('admin.objects.components.selectbox', ['name' => 'interior_month', 'options' => Config::get('const.MONTH'), 'selected' => $article->interior_month])
                                月
                                <br>
                                内装箇所
                                @include('admin.objects.components.checkbox', ['name' => 'interior_place', 'checkbox' => $interior])
                                @include('admin.objects.components.input', ['name' => 'interior_text', 'class' => 'w100', 'value' => $article->interior_text])
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <th colspan="2">建物備考(社内用)</th>
                        <td>
                            @include('admin.objects.components.textarea', ['name' => 'build_note', 'class' => 'ta500', 'placeholder' => '建物備考', 'value' => $article->build_note])
                        </td>
                    </tr>
                    </tbody>
                </table>
                <span>制限事項</span>
                <table class="p-regist__table">
                    <tbody>
                    <tr>
                        <th colspan="2">
                            <div class="d-flex justify-content-between">
                                <div>法令上の制限</div>
                                <span class="require_applicable">該当必須</span>
                            </div>
                        </th>
                        <td>
                            @include('admin.objects.components.checkbox-law', ['name' => 'law_restriction', 'checkbox' => $law, 'class' => 'checkbox_small'])
                        </td>
                    </tr>
                    <tr>
                        <th colspan="2" rowspan="2">その他制限事項<span class="require_applicable">該当必須</span></th>
                        <td>
                            @include('admin.objects.components.checkbox', ['name' => 'other_restriction', 'checkbox' => $other, 'class' => 'checkbox_small'])
                        </td>
                    </tr>
                    <!--<tr>
                        <td>
                            @include('admin.objects.components.selectbox', ['name' => 'other_reason', 'options' => $other_reason, 'selected' => $article->other_reason])
                            </td>
                        </tr>-->
                    <tr>
                        <td>
                            @include('admin.objects.components.textarea', ['name' => 'other_comment', 'class' => 'ta50 w-75', 'placeholder' => 'その他制限事項がある場合は１５０文字以内で入力してください', 'count' => 150, 'value' => $article->other_comment])
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
        @include('admin.objects.components.regist-tab', ['active' => 'investment','edit' => true])
        <div>
            @include('admin.objects.components.regist-band', ['title' => '４.投資・事業用'])
            <div class="p-regist">
                <table class="p-regist__table">
                    <tbody>
                    <tr>
                        <th colspan="2">
                            <div class="d-flex justify-content-between">
                                <div>区分</div>
                                <span class="require">必須</span>
                            </div>
                        </th>
                        <td>
                            <div>
                                @include('admin.objects.components.radio', ['name' => 'classfication', 'radio' => $classification, 'default' => 1, 'checked' => $article->classfication])
                            </div>
                        </td>
                    </tr>
                    </tbody>
                    <tbody id="classfication_area_default">
                    <tr>
                        <th colspan="2">売買区分</th>
                        <td>
                            <div>
                                @include('admin.objects.components.radio', ['name' => 'trading_classfication', 'radio' => $buy_class, 'default' => 1, 'checked' => $article->trading_classfication])
                            </div>
                        </td>
                    </tr>
                    </tbody>
                    <tbody id="classfication_area">
                    <tr>
                        <th colspan="2">事業用用途</th>
                        <td>
                            <div>
                                @include('admin.objects.components.radio', ['name' => 'use_method', 'radio' => $use_method, 'default' => 4, 'checked' => $article->use_method])
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <th colspan="2">事業用引渡し状態</th>
                        <td>
                            <div>
                                @include('admin.objects.components.radio', ['name' => 'business_status', 'radio' => $use_status, 'default' => 1, 'checked' => $article->business_status])
                            </div>
                        </td>
                    </tr>
                    </tbody>
                    <tbody id="classfication_in_area">
                    <tr>
                        <th colspan="2">投資用現況</th>
                        <td>
                            <div>
                                @include('admin.objects.components.radio', ['name' => 'investment_status', 'radio' => $investment, 'default' => 1, 'checked' => $article->investment_status])
                            </div>
                            <div>
                                <div>
                                    投資用収入実績@include('admin.objects.components.input', ['name' => 'investment_performance', 'value' => $article->investment_performance])
                                    円　／ @include('admin.objects.components.radio', ['name' => 'investment_performance_unit', 'radio' => $investment_unit, 'default' => 1, 'checked' => $article->investment_performance_unit])</div>
                                <div>
                                    投資用年利回り@include('admin.objects.components.input', ['name' => 'investment_interest', 'value' => $article->investment_interest])
                                    ％
                                </div>
                            </div>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
        @include('admin.objects.components.regist-tab', ['active' => 'advertisement','edit' => true])
        <div>
            @include('admin.objects.components.regist-band', ['title' => '５.取引情報・広告'])
            @include('admin.objects.projects.edit-vendor')
        </div>
        @include('admin.objects.components.regist-tab', ['active' => 'event','edit' => true])
        <div>
            @include('admin.objects.components.regist-band', ['title' => '６.イベント'])
            <div class="p-regist">
                <table class="p-regist__table">
                    <tbody>
                    @include('admin.objects.projects.event')
                    </tbody>
                </table>
            </div>
        </div>

        @include('admin.objects.components.regist-tab', ['active' => 'preview-img','edit' => true])
        <div>
            @include('admin.objects.components.regist-band', ['title' => '７. 写真'])
            <div class="p-regist">
                <table class="p-regist__table">
                    <tbody>
                    @include('admin.objects.projects.preview-img')
                    </tbody>
                </table>
                <div class="regist__div d-flex justify-content-center">
                    <div>
                        @if (! in_array(optional($article)->property, [6,7,99]))
                            <a href="javascript:void(0)" class="custom-redirect-img c-linkbtn c-linkbtn c-base-link__portal detail_image_portal">保存してポータル情報登録ページ</a>
                        @endif
                    </div>
                    <div class="">
                        <a class="c-base-tab__image saved_to_image un-required"
                           href="javascript:void(0)">保存して画像登録画面へ</a>
                    </div>
                    <div class="">
                        @include('admin.objects.components.btn', ['class' => 'c-base-tab__save', 'title' => '登録・保存'])
                    </div>
                </div>
            </div>
        </div>
    </form>



    {{-- 分譲地検索モーダルウィンドウ --}}
    @include('admin.objects.projects.modal-lot', ['no' => 1])
    @include('admin.objects.projects.modal-map', ['no' => 2])
    @include('admin.objects.projects.modal-traffic-multi', ['no' => 3])
    @include('admin.objects.projects.modal-traffic-single', ['no' => 4])
    @include('admin.objects.projects.modal-traffic-single', ['no' => 5])
    @include('admin.objects.projects.modal-traffic-single', ['no' => 6])
    @include('admin.objects.projects.modal-traffic-single', ['no' => 13])
    @include('admin.objects.projects.modal-traffic-single', ['no' => 14])
    @include('admin.objects.projects.modal-traffic-single', ['no' => 15])
    @include('admin.objects.projects.modal-vendor', ['no' => 9])
    {{--@include('admin.objects.projects.address-script')--}}
    @if(isset($saved) && $saved == 1)
        @include('admin.objects.projects.modal-message')
        <script type="text/javascript">
            window.onload = function () {
                var message = '登録・保存しました。';
                $('#saved_message').text(message);
                openMessageModal();
            };

        </script>
    @endif
@endsection
