<?
	// Dcms-Fiera
	// http://dcms-help.ru
	// ShaMan

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['chemzan']) && ($_POST['chemzan']==0 || $_POST['chemzan']==1 || $_POST['chemzan']==2 || $_POST['chemzan']==3 || $_POST['chemzan']==4 || $_POST['chemzan']==5 || $_POST['chemzan']==6 || $_POST['chemzan']==7 || $_POST['chemzan']==8))
{
$user['chemzan']=intval($_POST['chemzan']);
mysql_query("UPDATE `user` SET `chemzan` = '$user[chemzan]' WHERE `id` = '$user[id]' LIMIT 1");
}
else $err[]='Ошибочка "Чем я занимаюсь"';
#######
if (isset($_POST['profesiy']) && strlen2(esc(stripcslashes(htmlspecialchars($_POST['profesiy']))))<=64)
{
$user['profesiy']=esc(stripcslashes(htmlspecialchars($_POST['profesiy'])));
mysql_query("UPDATE `user` SET `profesiy` = '".my_esc($user['profesiy'])."' WHERE `id` = '$user[id]' LIMIT 1");
}
else $err='Неверный формат Профессии!';
#########
if (isset($_POST['kyritj']) && ($_POST['kyritj']==0 || $_POST['kyritj']==1 || $_POST['kyritj']==2 || $_POST['kyritj']==3 || $_POST['kyritj']==4))
{
$user['kyritj']=intval($_POST['kyritj']);
mysql_query("UPDATE `user` SET `kyritj` = '$user[kyritj]' WHERE `id` = '$user[id]' LIMIT 1");
}
else $err[]='Ошибочка "Курите ли вы"';
#################
if (!isset($err))msg('Изменения успешно приняты');

}
err();
aut();
//(ENK) by wap-mast.ru Все права защищены!
//Барыжничество запрещино, все вопросы на форум wap-mast.ru
echo "<form method='post' action='?$passgen'>";
##################################
echo "Чем я занимаюсь:<br />\n<select name='chemzan'>\n";
echo "<option value='0'".($user['chemzan']==0?" selected='selected'":null).">Не скажу!</option>\n";
echo "<option value='1'".($user['chemzan']==1?" selected='selected'":null).">Учусь в школе</option>\n";
echo "<option value='2'".($user['chemzan']==2?" selected='selected'":null).">Учусь в колледже/лицее</option>\n";
echo "<option value='3'".($user['chemzan']==3?" selected='selected'":null).">Учусь в ВУЗе</option>\n";
echo "<option value='4'".($user['chemzan']==4?" selected='selected'":null).">Учусь в военном училище</option>\n";
echo "<option value='5'".($user['chemzan']==5?" selected='selected'":null).">Служу в армии</option>\n";
echo "<option value='6'".($user['chemzan']==6?" selected='selected'":null).">Работаю</option>\n";
echo "<option value='7'".($user['chemzan']==7?" selected='selected'":null).">Не работаю</option>\n";
echo "<option value='8'".($user['chemzan']==8?" selected='selected'":null).">Сижу на зоне</option>\n";
echo "</select><br />\n";
echo "Моя профессия:<br /><input type='text' name='profesiy' value='$user[profesiy]' maxlength='64' /><br />";
#####
echo "Курите ли вы:<br />\n<select name='kyritj'>\n";
echo "<option value='0'".($user['kyritj']==0?" selected='selected'":null).">Не скажу!</option>\n";
echo "<option value='1'".($user['kyritj']==1?" selected='selected'":null).">Не курю</option>\n";
echo "<option value='2'".($user['kyritj']==2?" selected='selected'":null).">Курю</option>\n";
echo "<option value='3'".($user['kyritj']==3?" selected='selected'":null).">Иногда</option>\n";
echo "<option value='4'".($user['kyritj']==4?" selected='selected'":null).">Бросаю</option>\n";
echo "</select><br />\n";
##################################
echo "<input type='submit' name='save' value='Сохранить' /></form>";
echo "<div class='foot'>";
echo "&raquo;<a href='/ank.php'>Назад в анкету</a><br />\n";
echo "</div>";

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

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