<?
require_once '../core/system.php';
echo admin();
if (isset($_GET['id']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `id` = '".intval($_GET['id'])."'"),0) == true){
$ank = mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `id`  = '".intval($_GET['id'])."'"));
}
$header = 'Редактор Игрока';
require_once H.'core/head.php';
if(isset($_POST['nick']) && isset($_POST['gold']) && isset($_POST['silver']) && isset($_POST['prava']) && isset($_POST['level']) && isset($_POST['master']) && isset($_POST['kamni'])) {
$nick = $_POST['nick'];
$gold = $_POST['gold'];
$silver = $_POST['silver'];
$master = $_POST['master'];
$level = $_POST['level'];
$kamni= $_POST['kamni'];
$prava= $_POST['prava'];
if(!isset($err)) {
mysql_query("UPDATE `user` SET `level` = '$level', `kamni` = '$kamni', `nick` = '$nick', `master` = '$master', `gold` = '$gold', `prava` = '$prava', `silver` = '$silver' WHERE `id` = '$ank[id]' LIMIT 1");
header('Location: user.php');
$_SESSION['message'] = 'Игрок изменен!';
exit();
}else{
header('Location: user.php');
$_SESSION['err'] = $err;
// Вывод ошибки 
exit();
} 
}
require_once H.'core/foot.php';
?>