project-filter.php 11.1 KB
<? $projectFilter = \SH\ProjectFilter::getInstance() ; ?>


<form class="js-filter form-filter<? if($arParams['IS_AJAX_FILTER']) { ?> ajax-filter<? } ?>" method="get" action="/projects/<? if(!empty($arParams['IS_FAVE'])) { ?>fave/<? } ?>" id='search_form_main'>


<? foreach($projectFilter->getFilterData() as $key => $filterData) {



    ?>

<? foreach($filterData['items'] as $code => $filterItem) {



    $key == 'section' ? $input_class = 'section_input' : $input_class = 'value_input';

?>



     <? if($code == 'all') {

            if($APPLICATION->GetCurPage() != '/') {

                    ?> <input type="hidden" name="<?= $key ?>[<?= $code ?>]" value="<?= $filterItem['selected'] ? 1 : 0 ?>" id="<?= $key ?>-<?= $code ?>" class="<?=$input_class;?>"><?

                }

            } else {

                if($APPLICATION->GetCurPage() == '/') { ?>

                        <input type="hidden" name="<?= $key ?>[<?= $code ?>]" value="<?= $code == 'house' ? 1 : 0 ?>" id="<?= $key ?>-<?= $code ?>" class="<?=$input_class;?>">

                <? } else {

                ?>

                 <input type="hidden" name="<?= $key ?>[<?= $code ?>]" value="<?= $filterItem['selected'] ? 1 : 0 ?>" id="<?= $key ?>-<?= $code ?>" class="<?=$input_class;?>">

                <?}


            }?>


        <? } ?>

<? } ?>


    <div class="filter <? if($APPLICATION->GetCurPage() == '/') { ?>_main-page<? } else { ?>_inner-page<? } ?>">
        <div class="filter-element _type">
<? $key = 'section'; $filterData = $projectFilter->getFilterData($key) ?>
<? foreach($filterData['items'] as $code => $filterItem) { ?>
            <? if($code == 'all') { // не выводим раздел "все" на главной стр
                if($APPLICATION->GetCurPage() != '/') {
                    ?><a href="<?= $filterItem['url'] ?>" class="filter-type" data-input="<?= $key ?>-<?= $code ?>" data-type="<?= $code ?>"><?= $filterItem['name'] ?></a><?
                }
            } else { ?>
                <a href="<?= $filterItem['url'] ?>" class="filter-type" data-input="<?= $key ?>-<?= $code ?>"  data-type="<?= $code ?>"><?= $filterItem['name'] ?></a>
            <? }?>
<? } ?>
        </div>
