function ComboBoxneckermannNavIDs($type, $name, $value = '', $class = '', $html_params = '') { $navid = array(); $navid = neckermannNavIDs($type); $navoptions = '<select name="' . $name . '"'; if ($class != '') { $navoptions .= ' class="' . $class . '"'; } if ($html_params != '') { $navoptions .= ' ' . $html_params; } $navoptions .= '>'; $selected = $value == '' ? 'selected="selected"' : ''; $navoptions .= '<option value="" ' . $selected . '>Please select a navigation...</option>'; foreach ($navid as $val => $text) { if ($type == 's' || $type == '*') { $m1 = 'Herren-'; $f1 = 'Damen-'; $m2 = 'Herren'; $f2 = 'Damen'; $jng = 'J&G-'; $s = 'Special-'; } else { $m = ''; $f = ''; $jng = ''; $s = ''; } if ($type == 'jng' || $type == '*') { $text = str_replace('Mode für Sie | Marken | Julie & Grace | ', $jng, $text); } if ($type == 's' || $type == '*') { $text = str_replace('Mode für Sie | Themen | Charms & Beads | ', $s, $text); $text = str_replace('Shops & Specials | weitere Specials | ', $s, $text); $text = str_replace('Themen | Schmuck bis zu 50 % reduziert! | ', '50%Disc-', $text); } if ($type == 'm' || $type == '*') { $text = str_replace('Mode für Ihn | Schmuck & Uhren | ', $m1, $text); } if ($type == 'f' || $type == '*') { $text = str_replace('Mode für Sie | Schmuck & Uhren | ', $f1, $text); } if ($type == 's' || $type == '*') { $text = str_replace('Mode für Ihn | Schmuck & Uhren', $m2, $text); } if ($type == 's' || $type == '*') { $text = str_replace('Mode für Sie | Schmuck & Uhren', $f2, $text); } if ($type == 'sch' || $type == '*') { $text = str_replace('Schmuck & Uhren | ', '', $text); } if ($type == '*') { $text = str_replace('Halsschmuck', 'Halss', $text); } $text = str_replace('', '', $text); $selected = $value == $val ? 'selected="selected"' : ''; $navoptions .= '<option value="' . $val . '" ' . $selected . '>' . $text . '</option>'; } $navoptions .= '</select>'; return $navoptions; }
<?php global $db; require_once '../confy.php'; require_once '../functions.php'; require_once '../functions-2.php'; tep_db_connect(); $q = "SELECT navigation FROM jng_sp_catalog GROUP BY navigation"; $r = tep_db_query($q); $navs = array(); while ($row = tep_db_fetch_array($r)) { $navs[] = $row['navigation']; } $navid = neckermannNavIDs(); $show = array(); foreach ($navid as $id => $name) { if (in_array($id, $navs)) { $show[] = array($id, $name); } } echo '<pre>'; echo tep_create_csv($show); echo '</pre>'; tep_db_close();