
<?php

include("./tests.php");
include_once("./func.php");
include("./config1.php");
include("./config.php");

// start border
sb($width+3,$title5,$bg_colour,$colour_1,$face,$titlesize,$titlecolor);
$table = "rating";
$ratesql = "SELECT * from $table  order by rating desc LIMIT 10";
$rate = @mysql_query($ratesql,$conn)
	or die("Unable to find product id from rating table...");
$rrow = mysql_num_rows($rate);

if ($rrow > 0)
{
	$no = 0;
	// start table for neat display
      
  while($row = mysql_fetch_array($rate)){ 
						
	$pid=$row["pid"];
						
	$item = $row["item"];
	$item=substr($item,0,45);							
	$no = $no + 1;
	// display info
	echo"<b>$no.  </b>";
    	// display .. if title is longer that 21 chars
	if(strlen($item)>= 21)
	{
	   $item = substr($item,0,21);
	   $item.="...";
	}
    	echo "<a href=shop_showitem.php?pid=$pid>  $item";
	echo"</a><br>";
					
	}// end while

}
############### display login status ######################
if ($_SESSION['admin'] == NULL)
{
echo "<br><p style=MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; MARGIN-LEFT: 2px><font face=Verdana color=#666666 size=1><img height=10 
      src=images/bullet.gif width=10 border=0> User login: n/a</font></p>";
}
if ($_SESSION['admin'] != NULL)
{
if ($_SESSION['admin'] != "admin")
echo "<br><p style=MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; MARGIN-LEFT: 2px><font face=Verdana color=#666666 size=1><img height=10 
      src=images/bullet.gif width=10 border=0> User login: active</font></p>";
if ($_SESSION['admin'] == "admin")
echo "<br><p style=MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; MARGIN-LEFT: 2px><font face=Verdana color=#666666 size=1><img height=10 
      src=images/bullet.gif width=10 border=0> User login: </font><a href=./login.php><b><font face=verdana size=1>Admin. Panel</font></b></a></p>";
}
#######################################################

eb($bg_colour,$colour_1);
echo "<br>";


?>
  
