// start the session
session_start();
header("Cache-control: private"); //IE 6 Fix
include("/home/cursinu/cgi-bin/db/dbinfo.inc.php");
function uservalidate_function_check()
{
include '/home/cursinu/tastingjournals.com/data/user/uservalidate.php';
return $login_check;
}
$login_result=uservalidate_function_check();
if(!$dbconnect = mysql_connect($host,$username,$password)) {
echo "Connection failed to the host 'localhost'.";
exit;
} // if
if (!mysql_select_db($database)) {
echo "Cannot connect to database";
exit;
} // if
$PATH_INFO=substr($_SERVER['REQUEST_URI'], strlen($_SERVER['SCRIPT_NAME']), strlen($_SERVER['REQUEST_URI']));
$PATH_INFO = explode('/', $PATH_INFO);
if (!(substr($PATH_INFO[1],0,1)>0) and (strlen($PATH_INFO[1])>0))
{
$alpha_code=substr($PATH_INFO[1],0,1);
$alpha="and substring(winebar,1,1)='".substr($PATH_INFO[1],0,1)."' ";
//echo $alpha;
$PATH_INFO[1]=substr($PATH_INFO[1],1);
//echo $PATH_INFO[1];
}
if (!(strlen($PATH_INFO[1])>0))
{
$Record=0;
//echo "Record set to Zero";
}
else
{
$Record=$PATH_INFO[1];
}
$RecordMax=$Record+25;
$query_Count="SELECT count(*) as WINERY_COUNT FROM TJ_WINEBAR where Publish_Flag='Y' ".$alpha." order by WineBar";
$dbresult_Count = mysql_query($query_Count, $dbconnect);
$num_Count = mysql_num_rows($dbresult_Count);
while ($row = mysql_fetch_array($dbresult_Count))
{
$Winery_Count=$row["WINERY_COUNT"];
}
$query="SELECT * FROM TJ_WINEBAR where Publish_Flag='Y' ".$alpha." order by WineBar limit ".$Record.", 25";
//echo $query;
$dbresult = mysql_query($query, $dbconnect);
$num = mysql_num_rows($dbresult);
$table.="
\n";
$table.="\n";
$table.="| Profiled Wine Bars |
\n";
$table.="
";
$table.="\n";
$table.="
| Wine Bar | \n
City | \n
Region | \n
State | \n
Country | \n
\n";
$border=1;
while ($row = mysql_fetch_array($dbresult))
{
//Find and replace ' for strings
$WineBar_ID=str_replace("'","'", $row["WineBar_ID"]);
$WineBar=str_replace("'","'", $row["WineBar"]);
$Action_Word=str_replace("'","'", $row["Action_Word"]);
$Appetizers=str_replace("'","'", $row["Appetizers"]);
$Dining=str_replace("'","'", $row["Dining"]);
$Website=str_replace("'","'", $row["Website"]);
$Description=str_replace("'","'", $row["Description"]);
$Region=str_replace("'","'", $row["Region"]);
$GPS_Coordinates=str_replace("'","'", $row["GPS_Coordinates"]);
$Date_Established=str_replace("'","'", $row["Date_Established"]);
$Propreitor=str_replace("'","'", $row["Propreitor"]);
$Address=str_replace("'","'", $row["Address"]);
$City=str_replace("'","'", $row["City"]);
$Zip=str_replace("'","'", $row["Zip"]);
$State=str_replace("'","'", $row["State"]);
$County=str_replace("'","'", $row["County"]);
$Country=str_replace("'","'", $row["Country"]);
$Telephone=str_replace("'","'", $row["Telephone"]);
$Fax=str_replace("'","'", $row["Fax"]);
$Alternative_Telephone=str_replace("'","'", $row["Alternative_Telephone"]);
$email=str_replace("'","'", $row["email"]);
if ($border % 2)
{$bordercolor="\"#FFFFFF\"";}
else
{$bordercolor="\"#F3F3F3\"";}
$table.="
| ".$WineBar." |
".$City." |
".$Region." |
".$State." |
".$Country." |
\n";
$border=$border+1;
}
$nextpage=$alpha_code.$RecordMax;
if ($RecordMax<$Winery_Count)
{
$table.="
\n
\n";
?>
Tasting Journals - Featured Wine Bars
include("/home/cursinu/tastingjournals.com/data/images/header/header.php"); ?>
include("/home/cursinu/tastingjournals.com/data/images/footer/footer.php"); ?>