set_include_path("lib"); require_once "config.php"; require_once "BaseVO.php"; require_once "BaseDAO.php"; require_once "PropertiesSearchEngine.php"; require_once "PropertyTypesVO.php"; require_once "PropertyTypesDAO.php"; require_once "PropertyMultiplexor.php"; require_once "LocationFactory.php"; require_once "Utils.php"; //var_dump($_GET); // create a properties data access object //$propertiesDAO = new PropertiesDAO(); // build a VO list of property types, then convert to a lookup array $propertyTypesDAO = new PropertyTypesDAO(); $propertyTypesVOList = $propertyTypesDAO->findWhere("inUse = '1'", "displayPriority"); $propertyTypes = array(); if($propertyTypesVOList) { foreach($propertyTypesVOList as $pvo) { $idPropertyTypes = $pvo->getPK(); // add a new element to the array $propertyTypes[$idPropertyTypes] = $pvo->getName(); } } // create a new location factory instance $lf = new LocationFactory(); // load the lookup tables for reverse lookups on the URL $lf->loadCountries(); $lf->loadRegions(); $lf->loadDestinations(); $idCountries = 0; $idRegions = 0; $idDestinations = 0; // search for the first 3 properties in our current location $search_config = array( 'approved' => 1, 'visible' => 1, 'approved_photo_status' => 1, 'debug' => 0, 'get_content' => 1, 'get_photos' => 1, 'explain' => 0, 'properties_field_list' => array('idProperties','idPropertyTypes','idCountries','idRegions','idDestinations','urlName','locationURL','numBeds','numSleeps') ); $propertiesSearchEngine = new PropertiesSearchEngine($search_config); if(strlen($_GET['destinationsString']) > 0) { list($idCountries, $idRegions, $idDestinations) = $lf->reverseLookup($_GET['countriesString'], $_GET['regionsString'], $_GET['destinationsString']); if(($idCountries >0) && ($idRegions >0) && ($idDestinations >0)) { $params = array( 'idCountries' => $idCountries, 'idRegions' => $idRegions, 'idDestinations' => $idDestinations, 'idPropertiesList'=> null, 'orderByList' => null, 'orderByDirection'=> 'ASC', 'offset' => 0, 'limit' => 0 ); $propertiesSearchEngine->setSearchCriteria($params); $property_list = $propertiesSearchEngine->doSearch(); $page_h1 = $lf->countryRegionDestinationAsString($idCountries, $idRegions, $idDestinations); // get the destinations level featured properties $params = array( 'idCountries' => $idCountries, 'idRegions' => $idRegions, 'idDestinations' => $idDestinations, 'idPropertiesList'=> null, 'orderByList' => null, 'orderByDirection'=> 'ASC', 'featured_only' => 1, 'feature_level' => 'D', // H, C, R, D 'offset' => 0, 'limit' => $DEFAULT_FEATURED_PROPERTIES_PER_PAGE_LIMIT ); $propertiesSearchEngine->setSearchCriteria($params); $featured_property_list = $propertiesSearchEngine->doSearch(); } else { header("Location: page_not_found.php"); exit; } } else if(strlen($_GET['regionsString']) > 0) { list($idCountries, $idRegions, $idDestinations) = $lf->reverseLookup($_GET['countriesString'], $_GET['regionsString']); //echo "idCountries: " . $idCountries; //echo "idRegions: " . $idRegions; if(($idCountries > 0) && ($idRegions > 0)) { $params = array( 'idCountries' => $idCountries, 'idRegions' => $idRegions, 'idDestinations' => 0, 'idPropertiesList'=> null, 'orderByList' => null, 'orderByDirection'=> 'ASC', 'offset' => 0, 'limit' => 0 ); $propertiesSearchEngine->setSearchCriteria($params); $property_list = $propertiesSearchEngine->doSearch(); $page_h1 = $lf->countryRegionDestinationAsString($idCountries, $idRegions, $idDestinations); // get the regions level featured properties $params = array( 'idCountries' => $idCountries, 'idRegions' => $idRegions, 'idDestinations' => 0, 'idPropertiesList'=> null, 'orderByList' => null, 'orderByDirection'=> 'ASC', 'featured_only' => 1, 'feature_level' => 'R', // H, C, R, D 'offset' => 0, 'limit' => $DEFAULT_FEATURED_PROPERTIES_PER_PAGE_LIMIT ); $propertiesSearchEngine->setSearchCriteria($params); $featured_property_list = $propertiesSearchEngine->doSearch(); } else { header("Location: page_not_found.php"); exit; } } else if(strlen($_GET['countriesString']) > 0) { list($idCountries, $idRegions, $idDestinations) = $lf->reverseLookup($_GET['countriesString']); //echo "idCountries: " . $idCountries; if($idCountries > 0) { $params = array( 'idCountries' => $idCountries, 'idRegions' => 0, 'idDestinations' => 0, 'idPropertiesList'=> null, 'orderByList' => null, 'orderByDirection'=> 'ASC', 'offset' => 0, 'limit' => 20 ); $propertiesSearchEngine->setSearchCriteria($params); $property_list = $propertiesSearchEngine->doSearch(); $page_h1 = $lf->countryRegionDestinationAsString($idCountries, $idRegions, $idDestinations); // get the countrie level featured properties $params = array( 'idCountries' => $idCountries, 'idRegions' => 0, 'idDestinations' => 0, 'idPropertiesList'=> null, 'orderByList' => null, 'orderByDirection'=> 'ASC', 'featured_only' => 1, 'feature_level' => 'C', // H, C, R, D 'offset' => 0, 'limit' => $DEFAULT_FEATURED_PROPERTIES_PER_PAGE_LIMIT ); $propertiesSearchEngine->setSearchCriteria($params); $featured_property_list = $propertiesSearchEngine->doSearch(); } else { header("Location: page_not_found.php"); exit; } } $CSS_PAGES .= "\n"; include_once "header_open.php"; ?>
foreach($destinations as $d) {
$d_details = $d_lookup[$d];
list($d_name, $d_prefix, $d_postfix, $d_total) = $d_details;
?>=htmlentities(NamePrefixPostfixLinkText(displayLocationName($d_name), $d_prefix, $d_postfix))?> ( echo $d_total?>) |
Region | Destination |
foreach($destinations as $d) {
$d_details = $d_lookup[$d];
list($d_name, $d_prefix, $d_postfix, $d_total) = $d_details;
$d_name = $d_lookup[$d];
?>=NamePrefixPostfixLinkText($d_name[0], $d_prefix, $d_postfix)?> ( echo $d_total?>) |
|
Specific location: =htmlentities(utf8_decode($property['content_list'][$CONTENT_FIELD_location]))?> Summary: =nl2br(htmlentities(utf8_decode($property['content_list'][$CONTENT_FIELD_summary])))?> |