" . "Keresés"; $where = $where . " AND 1=2"; } else { $page["title"] = "Keresés: " . $searchKeyword; $page["h1"] = "Keresés: " . $searchKeyword; $page["desc"] = "Keresés az alábbi kifejezésre: " . $searchKeyword; $page["keys"] = $searchKeyword; $searchLink = str_replace(" ","+",$searchKeyword); $nav[2] = "" . "Keresés: " . $searchKeyword . ""; $currUrl = $settings["href"] . "kereses/" . $searchLink; $where = $where . " AND (products.name LIKE '%" . $searchKeyword . "%' OR products.keywords LIKE '%" . $searchKeyword . "%')"; } } elseif(isset($_GET["mfr"])) { // GYÁRTÓ $mfr = substr($_GET["mfr"],0,strpos($_GET["mfr"], "-")); $sqlMfr = "SELECT name, description, keywords FROM makers WHERE id='" . $mfr . "'"; $mysql_queryMfr = mysql_query($sqlMfr); while($lineMfr = mysql_fetch_array($mysql_queryMfr)) { $list["maker-name"] = $lineMfr["name"] . " termékek"; $list["maker-desc"] = $lineMfr["description"]; $list["maker-keys"] = $lineMfr["keywords"]; } $page["title"] = $list["maker-name"]; $page["h1"] = $list["maker-name"]; $page["desc"] = $list["maker-desc"]; $page["keys"] = $list["maker-keys"]; $nav[2] = "" . $list["maker-name"] . ""; $currUrl = $settings["href"] . "gyarto/" . $_GET["mfr"]; $where = $where . "AND products.maker='" . $mfr . "'"; $enableMfrFilter = 1; } elseif($sub == "" AND $middle == "" AND $main == "") { // ÖSSZES TERMÉK $page["title"] = "Termékek"; $page["h1"] = "Termékek"; $page["desc"] = "Az alábbi listában, a webáruházban található összes terméket megtalálja."; $currUrl = $settings["href"] . "termekek/"; } $nav[1] = "Termékek"; // MAIN if($main != "") { $current_category = $main; $sql = "SELECT * FROM categories_main WHERE id='$main'"; $mysql_query = mysql_query($sql); while($line = mysql_fetch_array($mysql_query)) { $page["title"] = $line["name"]; $page["keys"] = $line["meta_keywords"]; $page["desc"] = $line["meta_description"]; $page["desc2"] = $line["long_description"]; $page["h1"] = $line["name"]; $page["main-link"] = $settings["href"] . "termekek/" . $main . "-" . $line["link"]; $nav[2] = "" . $line["name"] . ""; $currUrl = $page["main-link"]; } $category_sql = " AND categories_main.id='$main'"; } // MIDDLE if($middle != "") { $current_category = $middle; $sql = "SELECT * FROM categories_middle WHERE id = '$middle'"; $mysql_query = mysql_query($sql); while($line = mysql_fetch_array($mysql_query)) { $page["title"] = $page["title"] . " / " . $line["name"]; $page["keys"] = $line["meta_keywords"]; $page["desc"] = $line["meta_description"]; $page["desc2"] = $line["long_description"]; $page["h1"] = $line["name"]; $page["middle-link"] = $page["main-link"] . "/" . $middle . "-" . $line["link"]; $nav[3] = "" . $line["name"] . ""; $currUrl = $page["middle-link"]; } $category_sql = " AND categories_middle.id='$middle'"; } // SUB if($sub != "") { $current_category = $sub; $sql = "SELECT * FROM categories_sub WHERE id='$sub'"; $mysql_query = mysql_query($sql); while($line = mysql_fetch_array($mysql_query)) { $page["title"] = $page["title"] . " / " . $line["name"]; $page["keys"] = $line["meta_keywords"]; $page["desc"] = $line["meta_description"]; $page["desc2"] = $line["long_description"]; $page["h1"] = $line["name"]; $page["sub-link"] = $page["middle-link"] . "/" . $sub . "-" . $line["link"]; $nav[4] = "" . $line["name"] . ""; $currUrl = $page["sub-link"]; } $category_sql = " AND categories_sub.id='$sub'"; } /*****************/ /* TERMÉKCSOPORT */ /*****************/ if(isset($_GET["group"])) { $group = strip_tags(substr($_GET["group"],0,strpos($_GET["group"], "-"))); $group_sql = " AND products.groups = " . $group; $sql = "SELECT * FROM groups WHERE id = " . $group; $mysql_query = mysql_query($sql); while($line = mysql_fetch_array($mysql_query)) { $page["title"] = $page["title"] . " / " . $line["name"]; $page["keys"] = $line["meta_keywords"]; $page["desc"] = $line["meta_description"]; $page["h1"] = $line["name"]; $currUrl = $settings["href"] . "termekcsoport/" . $line["id"] . "-" . createLink($line["name"]); } } /************/ /* ORDER BY */ /************/ $orderby = $_SESSION["orderby"]; if(isset($_POST["orderby"])) { $orderby = $_POST["orderby"]; $_SESSION["orderby"] = $orderby; } elseif($orderby == "") { switch($settings["display_list_order"]) { case 1: $orderby = "products.id DESC"; break; case 2: $orderby = "products.name"; break; case 3: $orderby = "products.name DESC"; break; case 4: $orderby = "products.price"; break; case 5: $orderby = "products.price DESC"; break; case 6: $orderby = "products.is_order"; break; } } /*************/ /* LIST VIEW */ /*************/ $listType = $_SESSION["listType"]; if($listType == "") { $listTypeDef[1] = "grid"; $listTypeDef[2] = "list"; $listType = $listTypeDef[$settings["display_list_view"]]; } /*********/ /* PRICE */ /*********/ if(is_numeric($_GET["min"])) { $min = $_GET["min"]; if(isset($_SESSION["setPriceMin"]) AND $min < $min) { $min = $_SESSION["setPriceMin"]; } $minSql = "ROUND(products.price * products.afa / 100) + products.price >= " . $min; } if(is_numeric($_GET["max"])) { $max = $_GET["max"]; if(isset($_SESSION["setPriceMax"]) AND $max > $_SESSION["setPriceMax"]) { $max = $_SESSION["setPriceMax"]; } $priceSql = " AND (" . $minSql . " AND ROUND(products.price * products.afa / 100) + products.price <= " . $max . ")"; } /**********/ /* FILTER */ /**********/ $addToUrl = ""; $filterCount = 0; foreach($_GET as $key => $value) { if($key == "min") { $addToUrl = $addToUrl . "&min=" . $value; } if($key == "max") { $addToUrl = $addToUrl . "&max=" . $value; } if(substr($key,0,6) == "szures") { $addToUrl = $addToUrl . "&" . $key . "=" . $value; if($value != 0) { $filterCount++; $filerSql = $filerSql . " AND products.p_" . substr($key,7) . "='$value'"; } } } if($filterCount != 0) { $filerSql = " AND (" . substr($filerSql,5) . ")"; } /*********/ /* WHERE */ /*********/ $where = $where . " AND categories_sub.id != '' AND products.parent_id = 0 AND products.is_show = 1" . $category_sql . $priceSql . $filerSql . $group_sql; /*****************/ /* PRICE MIN MAX */ /*****************/ $minPrice = 0; $maxPrice = 1000; $sql = "SELECT MIN(price) AS minprice, MAX(price) AS maxprice FROM products"; $mysql_query = mysql_query($sql); while($line = mysql_fetch_array($mysql_query)) { $minPrice = $line["minprice"] + round($line["minprice"] * 0 / 100); $maxPrice = $line["maxprice"] * 2; } /****************/ /* FILTER SZŰRŐ */ /****************/ $filter_new_sql = ""; $filter_new_count = 0; foreach ($_SESSION as $key => $val) { if(substr($key, 0, 7) == "filter_" AND $val != 0) { $filter_new_sql = $filter_new_sql . " OR filters_product.option_id = '" . $val . "'"; $filter_new_count++; } } $filter_new_sql = " AND (" . substr($filter_new_sql, 4) . ")"; if($filter_new_count > 0) { $where = $where . $filter_new_sql; } /* $filter_new_sql = ""; $filter_new_count = 0; foreach ($_SESSION as $key => $val) { if(substr($key, 0, 7) == "filter_" AND $val != 0) { $parent = 0; $sql = "SELECT parent FROM filters WHERE time = " . substr($key,7); $mysql_query = mysql_query($sql); while($line = mysql_fetch_array($mysql_query)) { $parent = $line["parent"]; } if($parent == 0) { $filter_new_sql = $filter_new_sql . ") AND (filters_product.option_id = '" . $val . "' OR"; } else { $filter_new_sql = $filter_new_sql . " OR filters_product.option_id = '" . $val . "'"; } $filter_new_count++; } } $filter_new_sql = " AND (" . substr($filter_new_sql, 5) . ") )"; $filter_new_sql = str_replace("OR OR", "OR", $filter_new_sql); $filter_new_sql = str_replace(" OR)", ")", $filter_new_sql); if($filter_new_count > 0) { $where = $where . $filter_new_sql; } */ /*************/ /* PAGE FROM */ /*************/ // PAGE FROM $list["sum"] = 0; $sql = " SELECT COUNT(products.id) AS counted, categories_sub.name AS sub_name, categories_middle.name AS middle_name, categories_main.name AS main_name FROM products LEFT JOIN products_category ON products_category.product_time = products.time LEFT JOIN categories_sub ON categories_sub.id = products_category.category_id LEFT JOIN categories_middle ON categories_middle.id = categories_sub.main LEFT JOIN categories_main ON categories_main.id = categories_middle.main WHERE 1 = 1 " . $where . ""; //print sqlcode($sql); $mysql_query = mysql_query($sql); while($line = mysql_fetch_array($mysql_query)) { $list["sum"] = $line["counted"]; } $page_from = $_GET["oldal"]; if($page_from == "") { $page_from = 1; } $limit = 24; $displayPages = 5; $pages = ceil($list["sum"] / $limit); $limit_from = ($page_from - 1) * $limit; $displayPlus = ($displayPages - 1) / 2; $arrayFrom = $page_from - $displayPlus; $arrayWhile = $page_from + $displayPlus; if($arrayFrom < 1) { $arrayFrom = 1; } elseif($arrayFrom > $pages - $displayPages) { $arrayFrom = ($pages - $displayPages) + 1; } if($arrayWhile > $pages) { $arrayWhile = $pages; } elseif($arrayWhile < $displayPages) { $arrayWhile = $displayPages; } if($pages <= $displayPages) { $arrayWhile = $pages; $arrayFrom = 1; } $meta["title"] = $settings["title"] . " / " . $page["title"]; $meta["keywords"] = $page["keys"]; $meta["description"] = $page["desc"]; $filter = 1; $getUrl = "http://" . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]; include("frame-header.php"); print ""; print ""; print ""; print ""; print ""; ?>

Szűrők: " . $filter_count . "
"; if($filter_count > 0) { ?>
Termékek szűrése
"; ?>
0) { ?>
"; ?>
0) { ?>
"; ?>
Rendezés
0 AND strlen($searchKeyword) > 3 AND $limit_from == 0) { $sql = "INSERT INTO search_log (keywords) VALUES ('$searchKeyword')"; mysql_query($sql); } ?>
$list["sum"]) { $displayItemTo = $list["sum"]; } print $displayItemFrom . " - " . $displayItemTo . " / " . $list["sum"] . " termék"; ?>