<?php
require "include/bittorrent.php";
dbconn(true);
loggedinorreturn();
if (get_user_class() >= UC_ADMINISTRATOR) {
$res = mysql_query("SELECT COUNT(*) FROM users");
$row = mysql_fetch_array($res);
$count = $row[0];

$perpage = 100;

stdhead("UsersList");
if (mysql_num_rows($res) == 0)
begin_main_frame();
// ===================================


$users = number_format(get_row_count("users", "WHERE enabled='no'"));
begin_frame("Gebannte User ($users)", true);
begin_table();
echo $pagerbottom;
?>


<tr><td class=tablea colspan=2 align=left>ID</td><td class=tablea colspan=2 align=left>Username</td>
    <td class=tablea colspan=2 align=left>E@Mail</td><td class=tablea colspan=2 align=left>Angemeldet</td>
   <td class=tablea colspan=2 align=left>Löschen?</td>
</tr>
<?

$res=mysql_query("SELECT id,username,email,added FROM users WHERE enabled='no' ORDER BY id DESC $limit") or print(mysql_error());
// ------------------

?><center><form method="post" action="/bandel.php"><?
//echo "<tr><td class=tablea colspan=2 align=left><input type=\"checkbox\" name=\"mark\" value=\"1\"></td></tr>";
?><tr><td class=tablea colspan=2 align=left><td class=tablea colspan=2 align=left><td class=tablea colspan=2 align=left><td class=tablea colspan=2 align=left><td class=tablea colspan=2 align=left><input type="submit" name="mark" value="Alle markieren" /></td></tr></form><?

?><form method="post" action="/takebandel.php"><tr><td class=tablea colspan=2 align=left><td class=tablea colspan=2 align=left><td class=tablea colspan=2 align=left><td class=tablea colspan=2 align=left><td class=tablea colspan=2 align=left><input type="submit" value="Löschen" /></td></tr><?

while ($arr = @mysql_fetch_assoc($res)) {

$mark=$_POST["mark"];
if ($mark == 'Alle markieren!')
{
echo "<tr><td class=tablea colspan=2 align=left>" . $arr[id] . "<td class=tablea colspan=2 align=left><b><a href=userdetails.php?id=" . $arr[id] . ">". $arr[username] . "</b></td><td class=tablea colspan=2 align=left><a href=mailto:" . $arr[email] . ">" . $arr[email] . "<td class=tablea colspan=2 align=left>" . $arr[added] . "</td><td class=tablea colspan=2 align=left><input type=\"checkbox\" name=\"delusr[]\" value=\"" . $arr[id] . "\" checked /><td class=tablea colspan=2 align=left></td></tr>";
}
else
{
echo "<tr><td class=tablea colspan=2 align=left>" . $arr[id] . "<td class=tablea colspan=2 align=left><b><a href=userdetails.php?id=" . $arr[id] . ">". $arr[username] . "<td class=tablea colspan=2 align=left><a href=mailto:" . $arr[email] . ">" . $arr[email] . "</a></td><td class=tablea colspan=2 align=left>" . $arr[added] . "</td><td class=tablea colspan=2 align=left><input type=\"checkbox\" name=\"delusr[]\" value=\"" . $arr[id] . "\" /><td class=tablea colspan=2 align=left></td></tr>";
}
}
?>
<!-- <tr><td colspan="7" align="right"><input type="submit" value="Und Wech!" /></td></tr> -->
</form></center>
<?
// ------------------
  end_table();
  end_frame();
// ===================================
end_main_frame();
stdfoot();
}
else {
stderr("Error", "Wo willst du Knilch eigendlich hin?? Das geht Dich hier garnix an!!");
}
?> 