<?
    require "include/bittorrent.php";
    dbconn(false);
    loggedinorreturn();
    if (get_user_class() < UC_MODERATOR)
        stderr("Error", "Permission denied.");

    $z = "0";
    $res2 = mysql_query("SELECT agent,peer_id, userid, users.username, warned FROM peers JOIN users ON peers.userid = users.id GROUP BY username ") or sqlerr();
    stdhead();
    begin_frame ("..::Listet alle Benutzer auf die gerade Seeden/Leechen ink. Clienten::..", FALSE, "80%");

?>


<?
    print("<table class=tableinborder width=90% border=0 cellspacing=1 cellpadding=4 align=center>\n");
    print("<tr><td class=tableb>Nr.</td><td class=tableb>Client</td><td class=tableb>Peer ID</td><td class=tableb>Benutzer</td><td class=tableb>Verwarnt</td></tr>\n");
    while($arr2 = mysql_fetch_assoc($res2))
    {
$z = $z + 1;
//$res3 = mysql_query("SELECT username FROM users where id = $arr2[userid]") or sqlerr();
//$arr3 = mysql_fetch_assoc($res3);
print("<td class=tableb align=left>$z</td><td class=tableb align=left>$arr2[agent]</td><td class=tableb align=left>$arr2[peer_id]</td><td class=tableb align=left><a href=userdetails.php?id=$arr2[userid]>$arr2[username]><td class=tableb align=left>$arr2[warned]</a></td></tr>\n");
    }
    print("</table></table>\n");

    end_frame();

    stdfoot();
?>