<?php // Paypal Donation add 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
{

if($_POST['action'] == "update")
{
$at_uid = "".$_POST['at_uid']."";
$at_hmu = "".$_POST['at_hmu']."";
$at_hm_up = "".$at_hmu."";
/* $at_hm_up = round($at_hm_up,0); */
$at_hm_upn = 1073741824 * $at_hm_up;
$at_tid = "".$_POST['at_tid']."";
$at_ts_now = time();

$pg_at_dbi = "INSERT INTO donates (tid, uid, hmu, hm_up, kw, hnr, hnetz, awp, dts) VALUES ('".$at_tid."', '$at_uid', '$at_hmu', '$at_hm_up', 'PayPal Spende', '-', '', '0', '$at_ts_now')";
$pg_at_dbin = mysql_query($pg_at_dbi);
$pg_at_dbu = "UPDATE users SET donor='yes', uploaded=(uploaded+$at_hm_upn) WHERE id = '$at_uid'";
$pg_at_dbun = mysql_query($pg_at_dbu);

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

$at_pn_desc = "Deine PayPal Spende";
$at_pn_msg = "[center]Hallo ".$uname.",
Deine Spende in höhe von [b]".$at_hmu." €[/b] ist soeben eingegangen.
[b]".$at_hm_up." GB[/b] wurden deinem Account gutgeschrieben.[/center]";
sendPersonalMessage(0, $at_uid, $at_pn_desc, $at_pn_msg, PM_FOLDERID_SYSTEM, 0);
}

echo "<form action='donation_paypal.php' method='POST'>
<input type='hidden' name='action' size='20' value='update'>
UserID: <input type='text' name='at_uid' size='20'><br>
Wieviel wurde Gespendet: <input type='text' name='at_hmu' size='20'><br>
TransAktionsID: <input type='text' name='at_tid' size='20'><br>
<input type='submit' value='Eintragen' name='PGoku_Button'>
</form>";

}
end_main_frame();
stdfoot();
?>