<?
ob_start();
require_once("include/bittorrent.php");
dbconn();
    if (get_user_class() < UC_SYSOP) {
        stderr("Fehlgeschlagen", "Was willst du hier, hier trennt sich die spreu vom weizen!.");
        exit();
    }
stdhead("Donation Management");
$action = strip_tags($HTTP_GET_VARS["action"]);
if ($action == 'update') {
$requireddonations = (int)$_POST["requireddonations"];
if (!$requireddonations)
stderr ("Sorry","I puked !");
$donations = (int)$_POST["donations"];
if (!$donations)
stderr ("Sorry","I puked !");

mysql_query("UPDATE donation SET requireddonations='$requireddonations', donations='$donations'");
header("Location:/spendenmanager.php");
}
$qrt = MYSQL_QUERY("SELECT * FROM donation");
$rrt = MYSQL_FETCH_ARRAY($qrt);
    if (get_user_class() < UC_SYSOP) {
        stderr("Fehlgeschlagen", "Was willst du hier, hier trennt sich die spreu vom weizen!.");
        exit();
    }
begin_frame("Donation Management", center);
?>
<form method=post action=?&action=update>
Monatliches Ziel:<br />
<input type='text' value='<?=$rrt[requireddonations] ?>' size='5' maxlength='5' name='requireddonations'><br />
Aktueller Spendenstand:<br>
<input type='text' value='<?=$rrt[donations] ?>' size='5' maxlength='5' name='donations'><br /><br>
<input type='submit' value='Save' style='background:#eeeeee'>&nbsp;&nbsp;&nbsp;<input type='reset' value='Reset' style='background:#eeeeee'>
</form>
<?
end_frame();
stdfoot();
?>