<?php
include '../system/bd.php';
include '../system/cook.php';
include ("../system/gzip.php");
if(isset($_SESSION['auth']) && $_SESSION['auth']==1){
include '../system/head.php';
include '../system/head1.php';
//////////арес//////////

if($user[prava] <= '2'){
header ("Location: ../error.php");}

switch($_GET[go]){
default:
echo' <div class="title">арес</div>';


$faq = mysql_query("SELECT * FROM `ares`");
$base = mysql_fetch_array($faq);
if(empty($_POST[name])){
echo "<form action=\"mod_2.php?go=1\" method=\"post\">";
$item = mysql_fetch_array($req);

echo" <div class='empty_block'>";
echo"Здоровье: </br>   
<input class='input' type='text' value='$base[hp]' size='20' name='hp'><br/>";

echo"Макс. здоровье: </br>
<input class='input' type='text' value='$base[hpfull]' size='20' name='hpfull'><br/>";


echo"Атака: </br>
<input class='input' type='text' value='$base[attack]' size='20' name='attack'><br/>";

echo"Защита: </br>
<input class='input' type='text' value='$base[def]' size='20' name='def'><br/>";

echo"Золото: </br>
<input class='input' type='text' value='$base[gold]' size='20' name='gold'><br/>";

echo"Серебро: </br>
<input class='input' type='text' value='$base[silver]' size='20' name=silver'><br/>";

echo"dead: </br>
<input class='input' type='text' value='$base[dead]' size='20' name='dead'><br/>";

echo"Опыт: </br><center>
<input class='input' type='text' value='$base[exp]' size='20' name='exp'></center><br/>";

echo '</div><center><input class="button" type="submit" value="Сохранить" /></form></center>';

}
break;
/////////


case '1':
$fa = mysql_query("SELECT * FROM `ares`");
$base = mysql_fetch_array($fa);

$dater = time();
mysql_query("INSERT INTO `admin_log` SET
`msg` = '$user[login] изменил настройки Ареса
</br> 
hp с <a> $base[hp]</a>
до <a> $_POST[hp]</a>
</br> 
hpfull с <a>$base[hpfull] </a> 
до <a>
$_POST[hpfull] </a>
</br> 
attack с <a>$base[attack] </a> до <a>$_POST[attack] </a>
</br>
 def с <a>$base[def]</a>
 до <a> $_POST[def] </a>
</br>
 gold с <a>$base[gold]</a>
 до <a> $_POST[gold] </a> 
</br>
 silver с <a>$base[silver]</a>
 до <a> $_POST[silver] </a> 
</br>
 dead с <a>$base[dead]</a>
 до <a> $_POST[dead] </a> 
</br>
 exp с <a>$base[exp]</a>
 до <a> $_POST[exp] </a> ', `time` = '$dater'");


mysql_query("UPDATE `ares` SET
        `hp` = '$_POST[hp]',
        `hpfull` = '$_POST[hpfull]',
        `attack` = '$_POST[attack]',
        `def` = '$_POST[def]',
        `gold` = '$_POST[gold]',
        `silver` = '$_POST[silver]',
        `dead` = '$_POST[dead]',
        `exp` = '$_POST[exp]'
 WHERE `id` = '1'");
echo"<img src='/pic/main/!.png' alt='*'/> Данные сохранены.";
echo'<div class="ssl">';
	echo '<a class="navi" href="mod_2.php">&nbsp <img src="/pic/main/rotate.png" alt="*"/> Вернуться</a></div>';
////////
}


}else{
header ("Location: index.php"); exit;
}
include '../system/foot.php';
?>
