// optional Product List Filter
if (isset ($_GET['manufacturers_id'])) {
$filterlist_sql = "select distinct c.categories_id as id, cd.categories_name as name from ".TABLE_PRODUCTS." p, ".TABLE_PRODUCTS_TO_CATEGORIES." p2c, ".TABLE_CATEGORIES." c, ".TABLE_CATEGORIES_DESCRIPTION." cd where p.products_status = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p2c.categories_id = cd.categories_id and cd.language_id = '".(int) $_SESSION['languages_id']."' and p.manufacturers_id = '".(int) $_GET['manufacturers_id']."' order by cd.categories_name";
} else {
$filterlist_sql = "select distinct m.manufacturers_id as id, m.manufacturers_name as name from ".TABLE_PRODUCTS." p, ".TABLE_PRODUCTS_TO_CATEGORIES." p2c, ".TABLE_MANUFACTURERS." m where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and p.products_id = p2c.products_id and p2c.categories_id = '".$current_category_id."' order by m.manufacturers_name";
}
$filterlist_query = xtDBquery($filterlist_sql);
$manufacturer_dropdown = xtc_draw_form('filter', FILENAME_DEFAULT, 'get');
if (isset ($_GET['manufacturers_id'])) {
$manufacturer_dropdown .= xtc_draw_hidden_field('manufacturers_id', (int)$_GET['manufacturers_id']);
$options = array (array ('text' => TEXT_ALL_CATEGORIES));
} else {
$manufacturer_dropdown .= xtc_draw_hidden_field('cat', $_GET['cat']);
$options = array (array ('text' => TEXT_ALL_MANUFACTURERS));
}
$manufacturer_dropdown .= xtc_draw_hidden_field('sort', $_GET['sort']);
$manufacturer_dropdown .= xtc_draw_hidden_field(xtc_session_name(), xtc_session_id());
while ($filterlist = xtc_db_fetch_array($filterlist_query, true)) {
$options[] = array ('id' => $filterlist['id'], 'text' => $filterlist['name']);
}
$manufacturer_dropdown .= xtc_draw_pull_down_menu('filter_id', $options, $_GET['filter_id']);
///////////// priceto
if (isset ($_GET['priceto'])) {
$manufacturer_dropdown .= xtc_draw_hidden_field('priceto', (int)$_GET['priceto']);
}else{
$optionsp = array (array ('text' => TEXT_KLEUR));
$manufacturer_dropdown .= xtc_draw_input_field('filterp_id',$optionsp,$_GET['filterp_id']);
}
$manufacturer_dropdown .= '
<td>...lukt niet....</td>
';
//KLEUR
if (isset ($_GET['kleur_id'])) {
$filterlistk_sql = "select distinct c.categories_id as idk, cd.categories_name as namek from ".TABLE_PRODUCTS." p, ".TABLE_PRODUCTS_TO_CATEGORIES." p2c, ".TABLE_CATEGORIES." c, ".TABLE_CATEGORIES_DESCRIPTION." cd where p.products_status = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p2c.categories_id = cd.categories_id and cd.language_id = '".(int) $_SESSION['languages_id']."' and p.kleur_id = '".(int) $_GET['kleur_id']."' order by cd.categories_name";
} else {
$filterlistk_sql = "select distinct k.kleur_id as idk, k.kleur as namek from ".TABLE_PRODUCTS." p, ".TABLE_PRODUCTS_TO_CATEGORIES." p2c, ".TABLE_KLEUR." k where p.products_status = '1' and p.kleur_id = k.kleur_id and p.products_id = p2c.products_id and p2c.categories_id = '".$current_category_id."' order by k.kleur";
}
$filterlistk_query = xtDBquery($filterlistk_sql);
if (isset ($_GET['kleur_id'])) {
$manufacturer_dropdown .= xtc_draw_hidden_field('filter', (int)$_GET['kleur_id']);
$optionsk = array (array ('text' => TEXT_ALL_CATEGORIES));
} else {
$manufacturer_dropdown .= xtc_draw_hidden_field('cat', $_GET['cat']);
$optionsk = array (array ('text' => TEXT_KLEUR));
}
$manufacturer_dropdown .= xtc_draw_hidden_field('sort', $_GET['sort']);
$manufacturer_dropdown .= xtc_draw_hidden_field(xtc_session_name(), xtc_session_id());
while ($filterlistk = xtc_db_fetch_array($filterlistk_query, true)) {
$optionsk[] = array ('id' => $filterlistk['idk'], 'text' => $filterlistk['namek']);
}
$manufacturer_dropdown .= xtc_draw_pull_down_menu('filterk_id', $optionsk, $_GET['filterk_id']);
$manufacturer_dropdown .= xtc_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH);
$manufacturer_dropdown .= '</form>'."\n";