<?
require "include/bittorrent.php";


dbconn(false);
stdhead("Seeds with more than 400%");

if (get_user_class() >= UC_MODERATOR)
{
?>

<table cellpadding="0" cellspacing="0" border="0" style="width:750px" class="tableinborder">
 <tr class="tabletitle" width="100%">
  <td colspan="10" width="100%"><span class="normalfont"><center><b>..::Overseeding::.. --- Zeigt alle Benutzer die schon mehr als 400 % geseedet haben</b></center></span></td> 
 </tr><tr><td width="100%" class="tablea">
<?
print("<table border=0 cellspacing=0 width=750 cellpadding=5>\n");
print("<tr><td class=tableb align=left><center>Torrent</td><td class=tableb><center>Benutzer</td><td class=tableb><center>Ratio</td></tr>\n");
$res = mysql_query("SELECT id,size,name FROM torrents");
while ($arr = mysql_fetch_assoc($res))
{
$name = $arr["name"];
$size = $arr["size"];
$id = $arr["id"];

$res2 = mysql_query("SELECT userid FROM peers WHERE torrent = $id AND seeder = 'yes' ");
while ($row2 = mysql_fetch_array($res2))
{
$uid = $row2["userid"];
$res4 = mysql_query("SELECT uploaded / downloaded AS ratio FROM  traffic WHERE torrentid = $id AND userid = $uid AND uploaded / downloaded > 4.0 ") or sqlerr();
while ($row4 = mysql_fetch_array($res4))
{
$res3 = mysql_query("SELECT username FROM users WHERE id = $uid");
$row3 = mysql_fetch_array($res3);
echo ("<tr><td><a href=details.php?id=$id><b>$name</b></a></td><td><a href=userdetails.php?id=$uid><b>$row3[username]</b></a></td><td>$row4[ratio]</td></tr>");
}
}
}
print("</table>");
}
else
print("<p style=\"text-align:center;font-size:12pt;\"><b>Dir ist es nicht erlaubt, hier zuzugreifen</b></p>");
?>