Файл: user/anketa/connected.php
Строк: 155
<?php
/* Мод "Анкета"
* Версия v0.0.1
* Дата последнего редактирования 30.11.2014
* Двиг DCMS Special
* Модифицировал densnet
* Файл connected.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_icq']) && (is_numeric($_POST['ank_icq']) && strlen($_POST['ank_icq']) >= 5 && strlen($_POST['ank_icq']) <= 9 || $_POST['ank_icq'] == NULL)) {
$user['ank_icq'] = $_POST['ank_icq'];
if ($user['ank_icq'] == null) {
$user['ank_icq'] = 'null';
}
mysql_query("UPDATE `user` SET `ank_icq` = $user[ank_icq] WHERE `id` = '$user[id]' LIMIT 1");
if ($user['ank_icq'] == 'null') {
$user['ank_icq'] = NULL;
}
} else {
$err[] = 'Неверный формат ICQ';
}
if (isset($_POST['set_show_mail']) && $_POST['set_show_mail'] == 1) {
$user['set_show_mail'] = 1;
mysql_query("UPDATE `user` SET `set_show_mail` = '1' WHERE `id` = '$user[id]' LIMIT 1");
} else {
$user['set_show_mail'] = 0;
mysql_query("UPDATE `user` SET `set_show_mail` = '0' WHERE `id` = '$user[id]' LIMIT 1");
}
if (isset($_POST['ank_n_tel']) && (is_numeric($_POST['ank_n_tel']) && strlen($_POST['ank_n_tel']) >= 5 && strlen($_POST['ank_n_tel']) <= 11 || $_POST['ank_n_tel'] == NULL)) {
$user['ank_n_tel'] = $_POST['ank_n_tel'];
mysql_query("UPDATE `user` SET `ank_n_tel` = '$user[ank_n_tel]' WHERE `id` = '$user[id]' LIMIT 1");
} else {
$err[] = 'Неверный формат номера телефона(моб)';
}
if (isset($_POST['ank_mail']) && ($_POST['ank_mail'] == null || preg_match('#^[a-z0-9-._]+@([a-z0-9]+.)+([a-z0-9]{2,4})$#ui', $_POST['ank_mail']))) {
$user['ank_mail'] = $_POST['ank_mail'];
mysql_query("UPDATE `user` SET `ank_mail` = '$user[ank_mail]' WHERE `id` = '$user[id]' LIMIT 1");
} else {
$err[] = 'Неверный E-mail';
}
if (isset($_POST['ank_n_tel_home']) && (is_numeric($_POST['ank_n_tel_home']) && strlen($_POST['ank_n_tel_home']) >= 5 && strlen($_POST['ank_n_tel_home']) <= 11 || $_POST['ank_n_tel_home'] == NULL)) {
$user['ank_n_tel_home'] = $_POST['ank_n_tel_home'];
mysql_query("UPDATE `user` SET `ank_n_tel_home` = '$user[ank_n_tel_home]' WHERE `id` = '$user[id]' LIMIT 1");
} else {
$err[] = 'Неверный формат номера телефона(дом)';
}
if (!isset($err)) {
msg('Изменения успешно приняты');
header("Refresh: 1; url=/user/anketa/connected.php");
echo "<a href = '/user/anketa/connected.php'><div class = 'razd'>" . img('left.png') . " Назад</div></a>";
require_once H . 'sys/inc/tfoot.php';
}
}
err();
aut();
echo "<div class = 'tabs t_bar clear_fix'>";
echo "<a href = 'setting.php'>Основное</a>";
echo "<a href = 'character_type.php'>Типаж</a>";
echo "<a href = 'interest.php'>Интересы</a>";
echo "<a href = 'dop.php'>Доп.</a>";
echo "<a href = 'connected.php' class = 'active'>Контакты</a>";
echo "</div>";
echo "<form method = 'post' class = 'razd' action = '?$passgen'>n";
echo "ICQ:<br/><input type = 'text' name = 'ank_icq' value = '$user[ank_icq]' maxlength = '9' /><br />";
echo "E-mail<br />";
echo "<input type = 'text' name = 'ank_mail' value = '$user[ank_mail]' maxlength = '32' /><br />";
echo "<label><input type = 'checkbox' name = 'set_show_mail'" . ($user['set_show_mail'] == 1 ? ' checked = "checked"' : null) . " value = '1' />Показывать в анкете?</label><br />";
echo "Номер телефона (<b>моб</b>):<br />";
echo "<input type = 'text' name = 'ank_n_tel' value = '$user[ank_n_tel]' maxlength = '11' /><br />";
echo "Номер телефона (<b>дом</b>):<br />";
echo "<input type = 'text' name = 'ank_n_tel_home' value = '$user[ank_n_tel_home]' maxlength = '11' /><br />";
echo "<div class = 'hr'></div>";
echo "<button name = 'save' class = 'action'>";
echo "<span class = 'label'><span class = 'icon icon67' /> Сохранить</span>";
echo "</button></form><div class = 'razd'>";
echo "<a href = '/user/anketa/?name=" . $user['nick'] . "'>Посмотреть анкету</a>";
echo "</div>n";
require_once H . 'sys/inc/tfoot.php';