<?
if(!empty($act)){
if($act=="up" and !empty($stat) and $db["ups"]>0){
if($stat=="sila"){
$new=$db["sila"]+1;
$up=$db["ups"]-1;
$sql = "UPDATE users SET sila='$new',ups='$up' WHERE login='$login'";
$result = mysql_query($sql);
print "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"0; URL=main.php?act=up\">";
}
if($stat=="lovkost"){
$new=$db["lovkost"]+1;
$up=$db["ups"]-1;
$sql = "UPDATE users SET lovkost='$new',ups='$up' WHERE login='$login'";
$result = mysql_query($sql);
print "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"0; URL=main.php?act=up\">";
print "Повышение характеристик...";
die();
}
if($stat=="udacha"){
$new=$db["udacha"]+1;
$up=$db["ups"]-1;
$sql = "UPDATE users SET udacha='$new',ups='$up' WHERE login='$login'";
$result = mysql_query($sql);
print "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"0; URL=main.php?act=up\">";
print "Повышение характеристик...";
die();
}
if($stat=="vinoslivost"){
$new=$db["power"]+1;
$up=$db["ups"]-1;
$hp=$db["power"];
$hp_now=$db["hp"];
$new_hp=$db["hp_all"]+6;
setHP($login,$hp_now,$new_hp);
$sql = "UPDATE users SET power='$new',ups='$up',hp_all='$new_hp' WHERE login='$login'";
$result = mysql_query($sql);
print "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"0; URL=main.php?act=up\">";
print "Повышение характеристик...";
die();
}
if($stat=="water"){
$new=$db["water_magic"]+1;
$up=$db["umenie"]-1;
$sql = "UPDATE users SET water_magic='$new',umenie='$up' WHERE login='$login'";
$result = mysql_query($sql);
print "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"0; URL=main.php?act=umenie\">";
print "Повышение характеристик...";
die();
}
if($stat=="earth"){
$new=$db["earth_magic"]+1;
$up=$db["umenie"]-1;
$sql = "UPDATE users SET earth_magic='$new',umenie='$up' WHERE login='$login'";
$result = mysql_query($sql);
print "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"0; URL=main.php?act=umenie\">";
print "Повышение характеристик...";
die();
}
if($stat=="fire"){
$new=$db["fire_magic"]+1;
$up=$db["umenie"]-1;
$sql = "UPDATE users SET fire_magic='$new',umenie='$up' WHERE login='$login'";
$result = mysql_query($sql);
print "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"0; URL=main.php?act=umenie\">";
print "Повышение характеристик...";
die();
}
if($stat=="air"){
$new=$db["air_magic"]+1;
$up=$db["umenie"]-1;
$sql = "UPDATE users SET air_magic='$new',umenie='$up' WHERE login='$login'";
$result = mysql_query($sql);
print "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"0; URL=main.php?act=umenie\">";
print "Повышение характеристик...";
die();
}
if($stat=="um"){
$new=$db["um"]+1;
$up=$db["ups"]-1;
$sql = "UPDATE users SET um='$new',ups='$up' WHERE login='$login'";
$result = mysql_query($sql);
print "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"0; URL=main.php?act=up\">";
print "Повышение характеристик...";
die();
}
if($stat=="mag"){
$new=$db["power"]+1;
$up=$db["ups"]-1;
$sql = "UPDATE users SET mag='$new',ups='$up' WHERE login='$login'";
$result = mysql_query($sql);
print "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"0; URL=main.php?act=up\">";
print "Повышение характеристик...";
die();
}
if($stat=="intellekt"){
$new=$db["intellekt"]+1;
$up=$db["ups"]-1;
$sql = "UPDATE users SET intellekt='$new',ups='$up' WHERE login='$login'";
$result = mysql_query($sql);
print "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"0; URL=main.php?act=up\">";
print "Повышение характеристик...";
die();
}
if($stat=="vospriyatie"){
$new=$db["vospriyatie"]+1;
$up=$db["ups"]-1;
$mn=$db["vospriyatie"];
$new_mn=$db["mana_all"]+3;
$sql = "UPDATE users SET vospriyatie='$new',ups='$up',mana_all='$new_mn' WHERE login='$login'";
$result = mysql_query($sql);
print "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"0; URL=main.php?act=up\">";
print "Повышение характеристик...";
die();
}

}
}
?>