Файл: user/anketa/connected.php
Строк: 141
<?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_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('Изменения успешно приняты');
}
}
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'>Дополнительно</a>";
echo "<a href = 'connected.php' class = 'active'>Контакты</a>";
echo "</div>";
echo "<form method='post' class='tabcontent' action='?$passgen'>n";
echo "<div class='f8'>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><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';