project-filter1.php
7.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<? $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>
<style>
.page-content {
padding: 100px 0 30px 0;
}
.projects-list {
margin-top: 40px;
}
.text-content H1 {
margin: 0;
padding: 0;
}
.static-content {
padding-bottom: 0;
margin-top: 40px;
}
</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>
<?if($APPLICATION->GetCurPage() == '/') {?> <button class="filter-element _submit filter-submit-button" type="submit">подобрать</button> <?}?>
</div>
</div>
</form>