<?
include 'system.php';
$day = date(w);
if($day==0){
$q = mysql_query("SELECT * FROM `user` where `arenaweek` > '0' ORDER BY `arenaweek` DESC LIMIT 3");
$i = 1;
while($ank = mysql_fetch_assoc($q)) {
if($i == 1){
mysql_query("UPDATE `user` set `gold` = `gold` + '100' where `id` = '".$ank['id']."' limit 1");
}elseif($i == 2){

mysql_query("UPDATE `user` set `gold` = `gold` + '50' where `id` = '".$ank['id']."' limit 1");
}elseif($i == 3){

mysql_query("UPDATE `user` set `gold` = `gold` + '25' where `id` = '".$ank['id']."' limit 1");
}

++$i;
}
mysql_query("UPDATE `user` set `arenaweek` = '0'");
}
?>