<?php // Donation Overview by Rhinos for NV Source

require('include/bittorrent.php');
dbconn(true);

$at_show_newest = "1";
$owner_uid = "1";

stdhead();

begin_main_frame();

if((get_user_class() < UC_SYSOP) && ($CURUSER['id'] != "$owner_uid"))
{
print("<h3 class=tabletitle>Fehler, Zugriff Verweigert</h3>");
}
else
{
echo "
<table cellspacing='0' cellpadding='0' border='0' style='width:100%'>
<tr>
<td align='left'><img src='".$GLOBALS["PIC_BASE_URL"] . $GLOBALS["ss_uri"]."/obenlinks.gif' alt='' title='' /></td>
<td style='width:100%' class='obenmitte'></td>
<td align='right'><img src='".$GLOBALS["PIC_BASE_URL"] . $GLOBALS["ss_uri"]."/obenrechts.gif' alt='' title='' /></td>
</tr>
</table>
<table cellpadding='4' cellspacing='1' border='0' style='width:100%' class='tableinborder'>
<tr>
<td colspan='9' width='100%' class='tabletitle' valign='top'><span class='normalfont'><center><b>Donation Übersicht</b></center></span></td> 
</tr>";

if($at_show_newest == "1")
{
$at_show_newest = "DESC";
}
else
{
$at_show_newest = "ASC";
}

echo "<tr>
<td class='tablea' valign='top'>TransaktionsID</td>
<td class='tableb' valign='top'>[UID] Username</td>
<td class='tablea' valign='top'>€uro<br>Upload+</td>
<td class='tableb' valign='top'>Keyword</td>
<td class='tablea' valign='top'>HandyNummer<br>Netz</td>
<td class='tableb' valign='top'>AWP</td>
<td class='tablea' valign='top'>Donated am</td>
</tr>";

$pg_at_dbres1 = mysql_query("SELECT * FROM donates ORDER BY hm_up ASC, dts $at_show_newest, uid ASC");
while($row = mysql_fetch_array($pg_at_dbres1))
{
    $uname = $row['username'];

    $at_tid = $row['tid'];
    $at_uid = $row['uid'];
    $at_hmu = $row['hmu'];
    $at_hm_up = $row['hm_up'];
    $at_kw = $row['kw'];
    $at_hnr = $row['hnr'];
    $at_hnetz = $row['hnetz'];
    $at_awp = $row['awp'];
    $at_dts = $row['dts'];

$pg_at_dbres2 = mysql_query("SELECT * FROM users WHERE id = '".$at_uid."'");
while($row = mysql_fetch_array($pg_at_dbres2))
{
    $at_uname = $row['username'];
}

$at_dts = date("d.m.Y H:i:s", $at_dts);

if($at_kw == "")
{
$at_kw = "-";
}

if($at_hnetz == "")
{
$at_hnetz = "-";
}

if($at_awp == "1")
{
$at_awp = "Ja";
}
elseif($at_awp == "0")
{
$at_awp = "Nein";
}
else
{
$at_awp = "-";
}

echo "<tr>
<td class='tablea' valign='top'>$at_tid</td>
<td class='tableb' valign='top'>[$at_uid] $at_uname</td>
<td class='tablea' valign='top'>$at_hmu €<br>$at_hm_up GB</td>
<td class='tableb' valign='top'>$at_kw</td>
<td class='tablea' valign='top'>$at_hnr<br>$at_hnetz</td>
<td class='tableb' valign='top'>$at_awp</td>
<td class='tablea' valign='top'>$at_dts</td>
</tr>";

$at_tid = "";
$at_uid = "";
$at_uname = "";
$at_hmu = "";
$at_hm_up = "";
$at_kw = "";
$at_hnr = "";
$at_hnetz = "";
$at_awp = "";
$at_dts = "";
}








echo "</table>
<table cellspacing='0' cellpadding='0' border='0' style='width:100%'>
<tr>
<td align='left'><img src='".$GLOBALS["PIC_BASE_URL"] . $GLOBALS["ss_uri"]."/untenlinks.gif' alt='' title='' /></td>
<td style='width:100%' class='untenmitte'></td>
<td align='right'><img src='".$GLOBALS["PIC_BASE_URL"] . $GLOBALS["ss_uri"]."/untenrechts.gif' alt='' title='' /></td>
</tr>
</table>";
}
end_main_frame();
stdfoot();
?>