<?php
require_once "maincore.php";
require_once "subheader.php";
require_once "side_left.php";


echo "<table width='100%'>
<tr>
<td width='500%'>";
opentable("Mėnesio siunčiamiausios");
$top = dbquery("SELECT * FROM ".$db_prefix."downloads ORDER BY download_count_m DESC LIMIT 0,100");
echo "<a name='top' id='top'></a>";
echo "<table cellspacing='2' cellpanding='2' width='100%' align='center'><tr><td class='cell'><strong>Nr.</strong></td><td class='cell'><strong>Pavadinimas</strong></td><td class='cell'><strong>Įdėta</strong></td><td class='cell'><strong>Siuntėsi</strong></td><td class='cell' width='60'><strong>Įdėjo</strong></td></tr>";
$a = 1;
while($data = dbarray($top)){
$result = dbquery("SELECT user_id FROM ".$db_prefix."users WHERE user_name='".$data['download_license']."'");
$data2 = dbarray($result);
echo "<tr><td valign='top' class='cell'>$a.</td><td valign='top' class='cell'><a href='".BASEDIR."muzika.php?d_id=".$data['download_id']."' title='Parsisiųsti' class='side'>".$data['download_title']."</a></td><td class='cell'>".showdate("%Y.%m.%d", $data['download_datestamp'])."</td><td class='cell' align='center'>".$data['download_count']."</td><td class='cell' align='center'><a href='".BASEDIR.'profile.php?lookup='.$data2['user_id']."'>".$data['download_license']."</a></td></tr>";
$a++;
}
echo "</table>";
closetable();

echo "</td>

</tr>
</table>";


require_once "side_right.php";
require_once "footer.php";
?>
