<?
include_once '../sys/inc/start.php';
include_once '../sys/inc/compress.php';
include_once '../sys/inc/sess.php';
include_once '../sys/inc/home.php';
include_once '../sys/inc/settings.php';
include_once '../sys/inc/db_connect.php';
include_once '../sys/inc/ipua.php';
include_once '../sys/inc/fnc.php';
include_once '../sys/inc/user.php';

only_reg();
$set['title']='Связь';
include_once '../sys/inc/thead.php';
title();
if (isset($_POST['save'])){
if (isset($_POST['ank_wmu']) && (is_numeric($_POST['ank_wmu']) && strlen($_POST['ank_wmu'])>=12 && strlen($_POST['ank_wmu'])<=12 || $_POST['ank_wmu']==NULL))
{
$_POST['ank_wmu'];
$qq=mysql_query("SELECT * FROM `user` WHERE `ank_wmu` = '".mysql_real_escape_string($_POST['ank_wmu'])."'");
if(mysql_num_rows($qq)>0){
$err[]='Такой WMU уже есть!';
}
else
{
mysql_query("UPDATE `user` SET `ank_wmu` = '".mysql_real_escape_string($_POST['ank_wmu'])."' WHERE `id` = '$user[id]' LIMIT 1");
}
}
else $err[]='Неверный формат номера WMU';

if (!isset($err))msg('Изменения успешно приняты');

}
##################################################

err();
aut();

################################################################################
if($user['ank_wmu']!=NULL){
echo "$user[ank_wmu]<br />";
echo "Из соображений безопасности данные wmr изменить нельзя<br />";
}
else
{
echo "<form method='post' action='?$passgen'>\n";
echo "Ваш WMU(только 12 цифр):<br />";
echo "U:\n<input type='text' name='ank_wmu' value='$user[ank_wmu]' maxlength='12' /><br />\n";
echo "<input type='submit' name='save' value='Сохранить' />\n";
echo "</form>\n";
}
################################################################################
echo "<div class='foot'>\n";
echo "&raquo;<a href='/anketa.php'>К списку</a><br />\n";


if(isset($_SESSION['refer']) && $_SESSION['refer']!=NULL && otkuda($_SESSION['refer']))
echo "&laquo;<a href='$_SESSION[refer]'>".otkuda($_SESSION['refer'])."</a><br />\n";

echo "&laquo;<a href='/umenu.php'>Мое меню</a><br />\n";
echo "</div>\n";

include_once '../sys/inc/tfoot.php';
?>