echo"<h4>Приветствую в родной обители, собрат <b>".$user['login']."!</b></h4>";
?>
<tablewidth=100%>
<TR><TDvalign=topstyle="width:250px;">
<INPUTTYPE=buttonstyle="width:200px;"value="Перейти в приемную"onClick="returned('goto=home&');"><?if($user['room']==37){echo"<img src='i/flag.gif'>";}?><BR>
<INPUTTYPE=buttonstyle="width:200px;"value="Перейти в арсенал"onClick="returned('goto=arsenal&');"><?if($user['room']==38){echo"<img src='i/flag.gif'>";}?><BR>
<INPUTTYPE=buttonstyle="width:200px;"value="Перейти во внутренний двор"onClick="returned('goto=dvor&');"><?if($user['room']==39){echo"<img src='i/flag.gif'>";}?><BR>
<INPUTTYPE=buttonstyle="width:200px;"value="Перейти в мастерские"onClick="returned('goto=master&');"><?if($user['room']==40){echo"<img src='i/flag.gif'>";}?><BR>
<INPUTTYPE=buttonstyle="width:200px;"value="Перейти в опочивальни"onClick="returned('goto=rest&');"><?if($user['room']==41){echo"<img src='i/flag.gif'>";}?><BR>
</td><tdvalign=top>
<?
if($user['room']==38){
$glava=mysql_fetch_array(mysql_query("SELECT `glava` FROM `clans` WHERE `short` = '".$user['klan']."' LIMIT 1;"));
echo"<h4>Арсенал</h4>";
?>
<INPUTTYPE=buttonstyle="width:200px;"value="Сдать в арсенал"onClick="returned('do=zdat&');">
mysql_query("update `inventory` SET `owner` = ".$user['id']." WHERE `id` = ".$it['id_it'].";");
mysql_query("delete from `gotzam_arsenal` WHERE `id` = ".$_GET['back'].";");
}
}
// положить шмотку
if($_GET['add']){
$it=mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `dressed`=0 AND `setsale` = 0 AND `owner` =".$user['id']." AND `id` = ".$_GET['add'].";"));
if($it['owner']==$user['id']){
err("Вы оставили вещь в арсенале.");
mysql_query("update `inventory` SET `owner` = '' WHERE `id` = ".$it['id'].";");
$at=mysql_fetch_array(mysql_query("SELECT * FROM `variables` WHERE `var` = 'gotzam_att' LIMIT 1;"));
$def=mysql_fetch_array(mysql_query("SELECT * FROM `variables` WHERE `var` = 'gotzam_def' LIMIT 1;"));
$level=mysql_fetch_array(mysql_query("SELECT `level` FROM `users` WHERE `id` = (SELECT `glava` FROM `clans` WHERE `short` = '".$user['klan']."') LIMIT 1;"));
if($_GET['up']=='at'){
if($at[1]>=$level[0]){
err("Укрепление достигло максимального уровня");
}
elseif((pow(52,$at[1]+1))<=$user['money']){
mysql_query("update users set money = money - ".(pow(52,$at[1]+1))." where id = ".$user['id'].";");
mysql_query("update `variables` set value=value+1 WHERE `var` = 'gotzam_att' LIMIT 1;");
$at=mysql_fetch_array(mysql_query("SELECT * FROM `variables` WHERE `var` = 'gotzam_att' LIMIT 1;"));
$def=mysql_fetch_array(mysql_query("SELECT * FROM `variables` WHERE `var` = 'gotzam_def' LIMIT 1;"));
$level=mysql_fetch_array(mysql_query("SELECT `level` FROM `users` WHERE `id` = (SELECT `glava` FROM `clans` WHERE `short` = '".$user['klan']."') LIMIT 1;"));
}
else{
err("Не хватает денег");
}
}
if($_GET['up']=='def'){
if($def[1]>=$level[0]){
err("Укрепление достигло максимального уровня");
}
elseif((pow(32,$at[1]+1))<=$user['money']){
mysql_query("update users set money = money - ".(pow(32,$at[1]+1))." where id = ".$user['id'].";");
mysql_query("update `variables` set value=value+1 WHERE `var` = 'gotzam_def' LIMIT 1;");
$at=mysql_fetch_array(mysql_query("SELECT * FROM `variables` WHERE `var` = 'gotzam_att' LIMIT 1;"));
$def=mysql_fetch_array(mysql_query("SELECT * FROM `variables` WHERE `var` = 'gotzam_def' LIMIT 1;"));
$level=mysql_fetch_array(mysql_query("SELECT `level` FROM `users` WHERE `id` = (SELECT `glava` FROM `clans` WHERE `short` = '".$user['klan']."') LIMIT 1;"));