<?
require_once '../core/system.php';
echo admin();
if (isset($_GET['id']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `boss` WHERE `id` = '".intval($_GET['id'])."'"),0) == true){
$boss = mysql_fetch_assoc(mysql_query("SELECT * FROM `boss` WHERE `id`  = '".intval($_GET['id'])."'"));
}
$header = 'Редактор Босса!';
require_once H.'core/head.php';
if(isset($_POST['name']) && isset($_POST['lvl']) && isset($_POST['sila']) && isset($_POST['health']) && isset($_POST['lovk']) && isset($_POST['zashit']) && isset($_POST['gold']) && isset($_POST['exp']) && isset($_POST['image'])) {
$name = $_POST['name'];
$lvl = $_POST['lvl'];
$sila = $_POST['sila'];
$health = $_POST['health'];
$lovk = $_POST['lovk'];
$zashit = $_POST['zashit'];
$nick = $_POST['zashit'];
$gold = $_POST['gold'];
$exp = $_POST['exp'];
$image = $_POST['image'];
if(!isset($err)) {
mysql_query("UPDATE `boss` SET `name` = '$name', `lvl` = '$lvl', `sila` = '$sila', `health` = '$health', `lovk` = '$lovk', `zashit` = '$zashit', `gold` = '$gold', `exp` = '$exp', `image` = '$image' WHERE `id` = '$boss[id]' LIMIT 1");
header('Location: set_boss.php');
$_SESSION['message'] = 'Босс изменен!';
exit();
}else{
header('Location: set_boss.php');
$_SESSION['err'] = $err;
// Вывод ошибки 
exit();
} 
}
require_once H.'core/foot.php';?>