Файл: wm_anketa.php
Строк: 128
<?
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']='Мои WM данные';
include_once 'sys/inc/thead.php';
title();
aut();
err();
if (isset($_POST['save'])){
if (isset($_POST['wmid']) && (is_numeric($_POST['wmid']) && strlen($_POST['wmid'])>=11 && strlen($_POST['wmid'])<=13 || $_POST['wmid']==NULL))
{
$user['wmid']=$_POST['wmid'];
if ($user['wmid']==null)$user['wmid']='null';
mysql_query("UPDATE `user` SET `wmid` = $user[wmid] WHERE `id` = '$user[id]' LIMIT 1");
if ($user['wmid']=='null')$user['wmid']=NULL;
}
else $err[]='Неверный формат WMID';
if (isset($_POST['wmr']) && (is_numeric($_POST['wmr']) && strlen($_POST['wmr'])>=11 && strlen($_POST['wmr'])<=13 || $_POST['wmr']==NULL))
{
$user['wmr']=$_POST['wmr'];
if ($user['wmr']==null)$user['wmr']='null';
mysql_query("UPDATE `user` SET `wmr` = $user[wmr] WHERE `id` = '$user[id]' LIMIT 1");
if ($user['wmr']=='null')$user['wmr']=NULL;
}
else $err[]='Неверный формат WMR';
if (isset($_POST['wmu']) && (is_numeric($_POST['wmu']) && strlen($_POST['wmu'])>=11 && strlen($_POST['wmu'])<=13 || $_POST['wmu']==NULL))
{
$user['wmu']=$_POST['wmu'];
if ($user['wmu']==null)$user['wmu']='null';
mysql_query("UPDATE `user` SET `wmu` = $user[wmu] WHERE `id` = '$user[id]' LIMIT 1");
if ($user['wmu']=='null')$user['wmu']=NULL;
}
else $err[]='Неверный формат WMU';
if (isset($_POST['wme']) && (is_numeric($_POST['wme']) && strlen($_POST['wme'])>=11 && strlen($_POST['wme'])<=13 || $_POST['wme']==NULL))
{
$user['wme']=$_POST['wme'];
if ($user['wme']==null)$user['wme']='null';
mysql_query("UPDATE `user` SET `wme` = $user[wme] WHERE `id` = '$user[id]' LIMIT 1");
if ($user['wme']=='null')$user['wme']=NULL;
}
else $err[]='Неверный формат WME';
if (isset($_POST['wmz']) && (is_numeric($_POST['wmz']) && strlen($_POST['wmz'])>=11 && strlen($_POST['wmz'])<=13 || $_POST['wmz']==NULL))
{
$user['wmz']=$_POST['wmz'];
if ($user['wmz']==null)$user['wmz']='null';
mysql_query("UPDATE `user` SET `wmz` = $user[wmz] WHERE `id` = '$user[id]' LIMIT 1");
if ($user['wmz']=='null')$user['wmz']=NULL;
}
else $err[]='Неверный формат WMZ';
if (isset($_POST['wmb']) && (is_numeric($_POST['wmb']) && strlen($_POST['wmb'])>=11 && strlen($_POST['wmb'])<=13 || $_POST['wmb']==NULL))
{
$user['wmb']=$_POST['wmb'];
if ($user['wmb']==null)$user['wmb']='null';
mysql_query("UPDATE `user` SET `wmb` = $user[wmb] WHERE `id` = '$user[id]' LIMIT 1");
if ($user['wmb']=='null')$user['wmb']=NULL;
}
else $err[]='Неверный формат WMB';
if (!isset($err)){
msg('Изменения успешно приняты');
}
}
echo "<form method='post' action='?ank=dr'>n";
if (($user['wmid']!=NULL) && ($user['wmr']!=NULL) && ($user['wmu']!=NULL) && ($user['wme']!=NULL) && ($user['wmz']!=NULL) && ($user['wmb']!=NULL))
{
}else{
echo "<div class='shop'>n";
echo "<div class='err'>n";
echo "<b>После заполнения данные изменить будет невозможно!</b><br />";
echo "</div>n";
echo "</div>n";
}
echo "<div class='shop'>n";
if ($user['wmid']!=NULL)
{
echo "<img src='/style/wm/wmid.png'> WMID: $user[wmid]<br/>";
}else{
echo "WMID:<br/><input type='text' name='wmid' value='$user[wmid]' maxlength='13' /><br />n";
}
echo "</div>n";
echo "<div class='shop'>n";
if ($user['wmr']!=NULL)
{
echo "<img src='/style/wm/wmid.png'> WMR: $user[wmr]<br/>";
}else{
echo "WMR:<br/><input type='text' name='wmr' value='$user[wmr]' maxlength='13' /><br />n";
}
echo "</div>n";
echo "<div class='shop'>n";
if ($user['wmu']!=NULL)
{
echo "<img src='/style/wm/wmid.png'> WMU: $user[wmu]<br/>";
}else{
echo "WMU:<br/><input type='text' name='wmu' value='$user[wmu]' maxlength='13' /><br />n";
}
echo "</div>n";
echo "<div class='shop'>n";
if ($user['wme']!=NULL)
{
echo "<img src='/style/wm/wmid.png'> WME: $user[wme]<br/>";
}else{
echo "WME:<br/><input type='text' name='wme' value='$user[wme]' maxlength='13' /><br />n";
}
echo "</div>n";
echo "<div class='shop'>n";
if ($user['wmz']!=NULL)
{
echo "<img src='/style/wm/wmid.png'> WMZ: $user[wmz]<br/>";
}else{
echo "WMZ:<br/><input type='text' name='wmz' value='$user[wmz]' maxlength='13' /><br />n";
}
echo "</div>n";
echo "<div class='shop'>n";
if ($user['wmb']!=NULL)
{
echo "<img src='/style/wm/wmid.png'> WMB: $user[wmb]<br/>";
}else{
echo "WMB:<br/><input type='text' name='wmb' value='$user[wmb]' maxlength='13' /><br />n";
}
echo "</div>n";
if (($user['wmid']!=NULL) && ($user['wmr']!=NULL) && ($user['wmu']!=NULL) && ($user['wme']!=NULL) && ($user['wmz']!=NULL) && ($user['wmb']!=NULL))
{
}else{
echo "<input type='submit' name='save' value='Применить' />n";
}
echo "</div>n";
echo "</form>";
include_once 'sys/inc/tfoot.php';
?>