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

$perpage = 100;

stdhead("Gebannte User");
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;
?>


<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>..::Gebannte User Löschen::.. --- Zeigt alle Benutzer, die abgeschaltet sind</b></center></span></td> 
 </tr><tr><td width="100%" class="tablea">
<table border=0 cellspacing=0 width=750 cellpadding=5>
<tr><center><td class="tableb">ID</td><td class="tableb" align="left">Username</td><td class="tableb" align="left">E@Mail</td><td class="tableb" align="left">Angemeldet</td><td class="tableb">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());
// ------------------

?><form method="post" action="/userslist.php"><?
//echo "<tr><td colspan=\"7\" align=\"right\"><input type=\"checkbox\" name=\"mark\" value=\"1\"></td></tr>";
?><tr><td colspan="7" align="right"><input type="submit" name="mark" value="Alle markieren!" /></td></tr></form><?

?><form method="post" action="/takeuserslist.php"><tr><td colspan="7" align="right"><input type="submit" value="Und Wech!" /></td></tr><?

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

$mark=$_POST["mark"];
if ($mark == 'Alle markieren!')
{
echo "<tr><td>" . $arr[id] . "</td><td align=\"left\"><b><a href=userdetails.php?id=" . $arr[id] . ">". $arr[username] . "</b></td><td align=\"left\"><a href=mailto:" . $arr[email] . ">" . $arr[email] . "</a></td><td align=\"left\">" . $arr[added] . "</td><td align=center><input type=\"checkbox\" name=\"delusr[]\" value=\"" . $arr[id] . "\" checked /></td></tr>";
}
else
{
echo "<tr><td>" . $arr[id] . "</td><td align=\"left\"><b><a href=userdetails.php?id=" . $arr[id] . ">". $arr[username] . "</b></td><td align=\"left\"><a href=mailto:" . $arr[email] . ">" . $arr[email] . "</a></td><td align=\"left\">" . $arr[added] . "</td><td align=center><input type=\"checkbox\" name=\"delusr[]\" value=\"" . $arr[id] . "\" /></td></tr>";
}
}
?>
<tr><td colspan="7" align="right"><input type="submit" value="Und Wech!" /></td></tr>
</form>
<?
// ------------------
  end_table();
  end_frame();
// ===================================
end_main_frame();
stdfoot();
}
else {
stderr("Sorry", "Access denied!");
}
?>