require_once "common.php"; isnewday(3); page_header("Spenderseite"); addnav("G?Zurück zur Grotte","superuser.php"); addnav("W?Zurück zum Weltlichen","village.php"); output("
",true); if ($_GET['op']=="add2"){ if ($_GET['id']==$session['user']['acctid']){ $session['user']['donation']+=$_GET['amt']; } //ok to execute when this is the current user, they'll overwrite the value at the end of their page //hit, and this will allow the display table to update in real time. $sql = "UPDATE accounts SET donation=donation+'{$_GET['amt']}' WHERE acctid='{$_GET['id']}'"; db_query($sql); $_GET['op']=""; } if ($_GET['op']==""){ $sql = "SELECT name,donation,donationspent FROM accounts WHERE donation>0 ORDER BY donation DESC"; $result = db_query($sql); output("| Name | Punkte | Ausgegeben | ",true); output("`^{$row['name']}`0",true); output(" | `@".number_format($row['donation'])."`0 | ",true); output("`%".number_format($row['donationspent'])."`0 | ",true); output("",true); } output("