\r\n";
mail('jim.rolt@googlemail.com', $subject, $error, $headers);
}
$county = is_numeric($_GET['county']) ? $_GET['county'] : 1;
include'dataedit/sql.php';
$town = mysql_real_escape_string($_GET['town']);
$q = mysql_query("SELECT EstDetails.RecordID, EstDetails.Name, town, EstablishmentType.TYPE, Esttype, countyname, bcomregion
FROM EstDetails
INNER JOIN reviews ON reviews.est = EstDetails.RecordID AND reviews.display = 1
INNER JOIN EstablishmentType ON EstablishmentType.ID = EstDetails.EstType
INNER JOIN CountyDetails ON CountyDetails.RecordID = EstDetails.county
WHERE county = $county AND town LIKE '".preg_replace("/[-\s]/", "_", $town)."'
AND reviews.type = 1
ORDER BY Esttype, Name")or mailjim('q', mysql_error());
$check = '';
$i = 0;
while($reviews = mysql_fetch_assoc($q)){
if($check != $reviews['RecordID']){
$data[$i]['RecordID'] = $reviews['RecordID'];
$data[$i]['Name'] = $reviews['Name'];
$data[$i]['town'] = $reviews['town'];
$data[$i]['TYPE'] = $reviews['TYPE'];
$data[$i]['number'] = '1';
$data[$i]['countyname'] = $reviews['countyname'];
$check = $reviews['RecordID'];
$bcomregion = $reviews['bcomregion'];
$i++;
}
else{
$num = count($data)-1;
$data[$num]['number']++;
}
}
$total = mysql_num_rows($q);
$q = mysql_query("SELECT events.eventid, event, town
FROM events
INNER JOIN reviews ON reviews.est = events.eventid AND reviews.display = 1 AND reviews.type = 4
WHERE county = $county AND town LIKE '".preg_replace("/[-\s]/", "_", $town)."'
ORDER BY event")or mailjim('q', mysql_error());
$check='';
$i=0;
while($reviews = mysql_fetch_assoc($q)){
if($check != $reviews['eventid']){
$edata[$i]['RecordID'] = $reviews['eventid'];
$edata[$i]['Name'] = $reviews['event'];
$edata[$i]['town'] = $reviews['town'];
$edata[$i]['number'] = 1;
$check = $reviews['eventid'];
$i++;
}
else{
$num = count($edata)-1;
$edata[$num]['number']++;
}
}
$total = $total + mysql_num_rows($q);
$q = mysql_query("SELECT Shops.ID, Shops.Name, Town
FROM Shops
INNER JOIN reviews ON reviews.est = Shops.ID AND reviews.display = 1 AND reviews.type = 2
WHERE county = $county AND town LIKE '".preg_replace("/[-\s]/", "_", $town)."'
ORDER BY Shops.Name")or mailjim('q', mysql_error());
$check='';
$i=0;
while($reviews = mysql_fetch_assoc($q)){
if($check != $reviews['ID']){
$sdata[$i]['RecordID'] = $reviews['ID'];
$sdata[$i]['Name'] = $reviews['Name'];
$sdata[$i]['town'] = $reviews['Town'];
$sdata[$i]['number'] = 1;
$check = $reviews['ID'];
$i++;
}
else{
$num = count($sdata)-1;
$sdata[$num]['number']++;
}
}
$total = $total + mysql_num_rows($q);
$q = mysql_query("SELECT Sports.ID, Sports.Name, Town
FROM Sports
INNER JOIN reviews ON reviews.est = Sports.ID AND reviews.display = 1 AND reviews.type = 3
WHERE county = $county AND town LIKE '".preg_replace("/[-\s]/", "_", $town)."'
ORDER BY Sports.Name")or mailjim('q', mysql_error());
$check='';
$i=0;
while($reviews = mysql_fetch_assoc($q)){
if($check != $reviews['ID']){
$spdata[$i]['RecordID'] = $reviews['ID'];
$spdata[$i]['Name'] = $reviews['Name'];
$spdata[$i]['town'] = $reviews['Town'];
$spdata[$i]['number'] = 1;
$check = $reviews['ID'];
$i++;
}
else{
$num = count($spdata)-1;
$spdata[$num]['number']++;
}
}
$total = $total + mysql_num_rows($q);
echo <<
Visitor Reviews on our hotels, Inns, B&B's, Pubs, restaurants and Bars in $town
EOT;
?>
Reviews $town.";
include'linkunit.txt';
echo"
We have $total reviews posted since April 2005\n
";
$tcheck = '';
$counter = 0;
for($j = 0;$j'.$data[$j]['TYPE']."\n";
$tcheck = $data[$j]['TYPE'];
}
echo''.$data[$j]['Name'].'';
if($data[$j]['town']){echo', '.$data[$j]['town'];}
echo' ('.$data[$j]['number'].")\n";
$counter++;
//every 10 lines put a to top link
if(($counter % 10) == 0){
echo"
\n";
}
}
if(isset($edata)){
echo"Events\n";
$tcheck = '';
for($j = 0;$j'.$edata[$j]['Name'].'';
if($edata[$j]['town'])echo', '.$edata[$j]['town'];
echo' ('.$edata[$j]['number'].")\n";
$counter++;
//every 10 lines put a to top link
if(($counter % 10) == 0){
echo"
\n";
}
}
}
if(isset($sdata)){
echo"Shops\n";
$tcheck = '';
for($j = 0;$j'.$sdata[$j]['Name'].'';
if($sdata[$j]['town'])echo', '.$sdata[$j]['town'];
echo' ('.$sdata[$j]['number'].")\n";
$counter++;
//every 10 lines put a to top link
if(($counter % 10) == 0){
echo"
\n";
}
}
}
if(isset($spdata)){
echo"Sports\n";
$tcheck = '';
for($j = 0;$j'.$spdata[$j]['Name'].'';
if($spdata[$j]['town'])echo', '.$psdata[$j]['town'];
echo' ('.$spdata[$j]['number'].")\n";
$counter++;
//every 10 lines put a to top link
if(($counter % 10) == 0){
echo"
\n";
}
}
}
echo"What is your view of $town? Please give us your feedback
";
include'dailyfeature.php';
?>