File size: 3.28Kb
<?php
require_once('../sys/config.php');
$sys['title'] = 'Редактирование профиля '.$ank['login'].'';
require_once(HOME .'/sys/head.php');
if (isset($_POST['save'])) {
if (isset($_POST['login'])) {
$login = txt($_POST['login']);
if (!isset($err)) {
mysql_query("UPDATE `users` SET `login` = '". input($login) ."' WHERE `id` = '$ank[id]' LIMIT 1");
$err = 'Логин успешно изменен!';
require_once(HOME .'/sys/foot.php');
}
}
if (isset($_POST['password'])) {
$password = txt($_POST['password']);
if (!isset($err)) {
$password = encrypt($password);
mysql_query("UPDATE `users` SET `email` = '". input($password) ."' WHERE `id` = '$ank[id]' LIMIT 1");
$err = 'Пароль успешно изменен!';
}
}
if (isset($_POST['email'])) {
$email = txt($_POST['email']);
if (!isset($err)) {
mysql_query("UPDATE `users` SET `email` = '". input($email) ."' WHERE `id` = '$ank[id]' LIMIT 1");
$err = 'email успешно изменен!';
}
}
$mod_name = txt($_POST['mod_name']);
$mod_strana = txt($_POST['mod_strana']);
$mod_sity = txt($_POST['mod_sity']);
$mod_osebe = txt($_POST['mod_osebe']);
$mod_sait = txt($_POST['mod_sait']);
$mod_icq = num($_POST['mod_icq']);
$mod_znaniya = num($_POST['mod_znaniya']);
}
error($err);
echo '<div class="ptext">
<form method="post" action="/kpanel/user_mod.php?user_id='.$ank['id'].'">
<div class="f">Логин:</div>
<input type="text" name="login" value="'. output($ank['login']) .'" class="q" /><br />
<div class="f">Новый пароль:</div>
<input type="text" name="mod_password" value="" class="q" /><br />
<div class="f">E-mail:</div>
<input type="text" name="email" value="'. output($ank['email']) .'" class="q" /><br />
<div class="f">Имя:</div>
<input type="text" name="mod_name" value="'. output($ank['name']) .'" class="q" /><br />
<div class="f">Страна:</div>
<input type="text" name="mod_strana" value="'. output($ank['strana']) .'" class="q" /><br />
<div class="f">Город:</div>
<input type="text" name="mod_sity" value="'. output($ank['sity']) .'" class="q" /><br />
<div class="f">Умения:</div>
<select name="mod_znaniya" size="1">
<option value="0"'. ($ank['znaniya'] == 0?' selected="selected"':NULL) .'>Ни чего не умею</option>
<option value="2"'. ($ank['znaniya'] == 2?' selected="selected"':NULL) .'>Только начинаю</option>
<option value="1"'. ($ank['znaniya'] == 1?' selected="selected"':NULL) .'>Знаю PHP</option>
<option value="3"'. ($ank['znaniya'] == 3?' selected="selected"':NULL) .'>Кодер</option>
</select><br />
<div class="f">Адрес сайта (личной странички):</div>
<input type="text" name="mod_sait" value="'. output($ank['sait']) .'" class="q" /><br />
<div class="f">ICQ:</div>
<input type="text" name="mod_icq" value="'. output($ank['icq']) .'" class="q" /><br />
<div class="f">О себе:</div>
<textarea rows="4" name="mod_osebe">'.output($ank['osebe']).'</textarea><br/>
<input type="submit" name="save" value="Изменить" class="q" />
</form>
</div>';
require_once(HOME .'/sys/foot.php');
?>