Файл: user/anketa/interest.php
Строк: 153
<?php
/* Мод "Анкета"
* Версия v0.0.1
* Дата последнего редактирования 19.01.2015
* Двиг DCMS Special
* Модифицировал densnet
* Файл interest.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_music']) && preg_match('#^([0,1-9 A-zА-я -]*)$#ui', $_POST['ank_music'])) {
$user['ank_music'] = htmlspecialchars(mysql_real_escape_string($_POST['ank_music']));
mysql_query("UPDATE `user` SET `ank_music` = '" . mysql_real_escape_string($user['ank_music']) . "' WHERE `id` = '$user[id]' LIMIT 1");
} else {
$err[] = 'Неверный формат любимая музыка';
}
if (isset($_POST['ank_films']) && preg_match('#^([0,1-9 A-zА-я -]*)$#ui', $_POST['ank_films'])) {
$user['ank_films'] = htmlspecialchars(mysql_real_escape_string($_POST['ank_films']));
mysql_query("UPDATE `user` SET `ank_films` = '" . mysql_real_escape_string($user['ank_films']) . "' WHERE `id` = '$user[id]' LIMIT 1");
} else {
$err[] = 'Неверный формат любимый фильм';
}
if (isset($_POST['ank_books']) && preg_match('#^([0,1-9 A-zА-я -]*)$#ui', $_POST['ank_books'])) {
$user['ank_books'] = htmlspecialchars(mysql_real_escape_string($_POST['ank_books']));
mysql_query("UPDATE `user` SET `ank_books` = '" . mysql_real_escape_string($user['ank_books']) . "' WHERE `id` = '$user[id]' LIMIT 1");
} else {
$err[] = 'Неверный формат любимые книги';
}
if (isset($_POST['ank_passion']) && preg_match('#^([0,1-9 A-zА-я -]*)$#ui', $_POST['ank_passion'])) {
$user['ank_passion'] = htmlspecialchars(mysql_real_escape_string($_POST['ank_passion']));
mysql_query("UPDATE `user` SET `ank_passion` = '" . mysql_real_escape_string($user['ank_passion']) . "' WHERE `id` = '$user[id]' LIMIT 1");
} else {
$err[] = 'Неверный формат увлечения';
}
if (isset($_POST['ank_course']) && preg_match('#^([0,1-9 A-zА-я -]*)$#ui', $_POST['ank_course'])) {
$user['ank_course'] = htmlspecialchars(mysql_real_escape_string($_POST['ank_course']));
mysql_query("UPDATE `user` SET `ank_course` = '" . mysql_real_escape_string($user['ank_course']) . "' WHERE `id` = '$user[id]' LIMIT 1");
} else {
$err[] = 'Неверный формат любимое блюдо';
}
if (!isset($err)) {
msg('Изменения успешно приняты');
header("Refresh: 1; url=/user/anketa/interest.php");
echo "<a href = '/user/anketa/interest.php'><div class = 'razd'>" . img16('left.png') . " Назад</div></a>";
require_once H . 'sys/inc/tfoot.php';
}
}
aut();
err();
echo "<div class = 'razd'>";
echo "<a class = 'noactiv' href = 'setting.php'>Основное</a>";
echo "<a class = 'noactiv' href = 'character_type.php'>Типаж</a>";
echo "<a href = 'interest.php' class = 'activ'>Интересы</a>";
echo "<a class = 'noactiv' href = 'dop.php'>Доп.</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_music' value = '" . text::toOutput($user['ank_music'], false) . "' maxlength = '32' /><br />";
echo "<div class = 'input-icon'>" . img16('music.png') . "</div>";
echo "</div>";
echo "Любимые фильмы:<br />";
echo "<div class = 'inputs'>";
echo "<input type = 'text' name = 'ank_films' value = '" . text::toOutput($user['ank_films'], false) . "' maxlength = '32' /><br />";
echo "<div class = 'input-icon'>" . img16('film.png') . "</div>";
echo "</div>";
echo "Любимые книги:<br />";
echo "<div class = 'inputs'>";
echo "<input type = 'text' name = 'ank_books' value = '" . text::toOutput($user['ank_books'], false) . "' maxlength = '32' /><br />";
echo "<div class = 'input-icon'>" . img16('book.png') . "</div>";
echo "</div>";
echo "Любимое блюдо:<br />";
echo "<div class = 'inputs'>";
echo "<input type = 'text' name = 'ank_course' value = '" . text::toOutput($user['ank_course'], false) . "' maxlength = '32' /><br />";
echo "<div class = 'input-icon'>" . img16('sha.png') . "</div>";
echo "</div>";
echo "Увлечения:<br />";
echo "<div class = 'inputs'>";
echo "<input type = 'text' name = 'ank_passion' value = '" . text::toOutput($user['ank_passion'], false) . "' maxlength = '32' /><br />";
echo "<div class = 'input-icon'>" . img16('cartu.png') . "</div>";
echo "</div>";
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';