<?php
$location = true;
//
//
require_once($_SERVER['DOCUMENT_ROOT']."/core/func.php");
//
//
head("Настройки",$uid); # Голова
//
//
if($user['save'] <= 1){
header('location:/save.php');
exit();
}
//
//
if($user['sex'] == '1')$sex = 'Мужской';
else
$sex = 'Женский';
//
//
if($user['skills_invise'] == '0')$invise = 'Нет';
else
$invise = 'Да';
//
//
if($user['sneg_active'] == '1')$sneg = 'Нет';
else
$sneg= 'Да';
//
//
if(isset($_GET['sex'])){
//
if($user['sex'] == '1')$gsex = '2'; else $gsex = '1';
//
//
qry("UPDATE `users` SET `sex` = ? WHERE `id` = ? LIMIT 1", array($gsex,$uid));
//
//
header('location:?');
//
//
exit();
}
//
//
if(isset($_GET['invise'])){
//
if($user['skills_invise'] == '0')$gsex = '1'; else $gsex = '0';
//
//
qry("UPDATE `users` SET `skills_invise` = ? WHERE `id` = ? LIMIT 1", array($gsex,$uid));
//
//
header('location:?');
//
//
exit();
}
//
//
if(isset($_GET['sneg'])){
//
if($user['sneg_active'] == '0')$gsex = '1'; else $gsex = '0';
//
//
qry("UPDATE `users` SET `sneg_active` = ? WHERE `id` = ? LIMIT 1", array($gsex,$uid));
//
//
header('location:?');
//
//
exit();
}
//
//
if(isset($_GET['name'])){
$login = checking($_POST['login']);
$err = false;
//
//
if(empty($login)){
//err("Поле ввода не может быть пустым!");
$err = true;
}
//
//
$search1 = fch("SELECT * FROM `users` WHERE `login` = ? LIMIT 1", array($login));
if($search1 != null){
err2("Имя героя уже занято");
$err = true;
}
//
//
if($err == false){
qry("UPDATE `users` SET `login` = ? WHERE `id` = ? LIMIT 1", array($login,$uid));
msg2("Успешно изменено");
header('location:?r='.$r);
exit();
}
header('location:?r='.$r);
exit();
}
//
//
if(isset($_GET['password'])){
$password = checking($_POST['password']);
$err = false;
//
//
if(empty($password)){
//err("Поле ввода не может быть пустым!");
$err = true;
}
//
//
if($err == false){
qry("UPDATE `users` SET `password` = ? WHERE `id` = ? LIMIT 1", array(md5(md5($password)),$uid));
msg("Успешно изменено");
header('location:?r='.$r);
exit();
}
header('location:?r='.$r);
exit();
}
//
//
?>
<div class = "tophead cntr">
<form action="?name" method="post">
Новое имя героя:<br>
<input type = 'text' name = 'login'><br>
<input class = '' name='edit' type = 'submit' value = 'Продолжить'>
</form></div>
<div class = "tophead cntr">
<form action="?password" method="post">
Новый пароль:<br>
<input type = 'text' name = 'password'><br>
<input class = '' name='edit' type = 'submit' value = 'Продолжить'>
</form></div>
<div class="tophead">Пол персонажа: <a href="?sex"><?=$sex;?></a></div>
<div class="tophead">Скрывать умения в профиле: <a href="?invise"><?=$invise;?></a></div>
<a href="/avatar.php" class="tophead">Сменить аватар</a>
<a href="/index.php?exit=1" class="tophead">Выйти из игры</a>
<?
//
//
foot($uid);
?>