Файл: user/anketa/dop.php
Строк: 317
<?php
/* Мод "Анкета"
* Версия v0.0.1
* Дата последнего редактирования 19.01.2015
* Двиг DCMS Special
* Модифицировал densnet
* Файл dop.php
* Описание: Дополнительно
*/
require_once '../../sys/inc/start.php';
require_once H . 'sys/inc/compress.php';
require_once H . 'sys/inc/sess.php';
require_once H . 'sys/inc/settings.php';
require_once H . 'sys/inc/db_connect.php';
require_once H . 'sys/inc/ipua.php';
require_once H . 'sys/inc/fnc.php';
require_once H . 'sys/inc/user.php';
user::only_reg();
$set['title'] = 'Дополнительно';
require_once H . 'sys/inc/thead.php';
title();
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('Изменения успешно приняты');
header("Refresh: 1; url=/user/anketa/dop.php");
echo "<a href = '/user/anketa/dop.php'><div class = 'razd'>" . img16('left.png') . " Назад</div></a>";
require_once H . 'sys/inc/tfoot.php';
}
}
err();
aut();
echo "<div class = 'razd'>";
echo "<a class = 'noactiv' href = 'setting.php'>Основное</a>";
echo "<a class = 'noactiv' href = 'character_type.php'>Типаж</a>";
echo "<a class = 'noactiv' href = 'interest.php'>Интересы</a>";
echo "<a href = 'dop.php' class = 'activ'>Доп.</a>";
echo "<a class = 'noactiv' href = 'connected.php'>Контакты</a>";
echo "</div>";
echo "<form method = 'post' class = 'razd' action = '?$passgen'>n";
echo "Моя профессия:<br/>";
echo "<div class = 'inputs'>";
echo "<input type = 'text' name = 'ank_profession' value = '" . text::toOutput($user['ank_profession'], false) . "' maxlength = '32' /><br />";
echo "<div class = 'input-icon'>" . img16('medic.png') . "</div>";
echo "</div>";
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 "<br /><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 "<button name = 'save' class = 'button sign-ins'>" . img16('save.png') . " Сохранить";
echo "</button></form><div class = 'razd'>";
echo "<a class = 'add' href = '/user/anketa/?name=" . $user['nick'] . "'>" . img16('ank.png') . " Посмотреть анкету</a>";
echo "</div>n";
require_once H . 'sys/inc/tfoot.php';