\r\n\r\n"; else echo ""; $submit = (isset($_POST['submit']))? $_POST['submit'] : ''; $rating = (isset($_POST['rating']))? $_POST['rating'] : ''; $reviewText = (isset($_POST['reviewText']))? $_POST['reviewText'] : ''; $yourName = (isset($_POST['yourName']))? $_POST['yourName'] : ''; $impression = (isset($_POST['sliderValue1h']))? $_POST['sliderValue1h'] : ''; $look = (isset($_POST['sliderValue2h']))? $_POST['sliderValue2h'] : ''; $aroma = (isset($_POST['sliderValue3h']))? $_POST['sliderValue3h'] : ''; $flavor = (isset($_POST['sliderValue4h']))? $_POST['sliderValue4h'] : ''; $pairing = (isset($_POST['sliderValue5h']))? $_POST['sliderValue5h'] : ''; $pairsWith = (isset($_POST['pairsWith']))? $_POST['pairsWith'] : ''; $finalScore = $impression + 5; $finalScore = $finalScore + $look + 5; $finalScore = $finalScore + ($aroma * 3) + 15; $finalScore = $finalScore + ($flavor * 5) + 25; if ($submit && $finalScore == 50) { echo "

Your IP address has been logged for spamming. Please discontinue your efforts to advertise on this site.

"; echo ""; } else { ?> User reviews for $vintage $Rtitle by $RcompanyName\r\n"; echo "\r\n"; echo "\r\n"; include '../head.php'; ?>
Wine Guide > $RcompanyName > $Rtitle
"; include 'counter_wine.php'; include '../odbc.php'; //$finalScore = $finalScore + $pairing + 5; if (!isset($rating)) $rating = $finalScore; $numReviews = 0; $numIpReviews = 0; if ($submit) { if ($theCoID != 0) { $getReviews = mysql_query("SELECT reviewID FROM wine_reviews WHERE approved = 1 AND wineID = '$wineID' AND reviewerID = '$theCoID' LIMIT 1", $odbc) or die (mysql_error()); while ($row = mysql_fetch_array($getReviews, MYSQL_ASSOC)) { $numReviews++; } } $getIpReviews = mysql_query("SELECT reviewID FROM wine_reviews WHERE approved = 1 AND wineID = '$wineID' AND ipAddress LIKE '$ipAddress' LIMIT 1", $odbc) or die (mysql_error()); while ($row = mysql_fetch_array($getIpReviews, MYSQL_ASSOC)) { $numIpReviews++; } if ($numReviews == 0 && $theCoID != 0 && ($finalScore > 50)) { mysql_query("INSERT INTO wine_reviews (wineID, reviewerID, rating, review, ipAddress, approved, impression, look, aroma, flavor, pairsWith) VALUES ('$wineID','$theCoID','$finalScore','$reviewText','$ipAddress', '1', '$impression', '$look', '$aroma', '$flavor', '$pairsWith')", $odbc); echo "review saved"; } else if ($numIpReviews == 0) { if ($finalScore == 50) { echo ""; } else { $ipAddress = $_SERVER['REMOTE_ADDR']; mysql_query("INSERT INTO wine_reviews (wineID, reviewerID, rating, review, ipAddress, approved, reviewerName, impression, look, aroma, flavor, pairsWith) VALUES ('$wineID','$theCoID','$finalScore','$reviewText','$ipAddress', '0','$yourName', '$impression', '$look', '$aroma', '$flavor', '$pairsWith')", $odbc); $NewID = mysql_insert_id(); echo "review saved and will be available pending approval.
Register to post reviews instantly.
"; $emailText = "Overall Score: $finalScore\nApprove: http://www.crazyaboutwine.com/approveMyReview.php?emailID=$NewID\nReview: ".$reviewText; mail("patrickt@entrabase.com","New Review, please read and approve",$emailText,"From: info@crazyaboutwine.com\n"); mail("jasonk@entrabase.com","New Review, please read and approve",$emailText,"From: info@crazyaboutwine.com\n"); } } else echo "You have already submitted a review for this wine."; } $getWine = mysql_query("SELECT * FROM wine_listings WHERE LI_ID = $wineID AND disabled=0 LIMIT 1", $odbc); while($row = mysql_fetch_array($getWine, MYSQL_ASSOC)){ $jobID = $row['LI_ID']; $categoryID = $row['category']; $companyID = $row['companyID']; $description = stripslashes($row['description']); $title = stripslashes($row['title']); $status = $row['status']; $vintage = $row['vintage']; if ($row['locationDetail']) $locationDetail = "".$row['locationDetail']."
"; else $locationDetail = ""; //if (strlen($description) > 504) { // $description = substr( $description, 0, 500 ); // $description = $description." ..."; //} $getCategoryName = mysql_query("SELECT categoryName, categoryFile FROM wine_category_opt WHERE categoryID = $categoryID", $odbc) or die (mysql_error()); while($row = mysql_fetch_array($getCategoryName, MYSQL_ASSOC)){ $categoryName = $row['categoryName']; $categoryFile = $row['categoryFile']; } echo ""; echo "
\r\n\r\n"; echo "
"; $theFile = "images/wines/".$jobID.".jpg"; if (@fopen($theFile, "r")) { $displayImage = $theFile; $picsize = getimagesize($theFile); $source_x = $picsize[0]; $source_y = $picsize[1]; } else { $displayImage = "newlisting.gif"; $source_x = 150; $source_y = 113; } //status and main image if (!$status) echo "
$tempURLmore about $title
"; else if ($status == "New") echo "
$tempURL
"; else if ($status == "Library") echo "
$tempURL
"; else if ($status == "Sold") echo "
$tempURL
"; else echo "
$tempURLmore about $title
"; echo "
"; echo " $RcompanyName
$categoryName
"; echo "

