$val) { if(in_array($show, array("type", "id", "new", "special"))) { break; } else { $show = false; } } $id = escape_db_input($_GET[$show]); if ($show == 'type') { if (isset($_GET['r'])) $r = $_GET['r']; if (isset($_GET['subtype'])) $subtype = $_GET['subtype']; if (isset($_GET['country'])) $country = $_GET['country']; if (isset($_GET['region'])) $region = $_GET['region']; } } if (isset($_GET['r'])) $r = $_GET['r']; if ($show) { $query = "SELECT * FROM products WHERE "; // $product = mysql_fetch_assoc(mysql_query($query)); if ($show == 'id') $query .= "id = $id"; elseif ($show == 'new') $query .= "display = 'yes' ORDER BY addedWhen DESC"; elseif ($show == 'special') $query .= "display = 'yes' AND special = 'yes' ORDER BY RAND()"; else $query .= "display = 'yes' AND type = '$id'".($subtype ? " AND subtype = '$subtype'" : "").($country ? " AND country = (SELECT id AS country FROM products_countries WHERE name = '$country')" : "").($region ? " AND region = '$region'" : "")." ORDER BY producer,name,country,region"; $results = mysql_num_rows(mysql_query($query)); // total number of items found if ($show && ($show != 'id')) $query .= "\n LIMIT $r,$results_per_page"; $result = mysql_query($query); $fields = mysql_num_fields($result); echo " \n "; if (!mysql_num_rows($result) && $show != 'special') { echo "No Products Found\n \n\n"; echo "

\n There were no results in that category; please try again.\n

\n\n"; echo " \n\n"; echo "
\n"; include ('Templates/footer.php'); die(); } elseif ($results == 1 && $show != 'special') { $product = mysql_fetch_assoc($result); echo fromDB($product['producer'])." - ".fromDB($product['name']); } elseif ($show == "type") { echo ucfirst($id); if ($id != 'liquor'){ if ($country || $region) echo " from ".ucfirst($region ? $region : $country); } elseif ($subtype) echo " - $subtype"; } elseif ($show == "special") echo "Our Current Specials"; else echo ($show == "new" ? "New " : "")."Products"; echo "\n
\n\n"; if ($show == 'new' || $show == 'special') { echo "\n\n".editable_content(ucfirst($show == 'new' ? "New Products" : "Specials"))."
\n"; if ($show == 'special' && $results) echo "

Here are some other featured products:


\n\n"; } if ($show == 'type' && (!$subtype && !$country && !$region)) { echo "\n\n".editable_content(ucfirst($id))."\n"; if ($id == 'beer' || $id == 'wine') { ?>

Country

State

\n"; while ($product = mysql_fetch_assoc($result)) { if ($bg%2) echo " \n"; echo " ".$product['country']."\n"; $bg++; } echo "\n\n"; ?>
\n"; while ($product = mysql_fetch_assoc($result)) { if ($bg%2) echo " \n"; echo " ".$product['region']."\n"; $bg++; } echo "\n\n"; ?>
\n"; $result = mysql_query("SELECT DISTINCT subtype, IF(subtype='Ready',1,0) AS end FROM products WHERE type = 'liquor' ORDER BY end"); while ($product = mysql_fetch_assoc($result)) echo "
  • ".$product['subtype'].($product['subtype'] == 'Ready' ? " to Drink" : "")."
  • \n"; echo " \n\n"; } } elseif ($results == 1 && $show != 'special') { ?>
    ratebeer.com
    beeradvocate.com
    Similar to
    In Stock Clarksville
    New Albany
    ">
    ".fromDB($product['producer'])." - ".fromDB($product['name']).""; if ($product['type'] != "liquor" && !$region && !$country) echo " (".(getCountry($product['country']) == 'USA' ? $product['region'] : ($product['region'] ? $product['region'].", " : "").getCountry($product['country'])).")"; echo "
    "; echo ($product['stock_clarksville'] != 'out-of-stock' ? drawCheck() : drawX()).' Clarksville'.($product['stock_clarksville']=='limited' ? drawLimited() : '').'   '; echo ($product['stock_newalbany'] != 'out-of-stock' ? drawCheck() : drawX()).' New Albany'.($product['stock_newalbany']=='limited' ? drawLimited() : ''); echo "
    "; // echo "\n"; // if ($product['comment'] || $product['copy']) // echo "
    \n
    \n".($product['comment'] ? $product['comment'] : trail($product['copy'],100))."
    \n"; ?>

    More Results

    Products

     Beer

     Wine

     Liquor

    What are you looking for?

    Beer 101Beer 101

    KegsKegs Wine 101Wine 101