$message "; } $category_list = get_category_list(); $best_restaurants_list = get_best_restaurants_list(); ?> Best Restaurants | <? echo $site_title; ?> , food in , restaurants, 22601, buffets, menus, eateries, reviews, where to eat in , restaurants in ">

Best Restaurants

"; $top_rated_query = "SELECT top_restaurants.ID, restaurants.NAME, restaurants.ADDRESS, restaurants.CITY, restaurants.STATE, restaurants.PHONE, top_restaurants.NUM_VOTES, top_restaurants.AVG_VOTE FROM (SELECT REVIEW_ID as ID, (SELECT COUNT(VOTE) from reviews where REVIEW_ID=ID and VOTE <> '0') as NUM_VOTES, AVG(VOTE) AVG_VOTE FROM reviews where VOTE <> '0' group by ID, NUM_VOTES) as top_restaurants, restaurants where top_restaurants.ID= restaurants.ID and restaurants.CITY = '$site_city' and restaurants.STATE='$site_state' and restaurants.OPEN = 'Y' and NUM_VOTES >= $number_of_reviews and AVG_VOTE >= $rating order by AVG_VOTE DESC"; $top_rated_result = $connect->query($top_rated_query); while ($r = mysqli_fetch_array($top_rated_result)) { $yelp_id = $r["YELP_ID"]; //$yelp_response = json_decode(get_yelp_data($yelp_id)); //$yelp_img = $yelp_response->image_url; /* if ($count % 2 == 0) { $css_style = "-alt"; } else { $css_style = ""; } */ echo "
"; $count++; $id=$r["ID"]; $name=trim($r["NAME"]); $name_search=$connect->real_escape_string($name); $restaurant_count = "SELECT COUNT(ID) AS COUNT FROM restaurants WHERE CITY = '$site_city' and STATE='$site_state' and NAME='$name_search' and CITY = '$site_city' and STATE = '$site_state'"; $results_count = $connect->query($restaurant_count); while ($c = mysqli_fetch_array($results_count)) { $count=$c["COUNT"]; if($count > 1) { $double = "/".$id; } else { $double = ""; } } $link_name=get_clean_name($name).$double; $address=trim($r["ADDRESS"]); $city=trim($r["CITY"]); $state=trim($r["STATE"]); $phone=trim($r["PHONE"]); $type1=trim($r["TYPE"]); $type2=trim($r["TYPE2"]); $type3=trim($r["TYPE3"]); $delivery=trim($r["DELIVERY"]); $url=trim($r["URL"]); $desc=trim($r["DESC"]); $pick_up=trim($r["PICK_UP"]); $menu=trim($r["MENU"]); $college=trim($r["COLLEGE"]); $special=trim($r["SPECIAL"]); $price=trim($r["PRICE"]); $wine=trim($r["WINE"]); $open=trim($r["OPEN"]); $rating = get_rating($id); $num_reviews = get_num_reviews($id); $rating_image = get_rating_image($rating); $thumbnail = get_thumbnail($id, $name, $yelp_img); //$categories = get_categories($type1, $type2, $type3, '|'); echo "
$thumbnail

$name

$rating_image

$num_reviews reviews

$categories

$address

$city, $state

$phone

"; $catagories = ""; echo "
"; } echo "
"; echo ""; echo ''; //echo "

Time: " . number_format(( microtime(true) - $startTime), 4) . " Seconds

"; ?>