<?php
require "include/bittorrent.php";
dbconn(true);

stdhead("Modreport");

loggedinorreturn;

if ($CURUSER['class'] >= UC_TEAMLEITUNG)


{

$query = "SELECT id, username, added,modcount, warnmodcount, slcount, pmsend,
donor, warned FROM users WHERE modcount >=1 AND class >=25 AND class <=105 ORDER BY modcount DESC";
$result = mysql_query($query);
$num = mysql_num_rows($result); // how many modcounts
echo "<font color=#FF0000><h2>Staff Aktivität</h2></font>";


$zerofix = $num - 1; // remove one row because mysql starts at zero

if ($num > 0)
{
begin_frame("Aktivität vom Generation Zero X");
begin_table(TRUE);
?>
<tr>
 <td class="tabletitle" width=100 align="left">Num</td>
 <td class="tabletitle" width=100 align="left">Username</td>
 <td class="tabletitle" width=100 align="left">Klicks</td>
 <td class="tabletitle" width=100 align="left">Kl./Tag</td>
 <td class="tabletitle" width=100 align="left">Verw.</td>
 <td class="tabletitle" width=100 align="left">Verw./Tag</td>
 <td class="tabletitle" width=100 align="left">S&L</td>
 <td class="tabletitle" width=100 align="left">S&L/Tag</td>
 <td class="tabletitle" width=100 align="left">Mails</td>
 <td class="tabletitle" width=100 align="left">PM</td>
</tr>
<?

for ($i = 0; $i <= $zerofix; $i++)
{
$id = mysql_result($result, $i, "id");
$username = mysql_result($result, $i, "username");
$donor = mysql_result($result, $i, "donor");
$warned = mysql_result($result, $i, "warned");
$warnmod = mysql_result($result, $i, "warnmodcount");
$mod = mysql_result($result, $i, "modcount");
$slcount = mysql_result($result, $i, "slcount");
$pmsend = mysql_result($result, $i, "pmsend");
$daymod  = $mod;
$daywarnmod = $warnmod;
$seconds = mkprettytime(strtotime("now") - strtotime($promstaff));
$days = explode("d ", $seconds);
if(sizeof($days) > 1) {
$daymod  = number_format($mod / $days[0],2);
$daywarnmod = number_format($warnmod / $days[0],2);
$dayslcount = number_format($slcount / $days[0],2);
}
// get donor
if ($donor == "yes")
 $star = "<img src=pic/star.gif>";
else
 $star = "";

// get warned
if ($warned == "yes")
 $klicaj = "<img src=pic/warned8.gif>";
else
 $klicaj = "";

$counter = $i + 1;


print("<tr><td class=tableb align=center>$counter.</td>");
print ("<td class=tableb align=center><a href=userdetails.php?id=$id>$username</a> $star $klicaj</td>");

 if ($mod > 0)
  {
print("<td class=tableb align=center>$mod</td>");
print("<td class=tableb align=center>$daymod</td>");

}
 else{
print("<td class=tableb align=center>---</td>");
print("<td class=tableb align=center>---</td>");
}
 if ($warnmod > 0)
  {
print("<td class=tableb align=center>$warnmod</td>");
print("<td class=tableb align=center>$daywarnmod</td>");

}
 else{
print("<td class=tableb align=center>---</td>");
print("<td class=tableb align=center>---</td>");
}

 if ($slcount > 0)
  {
print("<td class=tableb align=center>$slcount</td>");
print("<td class=tableb align=center>$dayslcount</td>");

}
 else{
print("<td class=tableb align=center>---</td>");
print("<td class=tableb align=center>---</td>");
}

if ($pmsend > 0)
  {
print("<td class=tableb align=center>$pmsend</td>");


}
 else{
print("<td class=tableb align=center>---</td>");

}


print("<td class=tableb align=center><a href=messages.php?action=send&amp;receiver=$id>"."<img src=/pic/button_pm.gif border=0></a></td>");

echo "</tr>";

}
echo "</table>";
}

}

else
echo "Not permitted.";
end_frame();
stdfoot();

?>