<?
require_once '../core/system.php';
echo admin();
$header = 'Создание Босса!';
require_once H.'core/head.php';
switch($act) {
case 'post':
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("INSERT INTO `boss` SET `name` = '$name', `lvl` = '$lvl', `sila` = '$sila', `health` = '$health', `lovk` = '$lovk', `zashit` = '$zashit', `gold` = '$gold', `exp` = '$exp', `image` = '$image'");
header('Location: /boss/');
$_SESSION['message'] = 'Босс создан!';
exit();
}else{
header('Location: ?');
$_SESSION['err'] = $err;
// Вывод ошибки 
exit();
} 
}else{
header('Location: ?');
$_SESSION['err'] = 'Введите данные';
exit();
}
break;
default;
echo '<form class="player" method="post" action="?act=post">';
echo 'Введи имя<br /><input class="text large" type="text" name="name" /><br />
Введи уровень<br /><input class="text large" type="text" name="lvl" /><br />
Введи силу<br /><input class="text large" type="text" name="sila" /><br />
Введи здоровье<br /><input class="text large" type="text" name="health" /><br />
Введи ловкость<br /><input class="text large" type="text" name="lovk" /><br />
Введи защиту<br /><input class="text large" type="text" name="zashit" /><br />
Введи золото<br /><input class="text large" type="text" name="gold" /><br />
Введи опыт<br /><input class="text large" type="text" name="exp" /><br />
Введи картинку<br /><input class="text large" type="text" name="image" /><br />';
echo '<span class="btn"><span class="end"><input class="label" type="submit" value="Создать">Создать</span></span>';
echo "</form>";
echo "<div class='mini-line'></div>";
echo "<div class='player menuList'>";
echo "<li><a href='/Adm_panel/'><img src='/images/icon/arrow.png'>Админ-Панель</a></li>";
echo "</div>";
}
require_once H.'core/foot.php';
?>