// 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(winery,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_D_WINERY where Publish_Flag='Y' ".$alpha." order by Winery";
$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_D_WINERY where Publish_Flag='Y' ".$alpha." order by Winery limit ".$Record.", 25";
//echo $query;
$dbresult = mysql_query($query, $dbconnect);
$num = mysql_num_rows($dbresult);
$table.="
\n";
$table.="\n";
$table.="| Profiled Wineries |
\n";
$table.="
";
$table.="\n";
$table.="
| Winery | \n
City | \n
Region | \n
State | \n
Country | \n
\n";
$border=1;
while ($row = mysql_fetch_array($dbresult))
{
//Find and replace ' for strings
$Winery_ID=str_replace("'","'", $row["Winery_ID"]);
$Legacy_Winery_ID=str_replace("'","'", $row["Legacy_Winery_ID"]);
$winery=str_replace("'","'", $row["Winery"]);
$Action_Word=str_replace("'","'", $row["Action_Word"]);
$Website=str_replace("'","'", $row["Website"]);
$Description=str_replace("'","'", $row["Description"]);
$Region=str_replace("'","'", $row["Region"]);
$Appellation=str_replace("'","'", $row["Appellation"]);
$GPS_Coordinates=str_replace("'","'", $row["GPS_Coordinates"]);
$Date_Established=str_replace("'","'", $row["Date_Established"]);
$Propreitor=str_replace("'","'", $row["Propreitor"]);
$Vineyard_Manager=str_replace("'","'", $row["Vineyard_Manager"]);
$Wine_Maker=str_replace("'","'", $row["Wine_Maker"]);
$Seasons=str_replace("'","'", $row["Seasons"]);
$Frequency=str_replace("'","'", $row["Frequency"]);
$Days=str_replace("'","'", $row["Days"]);
$Event_Start_Date=str_replace("'","'", $row["Event_Start_Date"]);
$Event_End_Date=str_replace("'","'", $row["Event_End_Date"]);
$Start_Time=str_replace("'","'", $row["Start_Time"]);
$End_Time=str_replace("'","'", $row["End_Time"]);
$Tasting_Fee=str_replace("'","'", $row["Tasting_Fee"]);
$Parking_Fee=str_replace("'","'", $row["Parking_Fee"]);
$Facilities_OnSite=str_replace("'","'", $row["Facilities_OnSite"]);
$Activities_Nearby=str_replace("'","'", $row["Activities_Nearby"]);
$Public_Tastings=str_replace("'","'", $row["Public_Tastings"]);
$Appointment=str_replace("'","'", $row["Appointment"]);
$Highway=str_replace("'","'", $row["Highway"]);
$Starting_Point=str_replace("'","'", $row["Starting_Point"]);
$Ending_Point=str_replace("'","'", $row["Ending_Point"]);
$Annual_Production=str_replace("'","'", $row["Annual_Production"]);
$Time_Needed_to_Visit=str_replace("'","'", $row["Time_Needed_to_Visit"]);
$Difficulty=str_replace("'","'", $row["Difficulty"]);
$Total_Area=str_replace("'","'", $row["Total_Area"]);
$Peak_Elevation=str_replace("'","'", $row["Peak_Elevation"]);
$Low_Point=str_replace("'","'", $row["Low_Point"]);
$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"]);
$image1=str_replace("'","'", $row["image1"]);
$image2=str_replace("'","'", $row["image2"]);
$image3=str_replace("'","'", $row["image3"]);
$image4=str_replace("'","'", $row["image4"]);
$image5=str_replace("'","'", $row["image5"]);
if (strlen($Description)>200){
$Description2=substr($Description,0,190).""." - "." more info";
}
else
{
$Description2=$Description;
}
if ($border % 2)
{$bordercolor="\"#FFFFFF\"";}
else
{$bordercolor="\"#F3F3F3\"";}
$table.="
| ".$winery." |
".$City." |
".$Region." |
".$State." |
".$Country." |
\n";
$border=$border+1;
}
$nextpage=$alpha_code.$RecordMax;
if ($RecordMax<$Winery_Count)
{
$table.="
\n
\n";
?>
Tasting Journals - Featured Wineries
include("/home/cursinu/tastingjournals.com/data/images/header/header.php"); ?>
include("/home/cursinu/tastingjournals.com/data/images/footer/footer.php"); ?>