'Y' and propertyarea_propertyid=property_id and property_typeid=" .$propertytypeid." ";
$sql.="and propertyregion_areaid=" .$areaid. " and property_display='Y' and property_active='Y' AND property_price >=" .$min_price. " AND property_price <=" .$max_price. " ";
if ($_SESSION['propertytypeid']<>0)
$sql.=" and property_typeid=".$_SESSION['propertytypeid'];
//options
if ($_SESSION['searchbeds']<>0)
$sql.=" and property_bedrooms>=".$_SESSION['searchbeds'];
if ($_SESSION['areaid']<>0)
$sql.=" and propertyarea_areaid=".$_SESSION['areaid'];
if ($_SESSION['regionid']<>0)
$sql.=" and propertyregion_regionid=".$_SESSION['regionid'];
$sql.=" and propertyregion_regionid=" .$config['SiteRegion']. " ". $config['SiteArea']. "";
$sql.=" group by property_id order by property_price ";
//echo $sql;
v4getsqldata($sql,$database_v4,$v4,$Properties,$row_Properties,$totalnum_Properties,$maxperpage,$_SESSION['s']*$maxperpage);
//echo $row_Properties['property_id'];
?>