<?php
include("../session.php");
include("../connect.php");

$id=$_GET['id'];
$user=$_SESSION['admin'];
$a=0;
echo "<table width=410 border=0 cellpadding=8 cellspacing=8>";
$query=mysql_query("select * from userreview where productID='$id'");
	if(mysql_num_rows($query)==0){
		echo "<tr><td align=center>No Review</td></tr>";
	}
while($display=mysql_fetch_array($query)){
	$userID=$display['userID'];
	$rating=$display['rating'];
	$comment=$display['comment'];
	$date=$display['dateSubmit'];
	$time=$display['timeSubmit'];
	
	if($a%2==0){
		echo "<tr class='plus'><td>";
		echo "<table width=400 border=0>";
		echo "<tr>";
		echo "<td colspan=2>$comment</td></tr>";
		echo "<tr>";
		echo "<td><address class=review>$date&nbsp;&nbsp;&nbsp;$time</address></td>";
		echo "<td align=right><b>Rate :</b>$rating</td></tr>
				</table></td></tr>";
	}else if($a%2==1){
		echo "<tr class='minus'><td>";
		echo "<table width=400 border=0>";
		echo "<tr>";
		echo "<td colspan=2>$comment</td></tr>";
		echo "<tr class='minus'>";
		echo "<td><address class=review>$date&nbsp;&nbsp;&nbsp;$time</address></td>";
		echo "<td align=right><b>Rate :</b>$rating</td></tr>";
		echo "</table></td></tr>";
	
	}
	$a++;
}
echo "</table>";
?>
<link href="header.css" rel="stylesheet" type="text/css"/>