if ($first) { $first = false; } else { $where_str .= $match == 'all' ? ' and ' : ' or '; } $where_str .= "(pd." . $e['field'] . " like '%|" . (int) $vid . "|%')"; } $where_str .= ")"; } } else { $where_str .= " and (pd." . $e['field'] . " in (" . (int) $value . tep_list_epf_children($value) . "))"; } } else { unset($epf_value_keywords); // erase any keywords from previous field tep_parse_search_string($value, $epf_value_keywords); if ($value != '' && isset($epf_value_keywords) && sizeof($epf_value_keywords) > 0) { $where_str .= " and ("; for ($i = 0, $n = sizeof($epf_value_keywords); $i < $n; $i++) { switch ($epf_value_keywords[$i]) { case '(': case ')': case 'and': case 'or': $where_str .= " " . $epf_value_keywords[$i] . " "; break; default: $keyword = tep_db_prepare_input($epf_value_keywords[$i]); $where_str .= "(pd." . $e['field'] . " like '%" . tep_db_input($keyword) . "%')"; break; }
} if (tep_not_null($pto)) { if (!settype($pto, 'double')) { $error = true; $price_check_error = true; $messageStack->add_session('search', ERROR_PRICE_TO_MUST_BE_NUM); } } if ($price_check_error == false && is_float($pfrom) && is_float($pto)) { if ($pfrom >= $pto) { $error = true; $messageStack->add_session('search', ERROR_PRICE_TO_LESS_THAN_PRICE_FROM); } } if (tep_not_null($keywords)) { if (!tep_parse_search_string($keywords, $search_keywords)) { $error = true; $messageStack->add_session('search', ERROR_INVALID_KEYWORDS); } } } if (empty($dfrom) && empty($dto) && empty($pfrom) && empty($pto) && empty($keywords)) { $error = true; $messageStack->add_session('search', ERROR_AT_LEAST_ONE_INPUT); } if ($error == true) { tep_redirect(tep_href_link(FILENAME_ADVANCED_SEARCH, tep_get_all_get_params(), 'NONSSL', true, false)); } $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_ADVANCED_SEARCH)); $breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, tep_get_all_get_params(), 'NONSSL', true, false)); require DIR_WS_INCLUDES . 'template_top.php';
// Released under the GNU General Public License //---------------------------------------------------------------------------- */ require 'includes/application_top.php'; // split page-results via post require DIR_FS_CLASSES . 'post_page_results.php'; $error_script = FILENAME_DEFAULT; $result_array = $g_validator->post_validate(array('keywords' => array('max' => 100, 'min' => 2))); if (count($result_array['keywords'])) { $messageStack->add_session(ERROR_AT_LEAST_ONE_INPUT, 'error', tep_get_script_name($error_script)); tep_redirect(tep_href_link()); } $keywords = $_POST['keywords']; $adv_array = array('keywords' => $keywords); $keywords_array = $keywords_exclude_array = array(); if (!tep_parse_search_string($keywords, $keywords_array, $keywords_exclude_array)) { $messageStack->add_session(ERROR_INVALID_KEYWORDS, 'error', tep_get_script_name($error_script)); tep_redirect(tep_href_link()); } $g_breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT)); // $g_breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT)); $g_http->set_headers("Cache-Control: public"); require DIR_FS_OBJECTS . 'html_start_sub1.php'; require DIR_FS_OBJECTS . 'html_start_sub2.php'; $heading_row = true; require DIR_FS_OBJECTS . 'html_body_header.php'; ?> <div><h1><?php echo HEADING_TITLE_2; ?> </h1></div>