Файл: profile.php
Строк: 1098
<?
require_once("core/core.php");
$location = 'В анкете';
    switch (@$_GET['act']) {
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Имя~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
        case 'name':
            if ($u['id'] != $u['id']) {
                include 'head.php';
                echo "Что вы тут забыли?";
                include 'foot.php';
                exit;
            }
            $title = $title . ' :: Имя';
            require('head.php');
            echo '<div class="title"><center>';
            echo '<a href="/sid=ank">Анкета</a> :: Имя';
            echo '</center></div>';
            if (isset($_POST['submit'])) {
                $anketa_name = check(substr($_POST['anketa_name'], 0, 50));
                mysql_query("UPDATE `users` SET
`anketa_name` = '$anketa_name'
WHERE `id` = '" . $u['id'] . "'
");
                header("Location: profile.php?act=name&ok=1");
            } else {
                if (@$_GET['ok']) {
                    header('Location: profile.php?&ok=1');
                }
                $req = mysql_query("SELECT * FROM `users` WHERE `id` = '" . $u['id'] . "' LIMIT 1");
                $u = mysql_fetch_assoc($req);
            }
            $anketa_name = checkout($u['anketa_name']);
            echo '<div class="div">';
            echo '<form action="profile.php?act=name" method=post>';
            echo 'Имя: <br/><input type=text name=anketa_name maxlength=50 value="' . $anketa_name . '"></br>';
            echo '<input type=submit name="submit" value="Сохранить" class="submit white"/></form>';
            echo '</div>';
            require('foot.php');
            break;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Год рождения~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
        case 'bday':
            if ($u['id'] != $u['id']) {
                include 'head.php';
                echo "Что вы тут забыли?";
                include 'foot.php';
                exit;
            }
            $title = $title . ' :: Дата рождения';
            require('head.php');
            echo '<div class="title"><center>';
            echo '<a href="/sid=ank">Анкета</a> :: Дата рождения';
            echo '</center></div>';
            if (isset($_POST['submit'])) {
                $anketa_bday = num($_POST['anketa_bday']);
                if ($anketa_bday > 31)
                    $anketa_bday = '';
                $anketa_bmonth = num($_POST['anketa_bmonth']);
                if ($anketa_bmonth > 12)
                    $anketa_bmonth = '';
                $anketa_byear = num($_POST['anketa_byear']);
                if ($anketa_byear < 1920 or $anketa_byear > 1999)
                    $anketa_byear = '';
                mysql_query("UPDATE `users` SET
`anketa_bday` = '$anketa_bday',
`anketa_bmonth` = '$anketa_bmonth',
`anketa_byear` = '$anketa_byear'
WHERE `id` = '" . $u['id'] . "'
");
                header("Location: profile.php?act=bday&ok=1");
            } else {
                if (@$_GET['ok']) {
                    header('Location: profile.php?&ok=1');
                }
                $req = mysql_query("SELECT * FROM `users` WHERE `id` = '" . $u['id'] . "' LIMIT 1");
                $u = mysql_fetch_assoc($req);
            }
            echo '<div class="div">';
            echo '<form action="profile.php?act=bday" method=post>';
            echo 'Дата рождения: <br/><select name="anketa_bday"><option value="0">День</option>';
            for ($i = 1; $i < 32; $i++) {
                echo '<option value="' . $i . '" ' . ($i == $u["anketa_bday"] ? ' selected="selected"' : '') . '>' . $i . '</option>';
            }
            echo '</select>';
            echo ' <select name="anketa_bmonth">
    <option value="0">Месяц</option>
    <option value="1" ' . ($u["anketa_bmonth"] == 1 ? ' selected="selected"' : '') . '>Января</option>
    <option value="2" ' . ($u["anketa_bmonth"] == 2 ? ' selected="selected"' : '') . '>Февраля</option>
    <option value="3" ' . ($u["anketa_bmonth"] == 3 ? ' selected="selected"' : '') . '>Марта</option>
    <option value="4" ' . ($u["anketa_bmonth"] == 4 ? ' selected="selected"' : '') . '>Апреля</option>
    <option value="5" ' . ($u["anketa_bmonth"] == 5 ? ' selected="selected"' : '') . '>Мая</option>
    <option value="6" ' . ($u["anketa_bmonth"] == 6 ? ' selected="selected"' : '') . '>Июня</option>
    <option value="7" ' . ($u["anketa_bmonth"] == 7 ? ' selected="selected"' : '') . '>Июля</option>
    <option value="8" ' . ($u["anketa_bmonth"] == 8 ? ' selected="selected"' : '') . '>Августа</option>
    <option value="9" ' . ($u["anketa_bmonth"] == 9 ? ' selected="selected"' : '') . '>Сентября</option>
    <option value="10" ' . ($u["anketa_bmonth"] == 10 ? ' selected="selected"' : '') . '>Октября</option>
    <option value="11" ' . ($u["anketa_bmonth"] == 11 ? ' selected="selected"' : '') . '>Ноября</option>
    <option value="12" ' . ($u["anketa_bmonth"] == 12 ? ' selected="selected"' : '') . '>Декабря</option></select>';
            echo ' <select name="anketa_byear"><option value="0">Год</option>';
            for ($i = 1940; $i < 2005; $i++) {
                echo '<option value="' . $i . '" ' . ($i == $u["anketa_byear"] ? ' selected="selected"' : '') . '>' . $i . '</option>';
            }
            echo '</select></br>';
            echo '<input type=submit name="submit" value="Сохранить" class="submit white"/></form>';
            echo '</div>';
            require('foot.php');
            break;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Пол~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
        case 'sex':
            if ($u['id'] != $u['id']) {
                include 'head.php';
                echo "Что вы тут забыли?";
                include 'foot.php';
                exit;
            }
            $title = $title . ' :: Пол';
            require('head.php');
            echo '<div class="title"><center>';
            echo '<a href="/sid=ank">Анкета</a> :: Пол';
            echo '</center></div>';
            if (isset($_POST['submit'])) {
                $sex = check($_POST['sex']);
                if ($sex != 'zh' && $sex != 'm')
                    $sex = 'm';
                mysql_query("UPDATE `users` SET
`sex` = '$sex'
WHERE `id` = '" . $u['id'] . "'
");
                header("Location: profile.php?act=sex&ok=1");
            } else {
                if (@$_GET['ok']) {
                    header('Location: profile.php?&ok=1');
                }
                $req = mysql_query("SELECT * FROM `users` WHERE `id` = '" . $u['id'] . "' LIMIT 1");
                $u = mysql_fetch_assoc($req);
            }
            echo '<div class="div">';
            echo '<form action="profile.php?act=sex" method=post>';
            echo 'Пол: <br/>';
            echo '<input name="sex" type="radio" value="zh"' . ($u["sex"] == 'zh' ? ' checked' : '') . '/> Женский<br/>';
            echo '<input name="sex" type="radio" value="m"' . ($u["sex"] == 'm' ? ' checked' : '') . '/> Мужской<br/>';
            echo '<input type=submit name="submit" value="Сохранить" class="submit white"/></form>';
            echo '</div>';
            require('foot.php');
            break;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Семейное положение~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
        case 'family':
            if ($u['id'] != $u['id']) {
                include 'head.php';
                echo "Что вы тут забыли?";
                include 'foot.php';
                exit;
            }
            $title = $title . ' :: Семейное положение';
            require('head.php');
            echo '<div class="title"><center>';
            echo '<a href="/sid=ank">Анкета</a> :: Семейное положение';
            echo '</center></div>';
            if ($u['sex'] == 'zh' || $u['sex'] == 'm') {
                if (isset($_POST['submit'])) {
                    $family = num($_POST['family']);
                    mysql_query("UPDATE `users` SET
`family` = '$family'
WHERE `id` = '" . $u['id'] . "'
");
                    header("Location: profile.php?act=family&ok=1");
                } else {
                    if (@$_GET['ok']) {
                        header('Location: profile.php?&ok=1');
                    }
                    $req = mysql_query("SELECT * FROM `users` WHERE `id` = '" . $u['id'] . "' LIMIT 1");
                    $u = mysql_fetch_assoc($req);
                }
                echo '<div class="div">';
                echo '<form action="profile.php?act=family" method=post>';
                echo 'Семейное положение: <br/>';
                if ($u['sex'] == 'zh') {
                    echo '<input name="family" type="radio" value="0"' . ($u["family"] == 0 ? ' checked' : '') . '/> Не указано<br/>';
                    echo '<input name="family" type="radio" value="1"' . ($u["family"] == 1 ? ' checked' : '') . '/> Не замужем<br/>';
                    echo '<input name="family" type="radio" value="2"' . ($u["family"] == 2 ? ' checked' : '') . '/> Есть друг<br/>';
                    echo '<input name="family" type="radio" value="3"' . ($u["family"] == 3 ? ' checked' : '') . '/> Помолвлена<br/>';
                    echo '<input name="family" type="radio" value="4"' . ($u["family"] == 4 ? ' checked' : '') . '/> Замужем<br/>';
                    echo '<input name="family" type="radio" value="5"' . ($u["family"] == 5 ? ' checked' : '') . '/> Всё сложно<br/>';
                    echo '<input name="family" type="radio" value="6"' . ($u["family"] == 6 ? ' checked' : '') . '/> В активном поиске<br/>';
                } else {
                    echo '<input name="family" type="radio" value="0"' . ($u["family"] == 0 ? ' checked' : '') . '/> Не указано<br/>';
                    echo '<input name="family" type="radio" value="1"' . ($u["family"] == 1 ? ' checked' : '') . '/> Не женат<br/>';
                    echo '<input name="family" type="radio" value="2"' . ($u["family"] == 2 ? ' checked' : '') . '/> Есть подруга<br/>';
                    echo '<input name="family" type="radio" value="3"' . ($u["family"] == 3 ? ' checked' : '') . '/> Помолвлен<br/>';
                    echo '<input name="family" type="radio" value="4"' . ($u["family"] == 4 ? ' checked' : '') . '/> Женат<br/>';
                    echo '<input name="family" type="radio" value="5"' . ($u["family"] == 5 ? ' checked' : '') . '/> Всё сложно<br/>';
                    echo '<input name="family" type="radio" value="6"' . ($u["family"] == 6 ? ' checked' : '') . '/> В активном поиске<br/>';
                }
                echo '<input type=submit name="submit" value="Сохранить" class="submit white"/></form>';
                echo '</div>';
            } else {
                echo '<div class="div"> Ошибка! Отказано в доступе! </div>';
                require('foot.php');
                exit;
            }
            require('foot.php');
            break;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Рост~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
        case 'growth':
            if ($u['id'] != $u['id']) {
                include 'head.php';
                echo "Что вы тут забыли?";
                include 'foot.php';
                exit;
            }
            $title = $title . ' :: Рост';
            require('head.php');
            echo '<div class="title"><center>';
            echo '<a href="/sid=ank">Анкета</a> :: Рост';
            echo '</center></div>';
            if (isset($_POST['submit'])) {
                $growth = check(substr($_POST['growth'], 0, 3));
                mysql_query("UPDATE `users` SET
`growth` = '$growth'
WHERE `id` = '" . $u['id'] . "'
");
                header("Location: profile.php?act=growth&ok=1");
            } else {
                if (@$_GET['ok']) {
                    header('Location: profile.php?&ok=1');
                }
                $req = mysql_query("SELECT * FROM `users` WHERE `id` = '" . $u['id'] . "' LIMIT 1");
                $u = mysql_fetch_assoc($req);
            }
            $growth = checkout($u['growth']);
            echo '<div class="div">';
            echo '<form action="profile.php?act=growth" method=post>';
            echo 'Ваш рост: <br/><input type="text" name="growth" maxlength="3" value="' . $growth . '">см</br>';
            echo '<input type="submit" name="submit" value="Сохранить" class="submit white"/></form>';
            echo '</div>';
            require('foot.php');
            break;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Вес~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
        case 'weight':
            if ($u['id'] != $u['id']) {
                include 'head.php';
                echo "Что вы тут забыли?";
                include 'foot.php';
                exit;
            }
            $title = $title . ' :: Вес';
            require('head.php');
            echo '<div class="title"><center>';
            echo '<a href="/sid=ank">Анкета</a> :: Вес';
            echo '</center></div>';
            if (isset($_POST['submit'])) {
                $weight = check(substr($_POST['weight'], 0, 3));
                mysql_query("UPDATE `users` SET
`weight` = '$weight'
WHERE `id` = '" . $u['id'] . "'
");
                header("Location: profile.php?act=weight&ok=1");
            } else {
                if (@$_GET['ok']) {
                    header('Location: profile.php?&ok=1');
                }
                $req = mysql_query("SELECT * FROM `users` WHERE `id` = '" . $u['id'] . "' LIMIT 1");
                $u = mysql_fetch_assoc($req);
            }
            $weight = checkout($u['weight']);
            echo '<div class="div">';
            echo '<form action="profile.php?act=weight" method=post>';
            echo 'Ваш вес: <br/><input type="text" name="weight" maxlength="3" value="' . $weight . '">кг</br>';
            echo '<input type="submit" name="submit" value="Сохранить" class="submit white"/></form>';
            echo '</div>';
            require('foot.php');
            break;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Волосы~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
        case 'hair':
            if ($u['id'] != $u['id']) {
                include 'head.php';
                echo "Что вы тут забыли?";
                include 'foot.php';
                exit;
            }
            $title = $title . ' :: Цвет волос';
            require('head.php');
            echo '<div class="title"><center>';
            echo '<a href="/sid=ank">Анкета</a> :: Цвет волос';
            echo '</center></div>';
            if (isset($_POST['submit'])) {
                $hair = check($_POST['hair']);
                mysql_query("UPDATE `users` SET
`hair` = '$hair'
WHERE `id` = '" . $u['id'] . "'
");
                header("Location: profile.php?act=hair&ok=1");
            } else {
                if (@$_GET['ok']) {
                    header('Location: profile.php?&ok=1');
                }
                $req = mysql_query("SELECT * FROM `users` WHERE `id` = '" . $u['id'] . "' LIMIT 1");
                $u = mysql_fetch_assoc($req);
            }
            $hair = checkout($u['hair']);
            echo '<div class="div">';
            echo '<form action="profile.php?act=hair" method=post>';
            echo 'Цвет волос: <br/><input type=text name=hair size="22" maxlength="20" value="' . $hair . '"></br>';
            echo '<input type=submit name="submit" value="Сохранить" class="submit white"/></form>';
            echo '</div>';
            require('foot.php');
            break;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Глаза~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
        case 'eyes':
            if ($u['id'] != $u['id']) {
                include 'head.php';
                echo "Что вы тут забыли?";
                include 'foot.php';
                exit;
            }
            $title = $title . ' :: Цвет глаз';
            require('head.php');
            echo '<div class="title"><center>';
            echo '<a href="/sid=ank">Анкета</a> :: Цвет галз';
            echo '</center></div>';
            if (isset($_POST['submit'])) {
                $eyes = check(substr($_POST['eyes'], 0, 20));
                mysql_query("UPDATE `users` SET
`eyes` = '$eyes'
WHERE `id` = '" . $u['id'] . "'
");
                header("Location: profile.php?act=eyes&ok=1");
            } else {
                if (@$_GET['ok']) {
                    header('Location: profile.php?&ok=1');
                }
                $req = mysql_query("SELECT * FROM `users` WHERE `id` = '" . $u['id'] . "' LIMIT 1");
                $u = mysql_fetch_assoc($req);
            }
            $eyes = checkout($u['eyes']);
            echo '<div class="div">';
            echo '<form action="profile.php?act=eyes" method=post>';
            echo 'Цвет глаз: <br/><input type=text name=eyes maxlength=50 value="' . $eyes . '"></br>';
            echo '<input type=submit name="submit" value="Сохранить" class="submit white"/></form>';
            echo '</div>';
            require('foot.php');
            break;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Телосложение~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
        case 'physique':
            if ($u['id'] != $u['id']) {
                include 'head.php';
                echo "Что вы тут забыли?";
                include 'foot.php';
                exit;
            }
            $title = $title . ' :: Телосложение';
            require('head.php');
            echo '<div class="title"><center>';
            echo '<a href="/sid=ank">Анкета</a> :: Телосложение';
            echo '</center></div>';
            if (isset($_POST['submit'])) {
                $physique = num($_POST['physique']);
                mysql_query("UPDATE `users` SET
`physique` = '$physique'
WHERE `id` = '" . $u['id'] . "'
");
                header("Location: profile.php?act=physique&ok=1");
            } else {
                if (@$_GET['ok']) {
                    header('Location: profile.php?&ok=1');
                }
                $req = mysql_query("SELECT * FROM `users` WHERE `id` = '" . $u['id'] . "' LIMIT 1");
                $u = mysql_fetch_assoc($req);
            }
            echo '<div class="div">';
            echo '<form action="profile.php?act=physique" method=post>';
            echo 'Телосложение: <br/>';
            echo '<input name="physique" type="radio" value="0"' . ($u["physique"] == 0 ? ' checked' : '') . '/> Не указано<br/>';
            echo '<input name="physique" type="radio" value="1"' . ($u["physique"] == 1 ? ' checked' : '') . '/> Обычное<br/>';
            echo '<input name="physique" type="radio" value="2"' . ($u["physique"] == 2 ? ' checked' : '') . '/> Худощавое<br/>';
            echo '<input name="physique" type="radio" value="3"' . ($u["physique"] == 3 ? ' checked' : '') . '/> Спортивное<br/>';
            echo '<input name="physique" type="radio" value="4"' . ($u["physique"] == 4 ? ' checked' : '') . '/> Мускулистое<br/>';
            echo '<input name="physique" type="radio" value="5"' . ($u["physique"] == 5 ? ' checked' : '') . '/> Плотное<br/>';
            echo '<input type=submit name="submit" value="Сохранить" class="submit white"/></form>';
            echo '</div>';
            require('foot.php');
            break;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Характер~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
        case 'character':
            if ($u['id'] != $u['id']) {
                include 'head.php';
                echo "Что вы тут забыли?";
                include 'foot.php';
                exit;
            }
            $title = $title . ' :: Характер';
            require('head.php');
            echo '<div class="title"><center>';
            echo '<a href="/sid=ank">Анкета</a> :: Характер';
            echo '</center></div>';
            if (isset($_POST['submit'])) {
                $character = check(substr($_POST['character'], 0, 20));
                mysql_query("UPDATE `users` SET
`character` = '$character'
WHERE `id` = '" . $u['id'] . "'
");
                header("Location: profile.php?act=character&ok=1");
            } else {
                if (@$_GET['ok']) {
                    header('Location: profile.php?&ok=1');
                }
                $req = mysql_query("SELECT * FROM `users` WHERE `id` = '" . $u['id'] . "' LIMIT 1");
                $u = mysql_fetch_assoc($req);
            }
            $character = checkout($u['character']);
            echo '<div class="div">';
            echo '<form action="profile.php?act=character" method=post>';
            echo 'Характер: <br/><input type=text name=character maxlength=50 value=' . $character . '></br>';
            echo '<input type=submit name="submit" value="Сохранить" class="submit white"/></form>';
            echo '</div>';
            require('foot.php');
            break;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Ориентация~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
        case 'orientation':
            if ($u['id'] != $u['id']) {
                include 'head.php';
                echo "Что вы тут забыли?";
                include 'foot.php';
                exit;
            }
            $title = $title . ' :: Ориентация';
            require('head.php');
            echo '<div class="title"><center>';
            echo '<a href="/sid=ank">Анкета</a> :: Ориентация';
            echo '</center></div>';
            if (isset($_POST['submit'])) {
                $orientation = num($_POST['orientation']);
                mysql_query("UPDATE `users` SET
`orientation` = '$orientation'
WHERE `id` = '" . $u['id'] . "'
");
                header("Location: profile.php?act=orientation&ok=1");
            } else {
                if (@$_GET['ok']) {
                    header('Location: profile.php?&ok=1');
                }
                $req = mysql_query("SELECT * FROM `users` WHERE `id` = '" . $u['id'] . "' LIMIT 1");
                $u = mysql_fetch_assoc($req);
            }
            echo '<div class="div">';
            echo '<form action="profile.php?act=orientation" method=post>';
            echo 'Ориентация: <br/>';
            echo '<input name="orientation" type="radio" value="0"' . ($u["orientation"] == 0 ? ' checked' : '') . '/> Не указано<br/>';
            echo '<input name="orientation" type="radio" value="1"' . ($u["orientation"] == 1 ? ' checked' : '') . '/> Гетеро<br/>';
            echo '<input name="orientation" type="radio" value="2"' . ($u["orientation"] == 2 ? ' checked' : '') . '/> Гей<br/>';
            echo '<input name="orientation" type="radio" value="3"' . ($u["orientation"] == 3 ? ' checked' : '') . '/> Лесби<br/>';
            echo '<input name="orientation" type="radio" value="4"' . ($u["orientation"] == 4 ? ' checked' : '') . '/> Би<br/>';
            echo '<input type=submit name="submit" value="Сохранить" class="submit white"/></form>';
            echo '</div>';
            require('foot.php');
            break;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Цель знакомства~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
        case 'dating':
            if ($u['id'] != $u['id']) {
                include 'head.php';
                echo "Что вы тут забыли?";
                include 'foot.php';
                exit;
            }
            $title = $title . ' :: Цель знакомства';
            require('head.php');
            echo '<div class="title"><center>';
            echo '<a href="/sid=ank">Анкета</a> :: Цель знакомства';
            echo '</center></div>';
            if (isset($_POST['submit'])) {
                $dating1 = num($_POST['dating1']);
                $dating2 = num($_POST['dating2']);
                $dating3 = num($_POST['dating3']);
                $dating4 = num($_POST['dating4']);
                $dating5 = num($_POST['dating5']);
                $dating6 = num($_POST['dating6']);
                $dating7 = num($_POST['dating7']);
                $dating8 = num($_POST['dating8']);
                mysql_query("UPDATE `users` SET
`dating1` = '$dating1',
`dating2` = '$dating2',
`dating3` = '$dating3',
`dating4` = '$dating4',
`dating5` = '$dating5',
`dating6` = '$dating6',
`dating7` = '$dating7',
`dating8` = '$dating8'
WHERE `id` = '" . $u['id'] . "'
");
                header("Location: profile.php?act=dating&ok=1");
            } else {
                if (@$_GET['ok']) {
                    header('Location: profile.php?&ok=1');
                }
                $req = mysql_query("SELECT * FROM `users` WHERE `id` = '" . $u['id'] . "' LIMIT 1");
                $u = mysql_fetch_assoc($req);
            }
            echo '<div class="div">';
            echo '<form action="profile.php?act=dating" method=post>';
            echo 'Цель знакомства: <br/>';
            echo '<input name="dating1" type="checkbox" value="1"' . ($u["dating1"] == 1 ? ' checked' : '') . '/> Дружба и общение<br/>';
            echo '<input name="dating2" type="checkbox" value="1"' . ($u["dating2"] == 1 ? ' checked' : '') . '/> Флирт, СМС-переписка<br/>';
            echo '<input name="dating3" type="checkbox" value="1"' . ($u["dating3"] == 1 ? ' checked' : '') . '/> Любовь, отношения<br/>';
            echo '<input name="dating4" type="checkbox" value="1"' . ($u["dating4"] == 1 ? ' checked' : '') . '/> Брак, создание семьи<br/>';
            echo '<input name="dating5" type="checkbox" value="1"' . ($u["dating5"] == 1 ? ' checked' : '') . '/> Виртуальный секс<br/>';
            echo '<input name="dating6" type="checkbox" value="1"' . ($u["dating6"] == 1 ? ' checked' : '') . '/> Секс в реале<br/>';
            echo '<input name="dating7" type="checkbox" value="1"' . ($u["dating7"] == 1 ? ' checked' : '') . '/> Ищу спонсора<br/>';
            echo '<input name="dating8" type="checkbox" value="1"' . ($u["dating8"] == 1 ? ' checked' : '') . '/> Стану спонсором<br/>';
            echo '<input type=submit name="submit" value="Сохранить" class="submit white"/></form>';
            echo '</div>';
            require('foot.php');
            break;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Чем я занимаюсь~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
        case 'business':
            if ($u['id'] != $u['id']) {
                include 'head.php';
                echo "Что вы тут забыли?";
                include 'foot.php';
                exit;
            }
            $title = $title . ' :: Чем я занимаюсь';
            require('head.php');
            echo '<div class="title"><center>';
            echo '<a href="/sid=ank">Анкета</a> :: Чем я занимаюсь';
            echo '</center></div>';
            if (isset($_POST['submit'])) {
                $business = num($_POST['business']);
                mysql_query("UPDATE `users` SET
`business` = '$business'
WHERE `id` = '" . $u['id'] . "'
");
                header("Location: profile.php?act=business&ok=1");
            } else {
                if (@$_GET['ok']) {
                    header('Location: profile.php?&ok=1');
                }
                $req = mysql_query("SELECT * FROM `users` WHERE `id` = '" . $u['id'] . "' LIMIT 1");
                $u = mysql_fetch_assoc($req);
            }
            echo '<div class="div">';
            echo '<form action="profile.php?act=business" method=post>';
            echo 'Чем я занимаюсь: <br/>';
            echo '<input name="business" type="radio" value="0"' . ($u["business"] == 0 ? ' checked' : '') . '/> Не указано<br/>';
            echo '<input name="business" type="radio" value="1"' . ($u["business"] == 1 ? ' checked' : '') . '/> Учусь в школе<br/>';
            echo '<input name="business" type="radio" value="2"' . ($u["business"] == 2 ? ' checked' : '') . '/> Учусь в колледже/лицее<br/>';
            echo '<input name="business" type="radio" value="3"' . ($u["business"] == 3 ? ' checked' : '') . '/> Учусь в ВУЗе<br/>';
            echo '<input name="business" type="radio" value="4"' . ($u["business"] == 4 ? ' checked' : '') . '/> Учусь в военном училище<br/>';
            echo '<input name="business" type="radio" value="5"' . ($u["business"] == 5 ? ' checked' : '') . '/> Служу в армии<br/>';
            echo '<input name="business" type="radio" value="6"' . ($u["business"] == 6 ? ' checked' : '') . '/> Работаю<br/>';
            echo '<input name="business" type="radio" value="7"' . ($u["business"] == 7 ? ' checked' : '') . '/> Не работаю<br/>';
            echo '<input type=submit name="submit" value="Сохранить" class="submit white"/></form>';
            echo '</div>';
            require('foot.php');
            break;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Профессия~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
        case 'profession':
            if ($u['id'] != $u['id']) {
                include 'head.php';
                echo "Что вы тут забыли?";
                include 'foot.php';
                exit;
            }
            $title = $title . ' :: Профессия';
            require('head.php');
            echo '<div class="title"><center>';
            echo '<a href="/sid=ank">Анкета</a> :: Профессия';
            echo '</center></div>';
            if (isset($_POST['submit'])) {
                $profession = check(substr($_POST['profession'], 0, 100));
                mysql_query("UPDATE `users` SET
`profession` = '$profession'
WHERE `id` = '" . $u['id'] . "'
");
                header("Location: profile.php?act=profession&ok=1");
            } else {
                if (@$_GET['ok']) {
                    header('Location: profile.php?&ok=1');
                }
                $req = mysql_query("SELECT * FROM `users` WHERE `id` = '" . $u['id'] . "' LIMIT 1");
                $u = mysql_fetch_assoc($req);
            }
            $profession = checkout($u['profession']);
            echo '<div class="div">';
            echo '<form action="profile.php?act=profession" method=post>';
            echo 'Профессия: <br/><input type=text name=profession maxlength=50 value=' . $profession . '></br>';
            echo '<input type=submit name="submit" value="Сохранить" class="submit white"/></form>';
            echo '</div>';
            require('foot.php');
            break;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Курю ли я~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
        case 'smoke':
            if ($u['id'] != $u['id']) {
                include 'head.php';
                echo "Что вы тут забыли?";
                include 'foot.php';
                exit;
            }
            $title = $title . ' :: Курю ли я';
            require('head.php');
            echo '<div class="title"><center>';
            echo '<a href="/sid=ank">Анкета</a> :: Курю ли я';
            echo '</center></div>';
            if (isset($_POST['submit'])) {
                $smoke = num($_POST['smoke']);
                mysql_query("UPDATE `users` SET
`smoke` = '$smoke'
WHERE `id` = '" . $u['id'] . "'
");
                header("Location: profile.php?act=smoke&ok=1");
            } else {
                if (@$_GET['ok']) {
                    header('Location: profile.php?&ok=1');
                }
                $req = mysql_query("SELECT * FROM `users` WHERE `id` = '" . $u['id'] . "' LIMIT 1");
                $u = mysql_fetch_assoc($req);
            }
            echo '<div class="div">';
            echo '<form action="profile.php?act=smoke" method=post>';
            echo 'Курю ли я: <br/>';
            echo '<input name="smoke" type="radio" value="0"' . ($u["smoke"] == 0 ? ' checked' : '') . '/> Не указано<br/>';
            echo '<input name="smoke" type="radio" value="1"' . ($u["smoke"] == 1 ? ' checked' : '') . '/> Не курю<br/>';
            echo '<input name="smoke" type="radio" value="2"' . ($u["smoke"] == 2 ? ' checked' : '') . '/> Курю<br/>';
            echo '<input name="smoke" type="radio" value="3"' . ($u["smoke"] == 3 ? ' checked' : '') . '/> Иногда<br/>';
            echo '<input name="smoke" type="radio" value="4"' . ($u["smoke"] == 4 ? ' checked' : '') . '/> Бросаю<br/>';
            echo '<input type=submit name="submit" value="Сохранить" class="submit white"/></form>';
            echo '</div>';
            require('foot.php');
            break;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Город~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
        case 'city':
            if ($u['id'] != $u['id']) {
                include 'head.php';
                echo "Что вы тут забыли?";
                include 'foot.php';
                exit;
            }
            $title = $title . ' :: Город';
            require('head.php');
            echo '<div class="title"><center>';
            echo '<a href="/sid=ank">Анкета</a> :: Город';
            echo '</center></div>';
            if (isset($_POST['submit'])) {
                $anketa_city = check(substr($_POST['anketa_city'], 0, 100));
                mysql_query("UPDATE `users` SET
`anketa_city` = '$anketa_city'
WHERE `id` = '" . $u['id'] . "'
");
                header("Location: profile.php?act=city&ok=1");
            } else {
                if (@$_GET['ok']) {
                    header('Location: profile.php?&ok=1');
                }
                $req = mysql_query("SELECT * FROM `users` WHERE `id` = '" . $u['id'] . "' LIMIT 1");
                $u = mysql_fetch_assoc($req);
            }
            $anketa_city = checkout($u['anketa_city']);
            echo '<div class="div">';
            echo '<form action="profile.php?act=city" method=post>';
            echo 'Город: <br/><input type=text name=anketa_city maxlength=50 value="' . $anketa_city . '"></br>';
            echo '<input type=submit name="submit" value="Сохранить" class="submit white"/></form>';
            echo '</div>';
            require('foot.php');
            break;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Телефон~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
        case 'mphone':
            if ($u['id'] != $u['id']) {
                include 'head.php';
                echo "Что вы тут забыли?";
                include 'foot.php';
                exit;
            }
            $title = $title . ' :: Моб. телефон';
            require('head.php');
            echo '<div class="title"><center>';
            echo '<a href="/sid=ank">Анкета</a> :: Моб. телефон';
            echo '</center></div>';
            if (isset($_POST['submit'])) {
                $anketa_mphone = check(substr($_POST['anketa_mphone'], 0, 100));
                mysql_query("UPDATE `users` SET
`anketa_mphone` = '$anketa_mphone'
WHERE `id` = '" . $u['id'] . "'
");
                header("Location: profile.php?act=mphone&ok=1");
            } else {
                if (@$_GET['ok']) {
                    header('Location: profile.php?&ok=1');
                }
                $req = mysql_query("SELECT * FROM `users` WHERE `id` = '" . $u['id'] . "' LIMIT 1");
                $u = mysql_fetch_assoc($req);
            }
            $anketa_mphone = checkout($u['anketa_mphone']);
            echo '<div class="div">';
            echo '<form action="profile.php?act=mphone" method=post>';
            echo 'Моб. телефон: <br/><input type=text name=anketa_mphone maxlength=50 value="' . $anketa_mphone . '"></br>';
            echo '<input type=submit name="submit" value="Сохранить" class="submit white"/></form>';
            echo '</div>';
            require('foot.php');
            break;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Интересы~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
        case 'interests':
            if ($u['id'] != $u['id']) {
                include 'head.php';
                echo "Что вы тут забыли?";
                include 'foot.php';
                exit;
            }
            $title = $title . ' :: Интересы';
            require('head.php');
            echo '<div class="title"><center>';
            echo '<a href="/sid=ank">Анкета</a> :: Интересы';
            echo '</center></div>';
            if (isset($_POST['submit'])) {
                $anketa_interests = check(substr($_POST['anketa_interests'], 0, 500));
                mysql_query("UPDATE `users` SET
`anketa_interests` = '$anketa_interests'
WHERE `id` = '" . $u['id'] . "'
");
                header("Location: profile.php?act=interests&ok=1");
            } else {
                if (@$_GET['ok']) {
                    header('Location: profile.php?&ok=1');
                }
                $req = mysql_query("SELECT * FROM `users` WHERE `id` = '" . $u['id'] . "' LIMIT 1");
                $u = mysql_fetch_assoc($req);
            }
            $anketa_interests = $u['anketa_interests'];
            echo '<div class="div">';
            echo '<form action="profile.php?act=interests" method=post>';
            echo 'Интересы: <br/><textarea cols="17" rows="2" name="anketa_interests"style="height: 50px">' . $anketa_interests . '</textarea></br>';
            echo '<input type=submit name="submit" value="Сохранить" class="submit white"/></form>';
            echo '</div>';
            require('foot.php');
            break;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~О себе~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
        case 'about':
            if ($u['id'] != $u['id']) {
                include 'head.php';
                echo "Что вы тут забыли?";
                include 'foot.php';
                exit;
            }
            $title = $title . ' :: О себе';
            require('head.php');
            echo '<div class="title"><center>';
            echo '<a href="/sid=ank">Анкета</a> :: О себе';
            echo '</center></div>';
            if (isset($_POST['submit'])) {
                $anketa_about = check(substr($_POST['anketa_about'], 0, 1000));
                mysql_query("UPDATE `users` SET
`anketa_about` = '$anketa_about'
WHERE `id` = '" . $u['id'] . "'
");
                header("Location: profile.php?act=about&ok=1");
            } else {
                if (@$_GET['ok']) {
                    header('Location: profile.php?&ok=1');
                }
                $req = mysql_query("SELECT * FROM `users` WHERE `id` = '" . $u['id'] . "' LIMIT 1");
                $u = mysql_fetch_assoc($req);
            }
            $anketa_about = $u['anketa_about'];
            echo '<div class="div">';
            echo '<form action="profile.php?act=about" method=post>';
            echo 'О себе: <br/><textarea cols="17" rows="2" name="anketa_about"style="height: 50px">' . $anketa_about . '</textarea></br>';
            echo '<input type=submit name="submit" value="Сохранить" class="submit white"/>';
            echo '<small><a href = "smiles.php">Смайлы</a> | <a href = "code.php">Теги</a></small>';
            echo '</form>';
            echo '</div>';
            require('foot.php');
            break;
//~~~~~~~~~~~~~~~~~~~~~Приветствие~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
        case 'hello':
            if ($u['id'] != $u['id']) {
                include 'head.php';
                echo "Что вы тут забыли?";
                include 'foot.php';
                exit;
            }
            $title = $title . ' :: Приветствие';
            include 'head.php';
            if (isset($_POST['save'])) {
                if (isset($_POST['hello']) && strlen($_POST['hello']) / 2 <= 60) {
                    if (preg_match('#[^A-zА-я0-9 _-=+()*?.,]#ui', $_POST['hello']))
                        error('Используются запрещенные символы');
                    else {
                        $u['hello'] = $_POST['hello'];
                        mysql_query("UPDATE `users` SET `hello` = '" . $u['hello'] . "' WHERE `id` = '" . $u['id'] . "' LIMIT 1");
                    }
                } else {
                    error('Привышает лимит символов');
                }
                if (!isset($err))
                    header('Location: profile.php?&ok=1');
            }
            echo '<div class="title"><center>';
            echo '<a href="/sid=ank">Анкета</a> :: Приветствие';
            echo '</center></div>';
            echo '<div class="div">';
            echo "<form method='post' action='?act=hello&save'>n";
            echo "Приветствие:<br />n<input type='text' name='hello' value='" . $u['hello'] . "' maxlength='60' /><br />n";
            echo "<input type='submit' name='save' value='Сохранить' />n";
            echo "</form>n";
            echo '</div>';
            include ('foot.php');
            break;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Анкета~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
        default:
            if (isset($_GET['id'])) {
                $id = num($_GET['id']);
                $req = mysql_query("SELECT * FROM `users` WHERE `id` = '$id' LIMIT 1");
                if (mysql_num_rows($req)) {
                    $user = mysql_fetch_assoc($req);
                }
            }
            if (empty($user['id'])) {
                if ($u['id']) {
                    $id = $u['id'];
                    $req = mysql_query("SELECT * FROM `users` WHERE `id` = '" . $u['id'] . "' LIMIT 1");
                    $user = mysql_fetch_assoc($req);
                } else {
                    header("Location: index.php");
                    exit;
                }
            }
            $title = $title . ' :: Анкета ' . $user['login'] . '';
            require('head.php');
            require('core/page_ava.php');
            require('core/bb_code.php');
            echo '<div class="title"><center>';
            echo '<a href="/id' . $user['id'] . '">' . $user['login'] . '</a> :: <a href="/sid=ank?id=' . $user['id'] . '">Анкета</a>';
            echo '</center></div>';
            if (isset($_GET['ok'])) {
                echo '<div class="div"><center><font color="green">Изменения успешно сохранены!</font></center></div>';
            }
            if (@$_GET['rat']) {
                echo '<div class="nav"> <span style="color:#009933">
   <b>Рейтинг обитателей.</b>
   </span><br/>
   У каждого обитателя в SrAkE есть рейтинг.<br/>
   Увидеть его можно в анкете.<br/>
   Мы стараемся сделать так, чтобы рейтинг отражал реальную популярность обитателя.<br/>
   Если вы интересный и отзывчивый человек и при этом много общаетесь и добавляете хорошие файлы, то ваш рейтинг обязательно будет увеличиваться.<br/>
   <b>Рейтинг считается так:</b><br/>
   <span style="color:#990000">Рейтинг = Активность обитателя + Популярность обитателя!</br>
   Рейтинг 10.00 - бронзовая медаль <img src="style/medals/b.png" alt="Бронза" /></br>
   Рейтинг 20.00 - серебряная медаль <img src="style/medals/s.png" alt="Серебро" /></br>
   Рейтинг 30.00 - золотая медаль <img src="style/medals/z.png" alt="Золото" />
   </span></br></div>';
                echo '<div class="div"><center><a href = "?id=' . $user['id'] . '">Скрыть</a></center></div>';
            }
            echo '<div class="page_menu">';
echo '<font color=black>';
            echo 'Дата регистрации:';
            if ($user['id'] == 2) {
                echo "<b> 2013.01.01 в 01:01:01</b></br>";
            } else {
                echo' <b>' . vremya($user['anketa_datareg']) . '</b></br>';
            }
            if ($user['sex'] == 'm') {
                $sex_pol = 'был';
            } else {
                $sex_pol = 'была';
            }
            echo 'Последний раз ' . $sex_pol . ': <b>';
            if ($user['id'] == 2) {
                echo ' Всегда здесь... слежу... работаю...';
            } else {
                if ($user['id'] == 2) {
                    echo ' ' . vremya(time()) . '';
                } else {
                    echo ' ' . vremya($user['online']) . '';
                }
            }
            echo "</b></br>";
            if ($user['id'] == 2)
                echo 'Должность: <u><font color="green">Система</font></u></br>';
            if ($user['admin'] == 1)
                echo 'Должность: <u><font color="green">Создатель</font></u></br>';
            if ($user['admin'] == 2)
                echo 'Должность: <u><font color="green">Администратор</font></u></br>';
            if ($user['admin'] == 3)
                echo 'Должность: <u><font color="green">Модератор Форума</font></u></br>';
            if ($user['admin'] == 4)
                echo 'Должность: <u><font color="green">Модератор Чата</font></u></br>';
            if ($user['admin'] == 5)
                echo 'Должность: <u><font color="green">Журналист</font></u></br>';
            echo 'Статус: ';
            if ($user['stat_forum_themes'] >= 0 && $user['stat_forum_themes'] <= 50)
                echo ' <u><font color="green">Новичок</font></u>';
            if ($user['stat_forum_themes'] >= 51 && $user['stat_forum_themes'] <= 100)
                echo ' <u><font color="green">Ученик</font></u>';
            if ($user['stat_forum_themes'] >= 101 && $user['stat_forum_themes'] <= 151)
                echo ' <u><font color="green">Знаток</font></u>';
            if ($user['stat_forum_themes'] >= 151 && $user['stat_forum_themes'] <= 201)
                echo ' <u><font color="green">Мастер</font></u>';
            if ($user['stat_forum_themes'] >= 201 && $user['stat_forum_themes'] <= 251)
                echo ' <u><font color="green">Гуру</font></u>';
            if ($user['stat_forum_themes'] >= 251 && $user['stat_forum_themes'] <= 300)
                echo ' <u><font color="green">Мудрец</font></u>';
            if ($user['stat_forum_themes'] >= 301)
                echo ' <u><font color="green">Высший разум</font></u>';
            echo '</br>';
            echo 'Тем в форуме: <b>' . $user['stat_forum_themes'] . '</b><br />';
            echo 'Сообщений в форуме: <b>' . $user['stat_forum_messages'] . '</b><br />';
            $rat = $user['rating'] / 100;
            echo 'Рейтинг: <font color="green">' . $rat . '</font>    <a href = "?id=' . $user['id'] . '&rat=1">(?)</a></br>';
            echo 'Время онлайн: ';
$time = $user['anketa_alltime'];
$chas=intval($time/3600);
if($chas>0){
$chas = $chas.' ч. ';
$time=$time-($chas*3600);
} else {
$chas = '';
}
$min=intval($time/60);
if($min>0){
$min = $min.' м.';
$time=$time-($min*60);
} else {
$min = '';
}
$sek = $time.' с.';
echo '<b>'.$chas.''.$min.' '.
$sek.'</b>';
            $count = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `users_ban_post` WHERE `user` = '" . $user['id'] . "'"), 0);
            if ($count > 0) {
                echo '</div>';
                echo '<div class="title">';
                echo '  <a href = "user_ban.php?id=' . $user['id'] . '">Нарушения</a> <font color="black">(<font color="black">' . $count . '</font>)</font> </br>';
                echo '</div>';
            }
            echo '</div>';
            if ($id == $u['id']) {
                echo '<div class="nav">';
                echo '<table><tr><td VALIGN=top>';
                echo page_ava($user['id'], 80);
                echo '</td><td VALIGN=top>';
                echo '<img src="style/page/edit.gif"> <a href="profile.php?act=hello"><u>Приветствие</u></a><br />';
                echo '<img src="style/page/photos.gif"> <a href = "/photo.php?act=add"><u>Изменить фото</u></a>';
                echo '</table></div>';
            }
            $anketa_name = checkout($user['anketa_name']);
            $anketa_bday = num($user['anketa_bday']);
            if ($u['id'] != $user['id']) {
                echo '<div class="nav">';
                echo '<table><tr><td VALIGN=top>';
                echo page_ava($user['id'], 80);
                echo '</td><td VALIGN=top>';
echo '<br/>';
                echo '' . $anketa_name . '<br />';
//~~~~~~~~~~~~~~~Высчитываю возвраст~~~~~~~~~~~~~~//
                $e = date("Y");
                $d = $user['anketa_byear'];
                $qwe = $e - $d;
                if ($qwe == $e) {
                    
                } else {
                    echo "$qwe лет";
                }
Echo '<br/>';
                echo '' . $user['anketa_city'] . '';
                echo '</table></div>';
            }
            $anketa_byear = num($user['anketa_byear']);
            $sex = checkout($user['sex']);
            $anketa_bmonth = checkout($user['anketa_bmonth']);
            $growth = checkout($user['growth']);
            $weight = checkout($user['weight']);
            $hair = checkout($user['hair']);
            $eyes = checkout($user['eyes']);
            $character = checkout($user['character']);
            $orientation = checkout($user['orientation']);
            $dating1 = checkout($user['dating1']);
            $dating2 = checkout($user['dating2']);
            $dating3 = checkout($user['dating3']);
            $dating4 = checkout($user['dating4']);
            $dating5 = checkout($user['dating5']);
            $dating6 = checkout($user['dating6']);
            $dating7 = checkout($user['dating7']);
            $dating8 = checkout($user['dating8']);
            $business = checkout($user['business']);
            $profession = checkout($user['profession']);
            $smoke = checkout($user['smoke']);
            $anketa_city = checkout($user['anketa_city']);
            $anketa_mphone = checkout($user['anketa_mphone']);
            $anketa_activity = checkout($user['anketa_activity']);
            $anketa_interests = checkout($user['anketa_interests']);
            $anketa_about = checkout($user['anketa_about']);
            if ($u['id'] == $user['id']) {
                echo '<div class="div">';
                if ($u['id'] == $user['id'])
                    echo '<a href = "/profile.php?act=name">';
                echo 'Имя: </a> ' . $anketa_name . '</div>';
                if ($u['id'] == $user['id'])
                    echo '<div class=div><a href = "/profile.php?act=city">';
                echo 'Город: </a> ' . $anketa_city . '</div>';
                if ($anketa_bmonth > 0) {
                    if ($anketa_bmonth == 1) {
                        $anketa_bmonth = 'Января';
                    } else {
                        if ($anketa_bmonth == 2) {
                            $anketa_bmonth = 'Февраля';
                        } else {
                            if ($anketa_bmonth == 3) {
                                $anketa_bmonth = 'Марта';
                            } else {
                                if ($anketa_bmonth == 4) {
                                    $anketa_bmonth = 'Апреля';
                                } else {
                                    if ($anketa_bmonth == 5) {
                                        $anketa_bmonth = 'Мая';
                                    } else {
                                        if ($anketa_bmonth == 6) {
                                            $anketa_bmonth = 'Июня';
                                        } else {
                                            if ($anketa_bmonth == 7) {
                                                $anketa_bmonth = 'Июля';
                                            } else {
                                                if ($anketa_bmonth == 8) {
                                                    $anketa_bmonth = 'Августа';
                                                } else {
                                                    if ($anketa_bmonth == 9) {
                                                        $anketa_bmonth = 'Сентября';
                                                    } else {
                                                        if ($anketa_bmonth == 10) {
                                                            $anketa_bmonth = 'Октября';
                                                        } else {
                                                            if ($anketa_bmonth == 11) {
                                                                $anketa_bmonth = 'Ноября';
                                                            } else {
                                                                if ($anketa_bmonth == 12) {
                                                                    $anketa_bmonth = 'Декабря';
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                } else {
                    $anketa_bmonth = '';
                }
                if ($anketa_bday == 0)
                    $anketa_bday = '';
                if ($anketa_byear == 0)
                    $anketa_byear = '';
                if ($u['id'] == $user['id'])
                    echo '<div class=div><a href = "/profile.php?act=bday">';
                echo 'День рождения: </a> ' . $anketa_bday . ' ' . $anketa_bmonth . ' ' . $anketa_byear . '</div>';
                if ($sex == 'm') {
                    if ($u['id'] == $user['id'])
                        echo '<div class=div><a href = "/profile.php?act=sex">';
                    echo 'Пол: </a> Мужской</div>';
                }
                if ($sex == 'zh') {
                    if ($u['id'] == $user['id'])
                        echo '<div class=div><a href = "/profile.php?act=sex">';
                    echo 'Пол: </a>Женский</div>';
                }
                if ($u['id'] == $user['id'])
                    echo '<div class=div><a href = "/profile.php?act=mphone">';
                echo 'Моб. телефон: </a>' . $anketa_mphone . '</div>';
                if ($u['id'] == $user['id'])
                    echo '<div class=div><a href = "/profile.php?act=about">';
                echo 'О себе: </a>' . smile(bb_code(links($anketa_about))) . '</div>';
                echo '</div><center><div class="nav"><b>Увлечения и интересы</b></div></center>';
                if ($u['id'] == $user['id'])
                    echo '<div class=div><a href = "/profile.php?act=interests">';
                echo 'Интересы: </a>' . $anketa_interests . '</div>';
                if ($u['id'] == $user['id'])
                    echo '<div class=div><a href = "/profile.php?act=business">';
                echo 'Чем я занимаюсь: </a>';
                if ($user['business'] == 0)
                    echo '</br>';
                if ($user['business'] == 1)
                    echo ' Учусь в школе</br>';
                if ($user['business'] == 2)
                    echo ' Учусь в колледже/лицее</br>';
                if ($user['business'] == 3)
                    echo ' Учусь в ВУЗе</br>';
                if ($user['business'] == 4)
                    echo ' Учусь в военном училище</br>';
                if ($user['business'] == 5)
                    echo ' Служу в армии</br>';
                if ($user['business'] == 6)
                    echo ' Работаю</br>';
                if ($user['business'] == 7)
                    echo ' Не работаю</br>';
                echo '</div><center><div class="nav"><b>Знакомства</b></div></center>';
                echo '<div class="div">';
                if ($u['id'] == $user['id'])
                    echo '<a href = "/profile.php?act=dating">';
                echo 'Цель знакомства: </a>';
                if ($user['dating1'] == 1)
                    echo 'Дружба и общение, </a>';
                if ($user['dating2'] == 1)
                    echo 'Флирт, СМС-переписка, </a>';
                if ($user['dating3'] == 1)
                    echo 'Любовь, отношения, </a>';
                if ($user['dating4'] == 1)
                    echo 'Брак, создание семьи, </a>';
                if ($user['dating5'] == 1)
                    echo 'Виртуальный секс, </a>';
                if ($user['dating6'] == 1)
                    echo 'Секс в реале, </a>';
                if ($user['dating7'] == 1)
                    echo 'Ищу спонсора, </a>';
                if ($user['dating8'] == 1)
                    echo 'Стану спонсором, </a>';
echo '</div>';
                if ($u['id'] == $user['id'])
                    echo '<div class="div"><a href = "/profile.php?act=orientation">';
                echo 'Ориентация: </a>';
                if ($user['orientation'] == 0)
                    echo '</div>';
                if ($user['orientation'] == 1)
                    echo ' Гетеро</div>';
                if ($user['orientation'] == 2)
                    echo ' Гей</div>';
                if ($user['orientation'] == 3)
                    echo ' Лесби</div>';
                if ($user['orientation'] == 4)
                    echo ' Би</div>';
                if ($u['id'] == $user['id'])
                    echo '<div class=div><a href = "/profile.php?act=family">';
                echo 'Семейное положение: </a>';
                if ($user['sex'] == 'zh') {
                    if ($user['family'] == 0)
                        echo ' </br>';
                    if ($user['family'] == 1)
                        echo ' Не замужем</br>';
                    if ($user['family'] == 2)
                        echo ' Есть друг</br>';
                    if ($user['family'] == 3)
                        echo ' Помолвлена</br>';
                    if ($user['family'] == 4)
                        echo ' Замужем</br>';
                    if ($user['family'] == 5)
                        echo ' Всё сложно</br>';
                    if ($user['family'] == 6)
                        echo ' В активном поиске</br>';
                } else {
                    if ($user['family'] == 0)
                        echo ' </br>';
                    if ($user['family'] == 1)
                        echo ' Не женат</br>';
                    if ($user['family'] == 2)
                        echo ' Есть подруга</br>';
                    if ($user['family'] == 3)
                        echo ' Помолвлен</br>';
                    if ($user['family'] == 4)
                        echo ' Женат</br>';
                    if ($user['family'] == 5)
                        echo ' Всё сложно</br>';
                    if ($user['family'] == 6)
                        echo ' В активном поиске</br>';
                }
                echo '</div><center><div class="nav"><b>Типаж</b></div></center>';
                echo '<div class="div">';
                if ($u['id'] == $user['id'])
                    echo '<a href = "/profile.php?act=character">';
                echo 'Характер: </a>' . $character . ' </div>';
                if ($u['id'] == $user['id'])
                    echo '<div class="div"><a href = "/profile.php?act=growth">';
                echo 'Рост: </a>' . $growth . ' см</div>';
                if ($u['id'] == $user['id'])
                    echo '<div class="div"><a href = "/profile.php?act=weight">';
                echo 'Вес: </a>' . $weight . ' кг</div>';
                if ($u['id'] == $user['id'])
                    echo '<div class="div"><a href = "/profile.php?act=hair">';
                echo 'Цвет волос: </a>' . $hair . ' </div>';
                if ($u['id'] == $user['id'])
                    echo '<div class="div"><a href = "/profile.php?act=eyes">';
                echo 'Цвет глаз: </a>' . $eyes . ' </div>';
                if ($u['id'] == $user['id'])
                    echo '<div class="div"><a href = "/profile.php?act=physique">';
                echo 'Телосложение:</a>';
                if ($user['physique'] == 0)
                    echo ' </br>';
                if ($user['physique'] == 1)
                    echo ' Обычное</br>';
                if ($user['physique'] == 2)
                    echo ' Худощавое</br>';
                if ($user['physique'] == 3)
                    echo ' Спортивное</br>';
                if ($user['physique'] == 4)
                    echo ' Мускулистое</br>';
                if ($user['physique'] == 5)
                    echo ' Плотное</br>';
                if ($user['physique'] == 6)
                    echo ' Полное</br>';
                echo '</div><center><div class="nav"><b>Дополнительно</b></div></center>';
                echo '<div class="div">';
                if ($u['id'] == $user['id'])
                    echo '<a href = "/profile.php?act=profession">';
                echo 'Профессия: </a>' . $profession . ' </div>';
                if ($u['id'] == $user['id']) {
                    echo '<div class="div"><a href = "/profile.php?act=smoke">';
                    echo 'Курю ли я: </a>';
                    if ($user['smoke'] == 0)
                        echo '</br>';
                    if ($user['smoke'] == 1)
                        echo ' Не курю</br>';
                    if ($user['smoke'] == 2)
                        echo ' Курю</br>';
                    if ($user['smoke'] == 3)
                        echo ' Иногда</br>';
                    if ($user['smoke'] == 4)
                        echo ' Бросаю</br>';
                }
                echo '</div>';
            }
            else {
                if ($anketa_bmonth > 0) {
                    if ($anketa_bmonth == 1) {
                        $anketa_bmonth = 'Января';
                    } else {
                        if ($anketa_bmonth == 2) {
                            $anketa_bmonth = 'Февраля';
                        } else {
                            if ($anketa_bmonth == 3) {
                                $anketa_bmonth = 'Марта';
                            } else {
                                if ($anketa_bmonth == 4) {
                                    $anketa_bmonth = 'Апреля';
                                } else {
                                    if ($anketa_bmonth == 5) {
                                        $anketa_bmonth = 'Мая';
                                    } else {
                                        if ($anketa_bmonth == 6) {
                                            $anketa_bmonth = 'Июня';
                                        } else {
                                            if ($anketa_bmonth == 7) {
                                                $anketa_bmonth = 'Июля';
                                            } else {
                                                if ($anketa_bmonth == 8) {
                                                    $anketa_bmonth = 'Августа';
                                                } else {
                                                    if ($anketa_bmonth == 9) {
                                                        $anketa_bmonth = 'Сентября';
                                                    } else {
                                                        if ($anketa_bmonth == 10) {
                                                            $anketa_bmonth = 'Октября';
                                                        } else {
                                                            if ($anketa_bmonth == 11) {
                                                                $anketa_bmonth = 'Ноября';
                                                            } else {
                                                                if ($anketa_bmonth == 12) {
                                                                    $anketa_bmonth = 'Декабря';
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                } else {
                    $anketa_bmonth = '';
                }
                if ($anketa_bday == 0)
                    $anketa_bday = '';
                if ($anketa_byear == 0)
                    $anketa_byear = '';
                if ($anketa_bday && $anketa_bmonth && $anketa_byear)
                    echo '<div class=div>День рождения: </a> ' . $anketa_bday . ' ' . $anketa_bmonth . ' ' . $anketa_byear . '</div>';
echo '</div>';
                if ($sex == 'm') {
                    echo '<div class=div>Пол: </a> Мужской</div>';
                }
                if ($sex == 'zh') {
                    echo '<div class=div>Пол: </a> Женский</div>';
                }
                if ($anketa_mphone)
                    echo '<div class=div>Моб. телефон: </a>' . $anketa_mphone . '</div>';
                if ($anketa_about)
                    echo '<div class=div>О себе: </a>' . smile(bb_code(links($anketa_about))) . '</div>';
                if ($anketa_interests || $user['business']) {
                    echo '</div><center><div class="nav"><b>Увлечения и интересы</b></div></center>';
                    if ($anketa_interests)
                        echo '<div class=div>Интересы: </a>' . $anketa_interests . '</div>';
                    if ($user['business']) {
                        echo '<div class=div>Чем я занимаюсь: </a>';
                        if ($user['business'] == 0)
                            echo '</br>';
                        if ($user['business'] == 1)
                            echo ' Учусь в школе</br>';
                        if ($user['business'] == 2)
                            echo ' Учусь в колледже/лицее</br>';
                        if ($user['business'] == 3)
                            echo ' Учусь в ВУЗе</br>';
                        if ($user['business'] == 4)
                            echo ' Учусь в военном училище</br>';
                        if ($user['business'] == 5)
                            echo ' Служу в армии</br>';
                        if ($user['business'] == 6)
                            echo ' Работаю</br>';
                        if ($user['business'] == 7)
                            echo ' Не работаю</br>';
                    }
                }
                if ($user['orientation'] || $user['dating1'] || $user['family']) {
                    echo '</div><center><div class="nav"><b>Знакомства</b></div></center>';
                    if ($user['orientation']) {
                        echo '<div class=div>Ориентация: </a>';
                        if ($user['orientation'] == 0)
                            echo '</div>';
                        if ($user['orientation'] == 1)
                            echo ' Гетеро</div>';
                        if ($user['orientation'] == 2)
                            echo ' Гей</div>';
                        if ($user['orientation'] == 3)
                            echo ' Лесби</div>';
                        if ($user['orientation'] == 4)
                            echo ' Би</div>';
                    }
                    if ($user['dating1']) {
                        echo '<div class=div>Цель знакомства: </a>';
                        if ($user['dating1'] == 1)
                            echo 'Дружба и общение, </a>';
                        if ($user['dating2'] == 1)
                            echo 'Флирт, СМС-переписка, </a>';
                        if ($user['dating3'] == 1)
                            echo 'Любовь, отношения, </a>';
                        if ($user['dating4'] == 1)
                            echo 'Брак, создание семьи, </a>';
                        if ($user['dating5'] == 1)
                            echo 'Виртуальный секс, </a>';
                        if ($user['dating6'] == 1)
                            echo 'Секс в реале, </a>';
                        if ($user['dating7'] == 1)
                            echo 'Ищу спонсора, </a>';
                        if ($user['dating8'] == 1)
                            echo 'Стану спонсором, </a>';
                        echo '</div>';
                    }
                    if ($user['family']) {
                        echo '<div class=div>Семейное положение: </a>';
                        if ($user['sex'] == 'zh') {
                            if ($user['family'] == 0)
                                echo ' </br>';
                            if ($user['family'] == 1)
                                echo ' Не замужем</br>';
                            if ($user['family'] == 2)
                                echo ' Есть друг</br>';
                            if ($user['family'] == 3)
                                echo ' Помолвлена</br>';
                            if ($user['family'] == 4)
                                echo ' Замужем</br>';
                            if ($user['family'] == 5)
                                echo ' Всё сложно</br>';
                            if ($user['family'] == 6)
                                echo ' В активном поиске</br>';
                        } else {
                            if ($user['family'] == 0)
                                echo ' </br>';
                            if ($user['family'] == 1)
                                echo ' Не женат</br>';
                            if ($user['family'] == 2)
                                echo ' Есть подруга</br>';
                            if ($user['family'] == 3)
                                echo ' Помолвлен</br>';
                            if ($user['family'] == 4)
                                echo ' Женат</br>';
                            if ($user['family'] == 5)
                                echo ' Всё сложно</br>';
                            if ($user['family'] == 6)
                                echo ' В активном поиске</br>';
                        }
                    }
                }
                if ($character || $growth || $weight || $hair || $eyes || $user['physique']) {
                    echo '</div><center><div class="nav"><b>Типаж</b></div></center>';
                    if ($character)
                        echo '<div class=div>Характер: </a>' . $character . ' </div>';
                    if ($growth)
                        echo '<div class=div>Рост: </a>' . $growth . ' см</div>';
                    if ($weight)
                        echo '<div class=div>Вес: </a>' . $weight . ' кг</div>';
                    if ($hair)
                        echo '<div class=div>Цвет волос: </a>' . $hair . ' </div>';
                    if ($eyes)
                        echo '<div class=div>Цвет глаз: </a>' . $eyes . ' </div>';
                    if ($user['physique']) {
                        echo '<div class=div>Телосложение: </a>';
                        if ($user['physique'] == 0)
                            echo ' </br>';
                        if ($user['physique'] == 1)
                            echo ' Обычное</br>';
                        if ($user['physique'] == 2)
                            echo ' Худощавое</br>';
                        if ($user['physique'] == 3)
                            echo ' Спортивное</br>';
                        if ($user['physique'] == 4)
                            echo ' Мускулистое</br>';
                        if ($user['physique'] == 5)
                            echo ' Плотное</br>';
                        if ($user['physique'] == 6)
                            echo ' Полное</br>';
                    }
                }
                if ($profession || $user['smoke']) {
                    echo '</div><center><div class="nav"><b>Дополнительно</b></div></center>';
                    if ($profession)
                        echo '<div class=div>Профессия: </a>' . $profession . ' </div>';
                    if ($user['smoke']) {
                        echo '<div class=div>Курю ли я: </a>';
                        if ($user['smoke'] == 0)
                            echo '</div>';
                        if ($user['smoke'] == 1)
                            echo ' Не курю</div>';
                        if ($user['smoke'] == 2)
                            echo ' Курю</div>';
                        if ($user['smoke'] == 3)
                            echo ' Иногда</div>';
                        if ($user['smoke'] == 4)
                            echo ' Бросаю</div>';
                    }
                }
                echo '</div>';
            }
  if ($u['id'] =! $user['id']) {
                echo '<div class="nav">';
                echo '<img src="style/page/go_mail.png"> <a href = "mail.php?act=write&id=' . $user['id'] . '"><u>Написать сообщение</u></a><br/>';
                echo '<img src="style/page/go_gift.gif"> <a href = "gifts.php?iduser=' . $user['id'] . '"><u>Подарить подарок</u></a><br/>';
                $myfriend = mysql_num_rows(mysql_query("SELECT * FROM `friends` WHERE `user` = '" . $u['id'] . "' and friend = '" . $user['id'] . "' LIMIT 1"));
                if ($myfriend)
                    echo '<img src="style/page/delete.gif"> <a href = "friends.php?act=delete&id=' . $user['id'] . '"><u>Удалить из друзей</u></a><br/>';
                else
                    echo '<img src = "style/page/go_friend.gif"> <a href = "friends.php?act=adding&id=' . $user['id'] . '"><u>Добавить в друзья</u></a><br/>';
                if (!@$duel['id']) {
                    $req = mysql_query("SELECT * FROM `duels_list` WHERE (`user1` = '" . $u['id'] . "' or `user2` = '" . $u['id'] . "') and `time_end` > '" . time() . "' LIMIT 1");
                    if (!mysql_num_rows($req)) {
                        echo '<img src = "style/page/duels.gif"> <a href = "duels.php?act=add&id=' . $user['id'] . '"><u>Вызвать на дуэль</u></a></br>';
                    }
                }
                echo '</div>';
            }
            include ('foot.php');
            break;
    }
?>