function setFinalFilterQuery($query) { global $colorFilters, $priceFilters, $brandFilters, $finishTypeFilters, $lookFilters, $materialFilters, $applicationFilters, $usageFilters, $shapeFilters, $sortFilters, $sizeFilters; $get = filter_input_array(INPUT_GET); // if(array_key_exists('price_range', $get)) // $query = priceFilteredQuery($priceFilters,$query); if (array_key_exists('priceRange', $get)) { $query = priceFilteredQuery($get['priceRange'], $query); } if (array_key_exists('brand_name', $get)) { $query = brandFilteredQuery($brandFilters, $query); } if (array_key_exists('finish_types', $get)) { $query = finishTypeFilteredQuery($finishTypeFilters, $query); } if (array_key_exists('materials', $get)) { $query = materialFilteredQuery($materialFilters, $query); } if (array_key_exists('looks', $get)) { $query = lookFilteredQuery($lookFilters, $query); } if (array_key_exists('shapes', $get)) { $query = shapeFilteredQuery($shapeFilters, $query); } if (array_key_exists('sizes', $get)) { $query = sizeFilteredQuery($sizeFilters, $query); } if (array_key_exists('applications', $get)) { $query = applicationFilteredQuery($applicationFilters, $query); } if (array_key_exists('usages', $get)) { $query = usageFilteredQuery($usageFilters, $query); } if (array_key_exists('colors', $get)) { $query = colorFilteredQuery($colorFilters, $query); } // if(array_key_exists('colors', $get)) // $query = colorFilteredQuery($colorFilters,$query); if (array_key_exists('sortBy', $get)) { $query = sortFilteredQuery($get['sortBy'], $query); } return $query; }
function setFinalFilterQuery($query) { global $colorFilters, $priceFilters, $brandFilters, $finishTypeFilters, $applicationFilters; if (isset($_GET['price_range'])) { $query = priceFilteredQuery($priceFilters, $query); } if (isset($_GET['brand_name'])) { $query = brandFilteredQuery($brandFilters, $query); } if (isset($_GET['finish_types'])) { $query = finishTypeFilteredQuery($finishTypeFilters, $query); } if (isset($_GET['applications'])) { $query = applicationFilteredQuery($applicationFilters, $query); } if (isset($_GET['color'])) { $query = colorFilteredQuery($colorFilters, $query); } return $query; }