$vintage $title
$locationDetail

\r\n"; echo " $description
"; echo "
\r\n"; } $numReviews = 0; $totalRating = 0; $getReviews = mysql_query("SELECT * FROM wine_reviews WHERE approved = 1 AND wineID = $jobID", $odbc) or die (mysql_error()); while ($row = mysql_fetch_array($getReviews, MYSQL_ASSOC)) { $rating = $row['rating']; $reviewText = $row['review']; $reviewerID = $row['reviewerID']; $theReviewer = $row['reviewerName']; $pairsWith = $row['pairsWith']; if ($numReviews < 1) echo "
Reviews
"; $numReviews++; $getReviewer = mysql_query("SELECT companyName FROM wine_company WHERE companyID = $reviewerID LIMIT 1", $odbc) or die (mysql_error()); while ($row = mysql_fetch_array($getReviewer, MYSQL_ASSOC)) { $reviewerName = $row['companyName']; } if (strlen($reviewerName) < 1) $reviewerName = $theReviewer; echo "
Rating: ".$rating."
"; if ($reviewText) echo $reviewText."
"; if ($pairsWith) echo "Pairs well with ".$pairsWith."
"; if ($reviewerName && $reviewerID != 0) echo "Reviewed by: $reviewerName
"; else if ($reviewerName && $reviewerID == 0) echo "Reviewed by: $reviewerName
"; else echo "Reviewed by: anonymous
"; $reviewerName = ""; $reviewerID = 0; } if ($numReviews < 1) echo "
No reviews added"; echo "

Add a review
Review Guidelines
"; echo "
"; echo "

Overall Score:


"; echo ""; if ($_SESSION['logged'] == "agk8gjf38834j2") echo ""; else echo ""; ?>
Your Name:".$_SESSION['firstname']." ".$_SESSION['lastname']."
Your Name (not required):
First Impression (bottle, etc):
Look & general color of wine:
The aroma of the wine:
The flavor & finish of the wine:

Pairs great with:

Review:

200 characters max (not required)
"; else echo ""; ?>

Featured Wines