<?if($APPLICATION->GetCurPage() != '/') {?> </div>
 <? if ($_SERVER['REQUEST_URI'] == '/projects/') { ?>
                <style>
                    /*.page-content {*/
                        /*!*padding: 100px 0 30px 0;*!*/
                    /*}*/
                    /*.projects-list {*/
                        /*margin-top: 45px;*/
                    /*}*/
                    .text-content H1 {
                        margin: 0;
                        padding: 0;
                    }
                    .static-content {
                        padding-bottom: 0;
                        margin-top: 40px;
                    }
                    @media (max-width: 1000px) {

                        @media (max-width: 1024px) {
                        .page-head._bigger + .page-content {
                            padding-top: 0px;
                        }
                    }
                </style>
            <?}?>
<? if ($_SERVER['REQUEST_URI'] == '/projects/doma-iz-kleenogo-brusa/'){ ?>

    <style>
        .page-content {
            /*padding: 100px 0 30px 0;*/
        }
        .projects-list {
            margin-top: 80px;
        }
        .text-content H1 {
            margin: 0;
            padding: 0;
        }
        .static-content {
            padding-bottom: 0;
            margin-top: 40px;
        }
        @media (max-width: 1000px) {

            .out_sub_menu {
                top: 193px;
                z-index: 10;
            }
        }
        @media (max-width: 1024px) {
            .page-head._bigger + .page-content {
                padding-top: 200px;
            }
        }
    </style>

<?}if ($_SERVER['REQUEST_URI'] == '/projects/bani-iz-kleenogo-brusa/'){?>

                <style>
                    .page-content {
                        /*padding: 100px 0 30px 0;*/
                    }
                    .projects-list {
                        margin-top: 45px;
                    }
                    .text-content H1 {
                        margin: 0;
                        padding: 0;
                    }
                    .static-content {
                        padding-bottom: 0;
                        margin-top: 40px;
                    }
                    @media (max-width: 1000px) {

                        .out_sub_menu {
                            /*top: 193px;*/
                            z-index: 10;
                        }
                    }


                    @media (max-width: 1024px) {
                        .page-head._bigger + .page-content {
                            padding-top: 100px;
                        }

                    }
                </style>

                <?}if ($_SERVER['REQUEST_URI'] == '/projects/raznye-proekty/'){?>

                <style>
                    .page-content {
                        /*padding: 100px 0 30px 0;*/
                    }
                    .projects-list {
                        margin-top: 45px;
                    }
                    .text-content H1 {
                        margin: 0;
                        padding: 0;
                    }
                    .static-content {
                        padding-bottom: 0;
                        margin-top: 40px;
                    }
                    @media (max-width: 1000px) {

                        .out_sub_menu {
                            top: 193px;
                            z-index: 10;
                        }
                    }
                    @media (max-width: 1024px) {
                        .page-head._bigger + .page-content {
                            padding-top: 230px;
                        }
                    }

                </style>

            <?}?>
 <?}?>

   <?if($APPLICATION->GetCurPage() != '/') {?> <div class='out_sub_menu'> <?}?>


                <div class="filter-element _parent">
                    <div class="filter-element _house _inactive" data-type="house">
                        <div class="filter-element _select _house-area">
                            <?if($APPLICATION->GetCurPage() == '/') {?> <a href="#!" class="filter-select-title">площадь</a> <?}?>
                            <div class="filter-select">
                                <div class='filter-inner-wrap'>
                                    <? $key = 'square'; $filterData = $projectFilter->getFilterData($key) ; ?>
                                    <? foreach($filterData['items'] as $code => $filterItem) { ?>
                                                            <a href="#!" class="filter-select-item filter-chosable"  data-name="<?= $key ?>:<?= $code ?>" data-input="<?= $key ?>-<?= $code ?>"><span><?= $filterItem['name'] ?></span></a>
                                    <? } ?>
                                </div>
                            </div>
                        </div>
                        <div class="filter-element _select _house-floors">
                            <?if($APPLICATION->GetCurPage() == '/') {?> <a href="#!" class="filter-select-title">этажи</a> <?}?>
                            <div class="filter-select">
                                <div class='filter-inner-wrap'>
                                    <? $key = 'floors'; $filterData = $projectFilter->getFilterData($key) ?>
                                    <? foreach($filterData['items'] as $code => $filterItem) { ?>
                                                            <a href="#!" class="filter-select-item filter-chosable"  data-name="<?= $key ?>:<?= $code ?>" data-input="<?= $key ?>-<?= $code ?>"><span><?= $filterItem['name'] ?></span></a>
                                    <? } ?>
                                </div>
                            </div>
                        </div>

                        <div class="filter-element _select _house-bedrooms">
                            <?if($APPLICATION->GetCurPage() == '/') {?> <a href="#!" class="filter-select-title">спальни</a> <?}?>
                            <div class="filter-select">
                                <div class='filter-inner-wrap'>
                                    <? $key = 'bedrooms'; $filterData = $projectFilter->getFilterData($key) ?>
                                    <? foreach($filterData['items'] as $code => $filterItem) { ?>
                                                            <a href="#!" class="filter-select-item filter-chosable"  data-name="<?= $key ?>:<?= $code ?>" data-input="<?= $key ?>-<?= $code ?>"><span><?= $filterItem['name'] ?></span></a>
                                    <? } ?>
                                </div>
                            </div>
                        </div>


                        <div class="filter-element _select _house-combo">
                            <?if($APPLICATION->GetCurPage() == '/') {?> <a href="#!" class="filter-select-title">Тип</a> <?}?>
                            <div class="filter-select">
                                <div class='filter-inner-wrap'>
                                    <? $key = 'combo'; $filterData = $projectFilter->getFilterData($key) ;?>
                                    <? foreach($filterData['items'] as $code => $filterItem) { ?>
                                                            <a href="#!" class="filter-select-item filter-chosable"  data-name="<?= $key ?>:<?= $code ?>" data-input="<?= $key ?>-<?= $code ?>"><span><?= $filterItem['name'] ?></span></a>
                                    <? } ?>
                                </div>
                            </div>
                        </div>





                    </div>
                    <div class="filter-element _bathhouse _inactive" data-type="bathhouse">
                        <? $key = 'bathhouse-floors'; $filterData = $projectFilter->getFilterData($key) ?>
                        <? foreach($filterData['items'] as $code => $filterItem) { ?>
                                        <a href="#!" class="filter-option filter-chosable"  data-name="<?= $key ?>:<?= $code ?>" data-input="<?= $key ?>-<?= $code ?>"><span><?= $filterItem['name'] ?></span></a>
                        <? } ?>
                    </div>
                    <div class="filter-element _misc _inactive" data-type="misc">
                        <? $key = 'misc-type'; $filterData = $projectFilter->getFilterData($key) ; ?>
                        <? foreach($filterData['items'] as $code => $filterItem) { ?>
                                        <a href="#!" class="filter-option filter-chosable"  data-name="<?= $key ?>:<?= $code ?>" data-input="<?= $key ?>-<?= $code ?>"><span><?= $filterItem['name'] ?></span></a>
                        <? } ?>
                    </div>
                    <div class="filter-element _all _inactive" data-type="all"></div>
                </div>




        <?if($APPLICATION->GetCurPage() == '/') {?> <button class="filter-element _submit filter-submit-button" type="submit">подобрать</button> <?}?>
    </div>





</form>