<?
session_start();
include("check.php");
include("menu.php");
include("forb.php");
?>
<html>
<head>
<body>
<link rel="stylesheet" type="text/css" href="style.css">
<?
include('forb.php');
$jo = mysql_query("SELECT * from smid WHERE id = $_GET[id]");
while($se = mysql_fetch_array($jo)) {
if($se[taget] == "1"){
print "Du fik dem ikke :(<meta http-equiv='refresh' content='0; url=tagwall.php'>";
}else{
$jo = mysql_query("SELECT * from smid WHERE id = $_GET[id]");
while($se = mysql_fetch_array($jo)) {
$brugernavn = $_SESSION[Brugernavn];
$dato = date("d/m h:i:s");
mysql_query("UPDATE brugere SET Point = Point + $se[kr] WHERE brugernavn = '$brugernavn'") or die(mysql_error());
mysql_query("UPDATE smid SET taget = '1' WHERE id = '$_GET[id]'") or die(mysql_error());
mysql_query("INSERT INTO tagwall (af, dato, besked, farve) VALUES ('Robot', '$dato', '$brugernavn har samlet $se[kr] Mønter op!', 'orange')") or die(mysql_error());
print "Du fik dem!<meta http-equiv='refresh' content='0; url=tagwall.php'>"; 
}
}
}
?>