<?php
try {
// including rating class
include_once('Xoriant_Reviews.php');
$Reviews = new Xoriant_Reviews();
$itemReviews = $Reviews->showReviews($_GET['item_id']);
$itemRating = $Reviews->showRating($_GET['item_id']);
} catch (exception $e) {
$errorMessage = $e->getMessage();
$message = $errorMessage;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Items</title>
</head>
<body>
<h1>Item Number: <?php echo $_GET['item_id']; ?></h1>
<p>Description: blah blah</p>
<p><strong>Average Rating:</strong> <?php echo $itemRating['avg_rating']; ?>, <strong>Total Votes:</strong> <?php echo $itemRating['counter']; ?></p>
<p><a href="example1a_add.php?item_id=<?php echo $_GET['item_id']; ?>">Add New Review</a> | <a href="example1.php">Back</a> </p>
<h3>Reviews For Item <?php echo $_GET['item_id']; ?></h3>
<hr />
<?php
if($itemReviews['fields']) {
foreach($itemReviews['fields'] as $k=>$v) {
?>
<h3><?php echo $v['review_title']; ?></h3>
<p><?php echo nl2br($v['review_description']); ?></p>
<p>Submitted On: <?php echo $v['rating_date']; ?></p>
<?php
}
}
?>
</body>
</html>
|