Новости | FAQ | Авторы | Документация | В действии | Библиотека |
Инструменты | Полезные ссылки | Хостинги | Скачать | Примеры | Форум |
Николай 17.01.2006 10:19
Задача: при выборе определенной категории товаров показать по каким параметрам может осуществляться фильтрация.#Получаем индентификатор выбранной категории товаров $id[^form:id.int(0)] ^connect[$connect_string]{ $context_filter[^table::sql{select context_filter.context_filter_id, context_filter.context, context_preamble.context_preamble_id, context_preamble.context_preamble, context_preamble.link_to_context_preamble_id, categories.category_id, companies.company_id from context_filter, context_preamble, relations_context_filter, categories, companies where context_filter.context_filter_id = relations_context_filter.context_filter_id and context_preamble.context_preamble_id = relations_context_filter.context_preamble_id and categories.category_id = relations_context_filter.category_id GROUP BY context_filter_id }] $context_preamble[^table::sql{SELECT relations_context_filter.category_id, relations_context_filter.context_preamble_id, context_preamble.context_preamble, context_preamble.link_to_context_preamble_id FROM context_preamble, relations_context_filter, categories WHERE relations_context_filter.context_preamble_id = context_preamble.context_preamble_id AND relations_context_filter.context_preamble_id = context_preamble.context_preamble_id GROUP BY context_preamble_id}] ^context_preamble.menu{ #если у выбранной категории есть преамбула контекстного фильтра выводим ее ^if($context_preamble.category_id eq $id){ <font color="cccccc">Идентификатор преамбулы: $context_preamble.context_preamble_id</font><br> <span>$context_preamble.context_preamble: </span> $context_preamble_parent[$context_preamble.context_preamble_id] $contex[^context_filter.select($context_filter.context_preamble_id == $context_preamble_parent)] ^contex.menu{ <span style="color:green">$contex.context</span> }{ <span style="color:green"> | </span> } } }{ ^if($context_preamble.category_id eq $id && def $contex){ <br> } }