<?php
require_once '../core/system.php';
echo admin();
$header = 'Админ Панель!';
require_once '../core/head.php';

if(isset($_GET['add'])){
$name = check($_POST['komp']);
$lvl = abs(intval($_POST['lvl']));
if(empty($name) or mysql_result(mysql_query("SELECT count(id) from `komplekt` where `name` = '".$name."'"),0) >= 1){
echo'Ошибка.';
}else{
echo'Комплект добавлен!<br/>';
mysql_query("INSERT INTO `komplekt` set `name` = '".$name."', `lvl` = '".$lvl."'");
}
}
echo'<form action="?add" method="post">Название комплекта:<br/><input type="text" name="komp"/><br/>
Уровень:<br/><input type="number" name="lvl" value="1"/>
<input type="submit" value="Добавить"/></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';
?>