Пример #1
0
 function setAppliedFilters()
 {
     $category_sql = $this->current_category_id != 0 ? "and s2c.categories_id = '" . $this->current_category_id . "'" : '';
     // Check for filters on each applicable Specification
     $specs_query_raw = "SELECT\n                            s.specifications_id,\n                            s.filter_class,\n                            s.products_column_name,\n                            sd.specification_name\n                          FROM\n                            " . TABLE_SPECIFICATION . " AS s\n                          INNER JOIN " . TABLE_SPECIFICATION_GROUPS . " AS sg\n                            ON s.specification_group_id = sg.specification_group_id\n                          INNER JOIN " . TABLE_SPECIFICATIONS_TO_CATEGORIES . " AS s2c\n                            ON sg.specification_group_id = s2c.specification_group_id\n                          INNER JOIN " . TABLE_SPECIFICATION_DESCRIPTION . " sd \n                            ON sd.specifications_id = s.specifications_id\n                          WHERE\n                            s.show_filter = 'True'\n                            AND sg.show_filter = 'True' \n                            " . $category_sql . "\n                         ";
     $specs_query = vam_db_query($specs_query_raw);
     while ($specs_array = vam_db_fetch_array($specs_query)) {
         // Retrieve the GET vars used as filters
         // Variable names are the letter "f" followed by the specifications_id for that spec.
         $var = $specs_array['specifications_id'];
         ${$var} = '0';
         if (isset($_GET['f' . $var]) && $_GET['f' . $var] != '') {
             // Decode the URL-encoded names, including arrays
             ${$var} = vam_decode_recursive($_GET['f' . $var]);
             // Sanitize variables to prevent hacking
             ${$var} = vam_clean_get__recursive(${$var});
             // Set the cporrect variable type (All _GET variables are strings by default)
             ${$var} = vam_set_type(${$var});
             $this->applied_filters[$var] = ${$var};
         }
         // if (isset ($_GET[$var]
     }
     // while ($specs_array
 }
Пример #2
0
    // Retrieve the GET vars used as filters
    // Variable names are the letter "f" followed by the specifications_id for that spec.
    $var = 'f' . $specs_array['specifications_id'];
    ${$var} = '0';
    if (isset($_GET[$var]) && $_GET[$var] != '') {
        // Decode the URL-encoded names, including arrays
        ${$var} = vam_decode_recursive($_GET[$var]);
        // Sanitize variables to prevent hacking
        //$$var = preg_replace("/^[ а-яА-Я\/]+$/","", $$var);
        // Get rid of extra values if Select All is selected
        ${$var} = vam_select_all_override(${$var});
        // Get the breadcrumbs data for the filters that are set
        $filter_breadcrumbs = vam_get_filter_breadcrumbs($specs_array, ${$var});
        $specs_array_breadcrumb = array_merge($specs_array_breadcrumb, (array) $filter_breadcrumbs);
        // Set the correct variable type (All _GET variables are strings by default)
        ${$var} = vam_set_type(${$var});
        // Get the SQL to apply the filters
        $sql_string_array = vam_get_filter_sql($specs_array['filter_class'], $specs_array['specifications_id'], ${$var}, $specs_array['products_column_name'], $_SESSION['languages_id']);
        $sql_array['from'] .= $sql_string_array['from'];
        $sql_array['where'] .= $sql_string_array['where'];
    }
    // if (isset ($_GET[$var]
}
// while ($specs_array
$listing_sql = '';
//fsk18 lock
$fsk_lock = '';
if ($_SESSION['customers_status']['customers_fsk18_display'] == '0') {
    $fsk_lock = ' and p.products_fsk18!=1';
}
// sorting query