<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="198" id="AutoNumber1" height="100"> 
<tr> <td width=244 height=0 1px solid #D2DFEA>
  <img border="0" src="images/popular.gif" align="absbottom" width="200" height="17">
  </td></tr>
<tr> <td width=244 height=1 1px solid #D2DFEA style="border-left: 1 solid #BDD0DF">
  <table border=0 cellpadding=0 cellspacing=0 width=216>
  <tr>
    <td width=214 colspan=2>
  <?php

include("./config.php");
$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
	echo "  
        
  </td>
  </tr>
  <tr>
    <td width=214 colspan=2>";
      
  while($row = mysql_fetch_array($rate)){ 
						
	$pid=$row["pid"];
						
	$item = $row["item"];
	$item=substr($item,0,45);							
	$no = $no + 1;
	// display info
	echo"
      
  </td>
  </tr>
  <tr>
    <td width=28><b>$no.  </b></td>
    <td width=186>
    
    <a href=shop_showitem.php?pid=$pid>  $item";
	// display .. if title is longer that 13 chars
	if(strlen($item)>= 45)
	{echo"..";}
					
	echo"</a>
    </td>
  </tr>
  <tr>
    <td width=214 colspan=2>";
					
	}// 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: active  </font><a href=./login.php><b><font face=verdana size=1>Admin. Panel</font></b></a></p>";
}
#######################################################
?>
    </td>
  </tr>
</table>
  </td></tr>
<tr> <td width=244 height=0 1px solid #D2DFEA>
  <img border="0" src="images/bot.gif" align="top" width="39" height="7">
  </td></tr>
<tr> <td width=244 height=0 1px solid #D2DFEA>
  </td></tr>
    </table>
