PHP Classes

File: example1a.php

Recommend this page to a friend!
  Classes of Manish Khanchandani   Reviews   example1a.php   Download  
File: example1a.php
Role: Example script
Content type: text/plain
Description: Example
Class: Reviews
Store and retrieve reviews of products in MySQL
Author: By
Last change: changed role
Date: 14 years ago
Size: 1,339 bytes


Class file image Download
try {
// including rating class
$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" "">
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<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 />
if($itemReviews['fields']) {
$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>