\r\n"; mail('jim.rolt@googlemail.com', $subject, $error, $headers); } //include'memcache.php'; include('dataedit/sql.php'); $town = isset($_GET['town']) ? mysql_real_escape_string($_GET['town']) : ''; $county = isset($_GET['county']) ? intval($_GET['county']) : ''; date_default_timezone_set("Europe/London"); $query = "SELECT countyreviews.*, CountyName, bcomregion, EstDetails.RecordID, EstDetails.EstType, Towns.ID AS tid, clientpic FROM countyreviews LEFT JOIN EstDetails ON EstDetails.town = countyreviews.town LEFT JOIN Towns ON Towns.Name = countyreviews.town AND Towns.County = countyreviews.county INNER JOIN CountyDetails ON CountyDetails.RecordID = countyreviews.county WHERE countyreviews.display = 1 "; if($county != ''){$query.= " AND countyreviews.county = $county ";} if($town != ''){$query.= " AND countyreviews.town = '".mysql_real_escape_string($town)."' ";} $query.=" ORDER BY CountyName, town, date DESC"; //echo $query.'
'; $q = mysql_query($query); $total = mysql_num_rows($q); //$q = mysql_query_cache($query); //$total = count($q); $towns = array(); $estarray = array(); while($title = mysql_fetch_object($q)){ //foreach($q as $title){ $towns[] = $title->town; $CountyName= $title->CountyName; $estarray[$title->town][] = $title->EstType; $clientpic = $title->clientpic; $countyid = $title->county; $bcomregion = $title->bcomregion; } mysql_data_seek($q, 0); $towns = array_unique($towns); $towns = implode(', ', $towns); //$estarray = array_unique($estarray); if($county > ''){ $pl = mysql_query("SELECT RecordID, Name, TYPE FROM EstDetails INNER JOIN EstablishmentType ON EstablishmentType.ID = EstDetails.EstType WHERE EstType IN(1,2,4,5,7,15,17,19) AND Town = '$town' ORDER BY EstType, Name")or mailjim('pl', mysql_error()); $townpix = mysql_query("SELECT townpix.*, EstDetails.Name FROM townpix LEFT JOIN EstDetails ON EstDetails.RecordID = townpix.clientid WHERE townpix.town LIKE '$town' AND townpix.county = $county")or mailjim("townpix", mysql_error()); } echo << Independent Reports on $CountyName EOT; ?>

Related links:

Hotels | B&Bs | Inns | Destinations | Where weve been | Towns

"; if($trow->caption){echo"$trow->caption";} } elseif(mysql_num_rows($townpix) > 0){ $trow = mysql_fetch_object($townpix); echo"$trow->Name
$trow->Name"; } elseif(!empty($clientpic)){ echo"
"; } if($CountyName != ''){ include'yellowbcombox.php'; yellowbox($CountyName,$bcomregion); include'connect.php'; connect('', '', "$CountyName Reports"); } ?>
id){ $tlink = ''; if($check != $reviews->CountyName){//list county once echo"

$reviews->CountyName Reports

\n"; include'linkunit.txt'; $check = $reviews->CountyName; $tcheck = ''; } if(empty($reviews->town)){//list county reviews echo"County Review by $reviews->name on ".dtime($reviews->date)."
\n$reviews->review

\n"; } else{ if($tcheck != $reviews->town){//list town once if($tcheck != ''){ echo <<What is your view of $tcheck? Please give us your feedback

FOO; } switch(true){ case in_array(1, $estarray[$reviews->town]): case in_array(12, $estarray[$reviews->town]): case in_array(5, $estarray[$reviews->town]): $tlink = "hoteltowns.cfm?town=".rawurlencode($reviews->town)."&county=$reviews->county"; break; case in_array(2, $estarray[$reviews->town]): $tlink = "bnbtowns.cfm?town=".rawurlencode($reviews->town)."&county=$reviews->county'"; break; case in_array(4, $estarray[$reviews->town]): case in_array(15, $estarray[$reviews->town]): $tlink = "selfctowns.cfm?town=".rawurlencode($reviews->town)."&county=$reviews->county'"; break; case in_array(7, $estarray[$reviews->town]): $tlink = "budgettowns.cfm?town=".rawurlencode($reviews->town)."&county=$reviews->county'"; break; case isset($reviews->tid): $tlink = "county$reviews->county/townguide$reviews->town/"; } $tlink = !empty($tlink) ? "$reviews->town" : $reviews->town; echo <<$tlink, $reviews->CountyName

FOO; $check = $reviews->CountyName; $tcheck = $reviews->town; } echo"

Review of $reviews->town by $reviews->name on ".dtime($reviews->date)."
\n". "$reviews->review

\n";//list town reviews } $counter++; if(($counter % 10) == 0){//every 10 lines put a to top link echo"To Top\n"; } $idcheck = $reviews->id; } } if(!isset($_GET['county']) && mysql_num_rows($pl) > 0){ $tc = ''; echo"

Places to stay in $town

\n

"; while($place = mysql_fetch_object($pl)){ if($tc != $place->TYPE){ if($tc != ''){echo'
';} echo"$place->TYPE
\n"; $tc = $place->TYPE; } echo"$place->Name
\n"; } } include'dailyfeature.php'; ?>