		// Join over the Location
		$query->select('l.title AS location')
			->join('LEFT', '#__trade_location AS l ON l.id = a.location_id');

		// Join over the District	
		$query->select('d.title AS district')
			->join('LEFT', '#__trade_location AS d ON d.id = l.parent_id');
			
			// Filter by Industry
			$industry_id = $this->getState('filter.industry_id');
			if (!empty($industry_id))
			{
				$query->where("parent.id = '" . $industry_id."'");
			}

			// Filter by District
			$district_id = $this->getState('filter.district_id');
			if (!empty($district_id))
			{
				$query->where("d.id = '" . $district_id."'");
			}
				
		// Filter by Price
		$price = $this->getState('filter.price');
		if (!empty($price))
		{
			switch ($price) {
				case -1:$price_to=-1;break; 
				case 1:$price_to=200000;break; 
				case 200000:$price_to=500000;break; 
				case 500000:$price_to=1000000;break; 
				case 1000000:$price_to=99999999;break; 
				default: $price_to=99999999;
			}
			$query->where("a.price >=" . (int)$price." AND a.price <= ".(int)$price_to);
		}
		// Filter by Area
		$area = $this->getState('filter.area');
		if (!empty($area))
		{
			switch ($area) {
				case 1:$area_to=300;break; 
				case 300:$area_to=800; break; 
				case 800:$area_to=1500;break; 
				case 1500:$area_to=99999;break; 
				default: $area_to=99999999;
			}
			$query->where("a.area >" . (int)$area." AND a.area < ".(int)$area_to);
		}
		