<?php 
include("config.php");

if(isset($_SESSION['nume'])) {
      	$username = ''.$_SESSION['nume'].'';
$stare = "Wiew Top Uploads <i>(wap)</i>";
if(!$act){mysql_query("UPDATE utilizatori SET stare='$stare' WHERE nume='$username'");}
}
?>
<?
include("header.php");

echo "<div class='hl'>Top Downloads</div>";
include ("config.php");

$sql = mysql_query("SELECT * FROM fisiere WHERE download ORDER BY download desc LIMIT 20"); 
while($row = mysql_fetch_array($sql))
{ 
    // Build your formatted results here.
 $file = $row['file'];
$user = $row['user'];
$filename = $row['file'];
$desc = $row['description'];
$size = $row['size'];
$id = $row['id'];
$ftype = $row['ftype'];
$from = $from+1;
$dload = $row['download'];

echo "$from. <a href=\"file.php?id=".$id."\"> $filename</a>(<b>$dload</b>)<br/>";

} 


include("flooter.php")

?>
