<?
function get($var, $val){
$query = $url['query'];
$url["$var"] = $val;
$url = "{$GLOBALS['siteurl']}"."/templates/deals/deals.php"."?".http_build_query($url); return $url;
}
function filter(){
$query = $url['query'];
$sql = " where ";
$i=1;
foreach($url as $key => $val){
$sql .= "`".$key."`"." LIKE "."'%".$val."%'";
}else{
$sql .= "`".$key."`"."="."'".$val."'";
}
if($i<$count){
$sql .= " and ";
}
$i++;
}
return $sql;
}else{
return false;
}
}
?>
PD8KZnVuY3Rpb24gZ2V0KCR2YXIsICR2YWwpewokdXJsID0gcGFyc2VfdXJsKCRfU0VSVkVSWydSRVFVRVNUX1VSSSddKTsKJHF1ZXJ5ID0gJHVybFsncXVlcnknXTsKcGFyc2Vfc3RyKCRxdWVyeSwgJHVybCk7CiR1cmxbIiR2YXIiXSA9ICAkdmFsOwokdXJsID0gInskR0xPQkFMU1snc2l0ZXVybCddfSIuIi90ZW1wbGF0ZXMvZGVhbHMvZGVhbHMucGhwIi4iPyIuaHR0cF9idWlsZF9xdWVyeSgkdXJsKTsKcmV0dXJuICR1cmw7Cn0KZnVuY3Rpb24gZmlsdGVyKCl7CiAgICBpZighZW1wdHkoJF9HRVQpKXsKICAgICR1cmwgPSBwYXJzZV91cmwoJF9TRVJWRVJbJ1JFUVVFU1RfVVJJJ10pOwogICAgJHF1ZXJ5ID0gJHVybFsncXVlcnknXTsKICAgIHBhcnNlX3N0cigkcXVlcnksICR1cmwpOwogICAgJHNxbCA9ICIgd2hlcmUgIjsKICAgICRjb3VudCA9IGNvdW50KCR1cmwpOwogICAgJGk9MTsKICAgIGZvcmVhY2goJHVybCBhcyAka2V5ID0+ICR2YWwpewogICAgaWYoaXNfc3RyaW5nKCR2YWwpKXsKICAgICAgICAkc3FsIC49ICJgIi4ka2V5LiJgIi4iIExJS0UgIi4iJyUiLiR2YWwuIiUnIjsKICAgIH1lbHNlewogICAgICAgICRzcWwgLj0gImAiLiRrZXkuImAiLiI9Ii4iJyIuJHZhbC4iJyI7CiAgICB9CgogICAgICAgIGlmKCRpPCRjb3VudCl7CiAgICAgICAgICAgICRzcWwgLj0gIiBhbmQgIjsKICAgICAgICB9CiAgICAgICAgJGkrKzsKICAgIH0KICAgIHJldHVybiAkc3FsOwogICAgfWVsc2V7CiAgICByZXR1cm4gZmFsc2U7CiAgICB9Cn0KPz4=