Файл: user/anketa/dop.php
Строк: 302
<?php
require_once '../../sys/inc/start.php';
require_once '../../sys/inc/compress.php';
require_once '../../sys/inc/sess.php';
require_once '../../sys/inc/settings.php';
require_once '../../sys/inc/db_connect.php';
require_once '../../sys/inc/ipua.php';
require_once '../../sys/inc/fnc.php';
require_once '../../sys/inc/user.php';
only_reg();
$set['title'] = 'Редоктирование анкеты';
require_once '../../sys/inc/thead.php';
if (isset($_POST['save'])) {
if (isset($_POST['ank_smoking']) && $_POST['ank_smoking'] == 0) {
$user['ank_smoking'] = 0;
mysql_query("UPDATE `user` SET `ank_smoking` = '" . ($user['ank_smoking'] = 0) . "' WHERE `id` = '$user[id]'");
}
if (isset($_POST['ank_smoking']) && $_POST['ank_smoking'] == 1) {
$user['ank_smoking'] = 1;
mysql_query("UPDATE `user` SET `ank_smoking` = '" . ($user['ank_smoking'] = 1) . "' WHERE `id` = '$user[id]'");
}
if (isset($_POST['ank_smoking']) && $_POST['ank_smoking'] == 2) {
$user['ank_smoking'] = 2;
mysql_query("UPDATE `user` SET `ank_smoking` = '" . ($user['ank_smoking'] = 2) . "' WHERE `id` = '$user[id]'");
}
if (isset($_POST['ank_smoking']) && $_POST['ank_smoking'] == 3) {
$user['ank_smoking'] = 3;
mysql_query("UPDATE `user` SET `ank_smoking` = '" . ($user['ank_smoking'] = 3) . "' WHERE `id` = '$user[id]'");
}
if (isset($_POST['ank_smoking']) && $_POST['ank_smoking'] == 4) {
$user['ank_smoking'] = 4;
mysql_query("UPDATE `user` SET `ank_smoking` = '" . ($user['ank_smoking'] = 4) . "' WHERE `id` = '$user[id]'");
}
if (isset($_POST['ank_occupation']) && $_POST['ank_occupation'] == 0) {
$user['ank_occupation'] = 0;
mysql_query("UPDATE `user` SET `ank_occupation` = '" . ($user['ank_occupation'] = 0) . "' WHERE `id` = '$user[id]'");
}
if (isset($_POST['ank_occupation']) && $_POST['ank_occupation'] == 1) {
$user['ank_occupation'] = 1;
mysql_query("UPDATE `user` SET `ank_occupation` = '" . ($user['ank_occupation'] = 1) . "' WHERE `id` = '$user[id]'");
}
if (isset($_POST['ank_occupation']) && $_POST['ank_occupation'] == 2) {
$user['ank_occupation'] = 2;
mysql_query("UPDATE `user` SET `ank_occupation` = '" . ($user['ank_occupation'] = 2) . "' WHERE `id` = '$user[id]'");
}
if (isset($_POST['ank_occupation']) && $_POST['ank_occupation'] == 3) {
$user['ank_occupation'] = 3;
mysql_query("UPDATE `user` SET `ank_occupation` = '" . ($user['ank_occupation'] = 3) . "' WHERE `id` = '$user[id]'");
}
if (isset($_POST['ank_occupation']) && $_POST['ank_occupation'] == 4) {
$user['ank_occupation'] = 4;
mysql_query("UPDATE `user` SET `ank_occupation` = '" . ($user['ank_occupation'] = 4) . "' WHERE `id` = '$user[id]'");
}
if (isset($_POST['ank_occupation']) && $_POST['ank_occupation'] == 5) {
$user['ank_occupation'] = 5;
mysql_query("UPDATE `user` SET `ank_occupation` = '" . ($user['ank_occupation'] = 5) . "' WHERE `id` = '$user[id]'");
}
if (isset($_POST['ank_occupation']) && $_POST['ank_occupation'] == 6) {
$user['ank_occupation'] = 6;
mysql_query("UPDATE `user` SET `ank_occupation` = '" . ($user['ank_occupation'] = 6) . "' WHERE `id` = '$user[id]'");
}
if (isset($_POST['ank_occupation']) && $_POST['ank_occupation'] == 7) {
$user['ank_occupation'] = 7;
mysql_query("UPDATE `user` SET `ank_occupation` = '" . ($user['ank_occupation'] = 7) . "' WHERE `id` = '$user[id]'");
}
if (isset($_POST['ank_occupation']) && $_POST['ank_occupation'] == 8) {
$user['ank_occupation'] = 8;
mysql_query("UPDATE `user` SET `ank_occupation` = '" . ($user['ank_occupation'] = 8) . "' WHERE `id` = '$user[id]'");
}
if (isset($_POST['ank_profession'])) {
$user['ank_profession'] = $_POST['ank_profession'];
mysql_query("UPDATE `user` SET `ank_profession` = '" . mysql_real_escape_string($user['ank_profession']) . "' WHERE `id` = '$user[id]' LIMIT 1");
}
if (!isset($err))
msg('Изменения успешно приняты');
}
err();
aut();
echo "<div class = 'tabs'>";
echo "<a href = 'setting.php'>Основное</a>";
echo "<a href = 'character_type.php'>Типаж</a>";
echo "<a href = 'interest.php'>Интересы</a>";
echo "<a href = 'dop.php' class = 'active'>Дополнительно</a>";
echo "<a href = 'connected.php'>Контакты</a>";
echo "</div>";
echo "<form method='post' class='tabcontent' action='?$passgen'>n";
echo "<div class='f8'>Моя профессия:<br/><input type='text' name='ank_profession' value='" . output_text($user['ank_profession'], false) . "' maxlength='32' /><br /></div>n";
echo "<div class='f8'>";
echo "<b>Курите ли вы:</b>";
echo "<br /> <input name='ank_smoking' type='radio' " . ($user['ank_smoking'] == 0 ? ' checked="checked"' : null) . " value='0' /> Не скажу!<br />";
echo " <input name='ank_smoking' type='radio' " . ($user['ank_smoking'] == 1 ? ' checked="checked"' : null) . " value='1' /> Не курю<br />";
echo " <input name='ank_smoking' type='radio' " . ($user['ank_smoking'] == 2 ? ' checked="checked"' : null) . " value='2' /> Курю<br />";
echo " <input name='ank_smoking' type='radio' " . ($user['ank_smoking'] == 3 ? ' checked="checked"' : null) . " value='3' /> Иногда<br />";
echo " <input name='ank_smoking' type='radio' " . ($user['ank_smoking'] == 4 ? ' checked="checked"' : null) . " value='4' /> Бросаю<br />";
echo "</div>";
echo "<div class='f8'>";
echo "<b>Чем я занимаюсь:</b>";
echo " <br /><input name='ank_occupation' type='radio' " . ($user['ank_occupation'] == 0 ? ' checked="checked"' : null) . " value='0' /> Не скажу!<br />";
echo " <input name='ank_occupation' type='radio' " . ($user['ank_occupation'] == 1 ? ' checked="checked"' : null) . " value='1' /> Учусь в школе<br />";
echo " <input name='ank_occupation' type='radio' " . ($user['ank_occupation'] == 2 ? ' checked="checked"' : null) . " value='2' /> Учусь в колледже/лицее <br />";
echo " <input name='ank_occupation' type='radio' " . ($user['ank_occupation'] == 3 ? ' checked="checked"' : null) . " value='3' /> Учусь в ВУЗе<br />";
echo " <input name='ank_occupation' type='radio' " . ($user['ank_occupation'] == 4 ? ' checked="checked"' : null) . " value='4' /> Учусь в военном училище<br />";
echo " <input name='ank_occupation' type='radio' " . ($user['ank_occupation'] == 5 ? ' checked="checked"' : null) . " value='5' /> Служу в армии<br />";
echo " <input name='ank_occupation' type='radio' " . ($user['ank_occupation'] == 6 ? ' checked="checked"' : null) . " value='6' /> Работаю<br />";
echo " <input name='ank_occupation' type='radio' " . ($user['ank_occupation'] == 7 ? ' checked="checked"' : null) . " value='7' /> Не работаю<br />";
echo " <input name='ank_occupation' type='radio' " . ($user['ank_occupation'] == 8 ? ' checked="checked"' : null) . " value='8' /> Сижу на зоне<br />";
echo "</div><div class = 'f8'>";
echo "<button name = 'save' class = 'btn'>";
echo "<img src = '/style/icons/ok.png' /> Сохранить изменения";
echo "</button></div></form><div class='foot'>";
echo "<a href='/user/anketa/?name=" . $user['nick'] . "'>Посмотреть анкету</a>";
echo "</div>n";
require_once '../../sys/inc/tfoot.php';