<?php
/*
=============================================
Движок: SHCMS Engine
=============================================
Название файла: Редактирование личных данных пользователей
=============================================
Official website: http://shcms.ru
=============================================
*/
define('SHCMS', true);
include_once'../system/inc/basic_settings.php';
$shcmsengine['title'] = 'Редактирование личных данных пользователей';
include_once'../template/head.php';
registrat();
if($_GET['id']){$id =$_GET['id'];}
$adminka ->admin();
$user4 = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id`='$user_id'"));
if($user4['team'] < 6)
{
echo 'Ошибка';
header('Refresh: 1; url=/index.php?'.$conservation.'&');
include_once'../template/foot.php';
exit();
}
include_once'secu.php';
if(!$id)
{
echo '<div class="errors">Вы зашли неправильно</div>';
header('Refresh: 1; url=/index.php?'.$conservation.'&');
exit();
}
$user = mysql_fetch_array(mysql_query("SELECT * FROM users WHERE id=$id"));
if(isset($_POST['submit']))
{$submit = $_POST['submit'];}
if(isset($submit))
{
if ($user['id'] == $user_id);
if(isset($_POST['name']))
{$name = $_POST['name'];}
if(isset($_POST['login']))
{$login = $_POST['login'];}
if(isset($_POST['last_name']))
{$last_name = $_POST['last_name'];}
if(isset($_POST['email']))
{$email = $_POST['email'];}
if(isset($_POST['icq']))
{$icq = $_POST['icq'];}
if(isset($_POST['skype']))
{$skype = $_POST['skype'];}
if(isset($_POST['us_d']))
{$us_d = $_POST['us_d'];}
if(isset($_POST['us_m']))
{$us_m = $_POST['us_m'];}
if(isset($_POST['us_g']))
{$us_g = $_POST['us_g'];}
if(isset($_POST['description']))
{$description = $_POST['description'];}
if(isset($_POST['wmid']))
{$wmid = $_POST['wmid'];}
if($_POST['pol'])
{$pol =$_POST['pol'];}
$user['name'] = isset($name) ? shcms_sh_shcms(substr($name, 0, 30)) : '';
$user['login'] = isset($login) ? shcms_sh_shcms(substr($login, 0, 40)) : '';
$user['last_name'] = isset($last_name) ? shcms_sh_shcms(substr($last_name, 0, 30)) : '';
$user['email'] = isset($email) ? shcms_sh_shcms(substr($email, 0, 30)) : '';
$user['icq'] = isset($icq) ? shcms_sh_shcms(substr($icq, 0, 10)) : '';
$user['skype'] = isset($skype) ? shcms_sh_shcms(substr($skype, 0, 25)) : '';
$user['us_d'] = isset($us_d) ? shcms_sh_shcms(substr($us_d, 0, 2)) : '';
$user['us_m'] = isset($us_m) ? shcms_sh_shcms(substr($us_m, 0, 2)) : '';
$user['us_g'] = isset($us_g) ? shcms_sh_shcms(substr($us_g, 0, 25)) : '';
$user['description'] = isset($description) ? shcms_sh_shcms(substr($description, 0, 255)) : '';
$user['wmid'] = isset($wmid) ? shcms_sh_shcms(substr($wmid, 0, 13)) : '';
$user['pol'] = (isset ($pol) && $pol);
$icq = rus_lat(strtolower($user['icq']));
if(!is_numeric($icq))
{
echo '<div class="errors">В ICQ должны быть только цифры!</div>';
}
if($submit ==true)
{
$ok_true = mysql_query("UPDATE `users` SET `name`='$name',`last_name`='$last_name',`email`='$email',`icq`='$icq',`skype`='$skype',`us_d`='$us_d',`us_m`='$us_m',`us_g`='$us_g',`description`='$description',`wmid`='$wmid',`pol`='$pol' WHERE `id`='$id'");
if ($ok_true == true)
{
echo '<div class="actshcms">Изменение успешно вступили в силу</div>';
}
else
{
echo 'Ошибка';
}
}
}
echo '<form action="?id='.$id.'&'.$conservation.'" method="post">';
echo '<div class="maintitle mainrazd">Изменить логин:</div><div class="maintext">';
echo 'Логин:<br/><input type="text" maxlength="32" name="login" value="'.$user['login'].'"></div>';
echo '<div class="maintitle mainrazd">Изменить личные данные:</div><div class="maintext">';
echo 'Имя:<br/><input type="text" maxlength="32" name="name" value="'.$user['name'].'"><br/>';
echo 'Фамилия:<br/><input type="text" maxlength="32" name="last_name" value="'.$user['last_name'].'"><br/>';
echo 'Дата рождение:<br/><input size="2" type="text" maxlength="2"name="us_d" value="'.$user['us_d'].'"> ';
echo '<input size="2" type="text" maxlength="2"name="us_m" value="'.$user['us_m'].'"> ';
echo '<input size="4" type="text" maxlength="4"name="us_g" value="'.$user['us_g'].'"><br/>';
echo 'E-mail:<br/><input type="text" maxlength="32"name="email" value="'.$user['email'].'"><br/>';
echo 'ICQ:<br/><input type="text" maxlength="10" name="icq" value="'.$user['icq'].'"><br/>';
echo 'Skype:<br/><input type="text" maxlength="32" name="skype" value="'.$user['skype'].'"><br/>';
echo 'WMID:<br/><input type="text" maxlength="12" name="wmid" value="'.$user['wmid'].'"><br/>';
echo'Ваш Пол:<br/> <select name="pol">';
echo '<option value="1"'.((isset($user['pol']) and $user['pol'] == 1)?" selected='selected'":null).'>Мужской</option>';
echo '<option value="2"'.((isset($user['pol']) and $user['pol'] == 2)?" selected='selected'":null).'>Женский</option>';
echo '</select><br/>';
echo 'О себе:(мах: 255 символов)<br/><textarea name="description">'.$user['description'].'</textarea><br/>';
echo '<input type="submit" name="submit" value="Применить"></form></div>';
include_once'../template/foot.php';
?>