<form class="side-search" id="search__form">
    <div class="side-search__inputs">
        <h3 class="side-search__title">現在の検索条件
            <a href="" onclick="d_app.handleBtnDownload(event)" class="simple-detail__save" id="btnDownload">
                <i class="fas fa-download"></i>現在の検索条件を保存する
            </a>
        </h3>
        <div class="side-search__wrapper">
            <div class="side-search__current-city">
                <div id="totalNumber">
                    <dl class="side-search__joken">
                        <dt>{{$theme??''}}</dt>
                    </dl>
                </div>
            </div>
        </div>

        <div class="side-search__jokenwrap">
            @if(isset($pm)) 
            <dl class="side-search__joken">
                <dt>物件種別</dt>
                <dd>
                    @if(in_array("2_1", $pm))
                    新築戸建 
                    @endif
                    @if(in_array("2_2", $pm))
                    中古戸建 
                    @endif
                    @if(in_array("1", $pm))
                    土地 
                    @endif
                    @if(in_array("3_2", $pm))
                    中古マンション 
                    @endif
                    @if(in_array("re", $pm))
                    リフォーム済
                    @endif
                </dd>
            </dl>
            @endif
            @if(isset($price_from) || isset($price_to))
            <dl class="side-search__joken">
                <dt>物件価格</dt>
                <dd>
                    @if($price_from != "")
                        {{$price_from}}万円〜
                    @endif
                    @if($price_to != "")
                        @if($price_from == "")
                            〜
                        @endif
                        {{$price_to}}万円
                    @endif
                </dd>
            </dl>
            @endif
            @if(isset($floor_plan))
            <dl class="side-search__joken">
                <dt>間取り</dt>
                <dd>
                    @if($floor_plan == 1)
                    1R-1LDK
                    @elseif($floor_plan == 2)
                    2K-2LDK
                    @elseif($floor_plan == 3)
                    3K-3LDK
                    @elseif($floor_plan == 4)
                    4K-4LDK
                    @elseif($floor_plan == 5)
                    5K
                    @endif
                </dd>
            </dl>
            @endif
            @if(isset($land_from))
            <dl class="side-search__joken">
                <dt>土地面積</dt>
                <dd>
                    {{$land_from}}㎡〜
                </dd>
            </dl>
            @endif
            @if(isset($land_from))
            <dl class="side-search__joken">
                <dt>建物面積</dt>
                <dd>
                    {{$buildingArea}}㎡〜
                </dd>
            </dl>
            @endif
            @if(isset($land_from))
            <dl class="side-search__joken">
                <dt>駅まで</dt>
                <dd>
                    徒歩{{$walk}}分以内
                </dd>
            </dl>
            @endif
            @if(isset($years_from) || isset($years_to))
            <dl class="side-search__joken">
                <dt>築年数</dt>
                <dd>
                    @if($years_from != "")
                        {{$years_from}}年〜
                    @endif
                    @if($years_to != "")
                        @if($years_from == "")
                            〜
                        @endif
                        {{$years_to}}年
                    @endif
                </dd>
            </dl>
            @endif
            @if(isset($hillLevel))
            <dl class="side-search__joken">
                <dt>坂道レベル</dt>
                <dd>
                    @if($hillLevel == 1)
                    ★
                    @elseif($hillLevel == 2)
                    ★★
                    @elseif($hillLevel == 3)
                    ★★★
                    @elseif($hillLevel == 4)
                    ★★★★
                    @else
                    -
                    @endif
                </dd>
            </dl>
            @endif
        </div>
    </div>
    <div class="side-search__inputs">
        
        <h3 class="side-search__title">
            絞り込み
        </h3>
        <div class="side-search__wrapper">
            <div class="side-search__mini-title">
                物件種別
            </div>
            <div class="side-search__types">
                <input type="checkbox" name="pm[]" value="2_1" id="nhouse" class="side-search__check" @if(isset($pm) && in_array("2_1", $pm)) checked @endif><label class="side-search__type" for="nhouse">新築戸建</label>
                <input type="checkbox" name="pm[]" value="2_2" id="uhouse" class="side-search__check" @if(isset($pm) && in_array("2_2", $pm)) checked @endif><label class="side-search__type" for="uhouse">中古戸建</label>
                <input type="checkbox" name="pm[]" value="1" id="land" class="side-search__check" @if(isset($pm) && in_array("1", $pm)) checked @endif><label class="side-search__type" for="land">土地</label>
                <input type="checkbox" name="pm[]" value="3_2" id="mansion" class="side-search__check" @if(isset($pm) && in_array("3_2", $pm)) checked @endif><label class="side-search__type" for="mansion">中古マンション</label>
                <input type="checkbox" name="pm[]" value="re" id="reformed" class="side-search__check" @if(isset($pm) && in_array("re", $pm)) checked @endif><label class="side-search__type" for="reformed">リフォーム済</label>
            </div>
        </div>
        <div class="side-search__wrapper">
            <div class="side-search__one">
                <div class="side-search__mini-title">
                    物件価格
                </div>
                <select name="price_from" id="" class="side-search__select">
                    <option value="">下限なし</option>
                    <option value="500" @if(isset($price_from) && $price_from == "500") selected @endif>500万円〜</option>
                    <option value="1000" @if(isset($price_from) && $price_from == "1000") selected @endif>1000万円〜</option>
                    <option value="1500" @if(isset($price_from) && $price_from == "1500") selected @endif>1500万円〜</option>
                    <option value="2000" @if(isset($price_from) && $price_from == "2000") selected @endif>2000万円〜</option>
                    <option value="2500" @if(isset($price_from) && $price_from == "2500") selected @endif>2500万円〜</option>
                    <option value="3000" @if(isset($price_from) && $price_from == "3000") selected @endif>3000万円〜</option>
                    <option value="3500" @if(isset($price_from) && $price_from == "3500") selected @endif>3500万円〜</option>
                    <option value="4000" @if(isset($price_from) && $price_from == "4000") selected @endif>4000万円〜</option>
                    <option value="4500" @if(isset($price_from) && $price_from == "4500") selected @endif>4500万円〜</option>
                    <option value="5000" @if(isset($price_from) && $price_from == "5000") selected @endif>5000万円〜</option>
                    <option value="5500" @if(isset($price_from) && $price_from == "5500") selected @endif>5500万円〜</option>
                    <option value="6000" @if(isset($price_from) && $price_from == "6000") selected @endif>6000万円〜</option>
                    <option value="6500" @if(isset($price_from) && $price_from == "6500") selected @endif>6500万円〜</option>
                    <option value="7000" @if(isset($price_from) && $price_from == "7000") selected @endif>7000万円〜</option>
                </select>
                <select name="price_to" id="" class="side-search__select">
                    <option value="">上限なし</option>
                    <option value="500" @if(isset($price_to) && $price_to == "500") selected @endif>〜500万円</option>
                    <option value="1000" @if(isset($price_to) && $price_to == "1000") selected @endif>〜1000万円</option>
                    <option value="1500" @if(isset($price_to) && $price_to == "1500") selected @endif>〜1500万円</option>
                    <option value="2000" @if(isset($price_to) && $price_to == "2000") selected @endif>〜2000万円</option>
                    <option value="2500" @if(isset($price_to) && $price_to == "2500") selected @endif>〜2500万円</option>
                    <option value="3000" @if(isset($price_to) && $price_to == "3000") selected @endif>〜3000万円</option>
                    <option value="3500" @if(isset($price_to) && $price_to == "3500") selected @endif>〜3500万円</option>
                    <option value="4000" @if(isset($price_to) && $price_to == "4000") selected @endif>〜4000万円</option>
                    <option value="4500" @if(isset($price_to) && $price_to == "4500") selected @endif>〜4500万円</option>
                    <option value="5000" @if(isset($price_to) && $price_to == "5000") selected @endif>〜5000万円</option>
                    <option value="5500" @if(isset($price_to) && $price_to == "5500") selected @endif>〜5500万円</option>
                    <option value="6000" @if(isset($price_to) && $price_to == "6000") selected @endif>〜6000万円</option>
                    <option value="6500" @if(isset($price_to) && $price_to == "6500") selected @endif>〜6500万円</option>
                    <option value="7000" @if(isset($price_to) && $price_to == "7000") selected @endif>〜7000万円</option>
                    
                </select>
            </div>
            <div class="side-search__one">
                <div class="side-search__mini-title">
                    間取り
                </div>
                <select name="floor_plan" id="" class="side-search__select">
                    <option value="">指定なし</option>
                    <option value="1" @if(isset($floor_plan) && $floor_plan == "1") selected @endif>1R-1LDK〜</option>
                    <option value="2" @if(isset($floor_plan) && $floor_plan == "2") selected @endif>2K-2LDK〜</option>
                    <option value="3" @if(isset($floor_plan) && $floor_plan == "3") selected @endif>3K-3LDK〜</option>
                    <option value="4" @if(isset($floor_plan) && $floor_plan == "4") selected @endif>4K-4LDK〜</option>
                    <option value="5" @if(isset($floor_plan) && $floor_plan == "5") selected @endif>5K〜</option>
                </select>
            </div>
            <div class="side-search__one">
                <div class="side-search__mini-title">
                    土地面積
                </div>
                <select name="land_from" id="" class="side-search__select">
                    <option value="">下限なし</option>
                    <option value="50" @if(isset($land_from) && $land_from == "50") selected @endif>50m²〜</option>
                    <option value="60" @if(isset($land_from) && $land_from == "60") selected @endif>60m²〜</option>
                    <option value="70" @if(isset($land_from) && $land_from == "70") selected @endif>70m²〜</option>
                    <option value="80" @if(isset($land_from) && $land_from == "80") selected @endif>80m²〜</option>
                    <option value="90" @if(isset($land_from) && $land_from == "90") selected @endif>90m²〜</option>
                    <option value="100" @if(isset($land_from) && $land_from == "100") selected @endif>100m²〜</option>
                    <option value="110" @if(isset($land_from) && $land_from == "110") selected @endif>110m²〜</option>
                    <option value="120" @if(isset($land_from) && $land_from == "120") selected @endif>120m²〜</option>
                    <option value="130" @if(isset($land_from) && $land_from == "130") selected @endif>130m²〜</option>
                    <option value="140" @if(isset($land_from) && $land_from == "140") selected @endif>140m²〜</option>
                    <option value="150" @if(isset($land_from) && $land_from == "150") selected @endif>150m²〜</option>
                    <option value="160" @if(isset($land_from) && $land_from == "160") selected @endif>160m²〜</option>
                    <option value="170" @if(isset($land_from) && $land_from == "170") selected @endif>170m²〜</option>
                    <option value="180" @if(isset($land_from) && $land_from == "180") selected @endif>180m²〜</option>
                    <option value="190" @if(isset($land_from) && $land_from == "190") selected @endif>190m²〜</option>
                    <option value="200" @if(isset($land_from) && $land_from == "200") selected @endif>200m²〜</option>
                </select>
            </div>
            <div class="side-search__one">
                <div class="side-search__mini-title">
                    建物面積
                </div>
                <select name="buildingArea" id="" class="side-search__select">
                    <option value="">下限なし</option>
                    <option value="30" @if(isset($buildingArea) && $buildingArea == "30") selected @endif>30m²〜</option>
                    <option value="40" @if(isset($buildingArea) && $buildingArea == "40") selected @endif>40m²〜</option>
                    <option value="50" @if(isset($buildingArea) && $buildingArea == "50") selected @endif>50m²〜</option>
                    <option value="60" @if(isset($buildingArea) && $buildingArea == "60") selected @endif>60m²〜</option>
                    <option value="70" @if(isset($buildingArea) && $buildingArea == "70") selected @endif>70m²〜</option>
                    <option value="80" @if(isset($buildingArea) && $buildingArea == "80") selected @endif>80m²〜</option>
                    <option value="90" @if(isset($buildingArea) && $buildingArea == "90") selected @endif>90m²〜</option>
                    <option value="100" @if(isset($buildingArea) && $buildingArea == "100") selected @endif>100m²〜</option>
                    <option value="110" @if(isset($buildingArea) && $buildingArea == "110") selected @endif>110m²〜</option>
                    <option value="120" @if(isset($buildingArea) && $buildingArea == "120") selected @endif>120m²〜</option>
                </select>
            </div>
            <div class="side-search__one">
                <div class="side-search__mini-title">
                    駅までの分数
                </div>
                <select name="walk" id="" class="side-search__select">
                    <option value="">指定なし</option>
                    <option value="5" @if(isset($walk) && $walk == "5") selected @endif>5分以内</option>
                    <option value="10" @if(isset($walk) && $walk == "10") selected @endif>10分以内</option>
                    <option value="15" @if(isset($walk) && $walk == "15") selected @endif>15分以内</option>
                    <option value="20" @if(isset($walk) && $walk == "20") selected @endif>20分以内</option>
                </select>
            </div>
            <div class="side-search__one">
                <div class="side-search__mini-title">
                    築年数
                </div>

                <select name="years_from" id="" class="side-search__select">
                    <option value="">下限なし</option>
                    <option value="5" @if(isset($years_from) && $years_from == "5") selected @endif>5年〜</option>
                    <option value="10" @if(isset($years_from) && $years_from == "10") selected @endif>10年〜</option>
                    <option value="15" @if(isset($years_from) && $years_from == "15") selected @endif>15年〜</option>
                    <option value="20" @if(isset($years_from) && $years_from == "20") selected @endif>20年〜</option>
                    <option value="25" @if(isset($years_from) && $years_from == "25") selected @endif>25年〜</option>
                    <option value="30" @if(isset($years_from) && $years_from == "30") selected @endif>30年〜</option>
                </select>
                <select name="years_to" id="" class="side-search__select">
                    <option value="">上限なし</option>
                    <option value="5" @if(isset($years_to) && $years_to == "5") selected @endif>〜5年</option>
                    <option value="10" @if(isset($years_to) && $years_to == "10") selected @endif>〜10年</option>
                    <option value="15" @if(isset($years_to) && $years_to == "15") selected @endif>〜15年</option>
                    <option value="20" @if(isset($years_to) && $years_to == "20") selected @endif>〜20年</option>
                    <option value="25" @if(isset($years_to) && $years_to == "25") selected @endif>〜25年</option>
                    <option value="30" @if(isset($years_to) && $years_to == "30") selected @endif>〜30年</option>
                </select>
            </div>
            <div class="side-search__one">
                <div class="side-search__mini-title">
                    坂道レベル
                </div>
                <select name="hillLevel" id="" class="side-search__select">
                    <option value="">指定なし</option>
                    <option value="1">★</option>
                    <option value="2">★★</option>
                    <option value="3">★★★</option>
                    <option value="4">★★★★</option>
                </select>
            </div>
        </div>
    </div>

    <div class="side-search__result">
        <div class="side-search__number">
            該当物件数：<span>{{$count}}</span>件
        </div>
        <button class="side-search__button">

            <i class="fas fa-search"></i>
            この条件で検索
        </button>
        <div class="side-search__clear"><a href="javascript:void(0);" id="clear_form">条件をクリア</a></div>
        <script type="text/javascript" >
            $(function(){
                $('#clear_form').on('click', function(){
                    $('#search__form')
                        .find("input, select, textarea")
                        .not(":button, :submit, :reset, :hidden, [name=address1], [name=search_lot_address1], [name=search_address1]")
                        .val("")
                        .prop("checked", false)
                        .prop("selected", false)
                    ;
                    $('#nhouse').prop('checked', false);
                    $('#uhouse').prop('checked', false);
                    $('#land').prop('checked', false);
                    $('#mansion').prop('checked', false);
                    $('#reformed').prop('checked', false);
                });
            })
        </script>
    </div>
    </section>
</form>