\r\n"; mail('jim.rolt@googlemail.com', $subject, $error, $headers); } /* if(!empty($_GET)){ if(key($_GET) == 'type'){ $type = current($_GET); } else{ $get = current($_GET); $type = mysql_real_escape_string(str_replace('_', ' ', key($_GET))); $place = intval(current($_GET)); $up = mysql_query("INSERT INTO Shopvotes (placeID, votes, dateadded) VALUES($place, 1, NOW()) ON DUPLICATE KEY UPDATE votes = votes+1")or mailjim("up", mysql_error()); $nc = mysql_query("SELECT Name, votes FROM Shops INNER JOIN Shopvotes ON Shopvotes.placeID = Shops.ID WHERE ID = $place")or mailjim("nc", mysql_error()); $tn = mysql_fetch_object($nc); $message = "Favourite Shop voted for: vote for ID $place, $tn->Name\n"; $headers = "From: Information Britan \n"; //mail('simonwaite555@gmail.com', "$type shop Vote", $message, $headers); } } */ $sql = "SELECT Shops.ID as SID, Shops.Name, Town, Shops.County, Shops.TYPE, votes, CountyName, ShopTypes.TYPE AS stype, Towns.ID FROM Shops INNER JOIN Shopvotes ON Shopvotes.placeID = Shops.ID INNER JOIN CountyDetails ON CountyDetails.RecordID = Shops.County LEFT JOIN Towns ON Towns.Name = Shops.Town AND Towns.County = Shops.County INNER JOIN ShopTypes ON ShopTypes.ID = Shops.TYPE"; if(isset($type) && !empty($type)){ $sql .= " AND ShopTypes.TYPE = '$type' "; } $sql .= " ORDER BY votes DESC LIMIT 100"; $q = mysql_query($sql)or mailjim("q","$sql
".mysql_error()); $top = mysql_fetch_object($q); mysql_data_seek($q, 0); $sql = "SELECT SUM(votes) AS total FROM Shopvotes"; if(isset($type)){ $sql .= " INNER JOIN Shops ON Shops.ID = placeID AND Shops.TYPE = '$type'"; } $tot = mysql_query($sql)or mailjim("tot", "$sql\n".mysql_error()); $total = mysql_fetch_object($tot); $titletext = isset($type) ? "$type Shop" : 'Shop'; $pageurl = $_SERVER['REQUEST_URI']; $cpcount = mysql_query("UPDATE pagecounter SET pagecount=pagecount+1 WHERE pageurl = '$pageurl'"); if(mysql_affected_rows()==0){$cpcount = mysql_query("INSERT INTO pagecounter(pageurl, pagecount, firstday) VALUES ('$pageurl', 1, NOW())");} $cq = mysql_query("SELECT pagecount FROM pagecounter WHERE pageurl = '$pageurl' "); $gcq = mysql_fetch_object($cq); $vcount = $gcq->pagecount; echo <<Britain's favourite $titletext is $top->Name, $top->CountyName EOT; ?>
Britain's Favourite $titletext, $total->total votes\n"; include'linkunit.txt'; if(isset($place)){ echo"

Your vote for $tn->Name has been recorded, thank you!
$tn->Name has $tn->votes votes
Overall Britains favourite shop is....Click to find out

"; } ?>

Shopping, other than for those with serious money, used to be just a necessary chore. For some it's still on a par with dental appointments and changing nappies. But others love nothing better than a day spent on retail therapy. The standard of Britain's shops has risen - the 80s especially saw a step-change in shop-fitting and design, the mushrooming of speciality shops where few existed previously, and an explosion of choice that actually can make shopping fun. Whether fashion, furniture, first editions or food is your thing there will be one outlet close to your heart. Tell us - and the world - about it by voting for it in our poll.

Current top $titletext
\n"; while($est = mysql_fetch_object($q)){ echo"
\n$count: $est->Name ($est->votes vote"; if($est->votes > 1){echo's';} echo") "; if($est->ID){ echo"$est->Town"; } else{ echo"$est->Town"; } echo" stype\" value=\"$est->SID\">

\n"; $count ++; } echo"Page viewed $vcount times since 2nd June 2010

"; include'dailyfeature.php'; ?>