Файл: sempol.php
Строк: 133
<?
include_once 'sys/inc/start.php';
include_once 'sys/inc/compress.php';
include_once 'sys/inc/sess.php';
include_once 'sys/inc/home.php';
include_once 'sys/inc/settings.php';
include_once 'sys/inc/db_connect.php';
include_once 'sys/inc/ipua.php';
include_once 'sys/inc/fnc.php';
include_once 'sys/inc/user.php';
only_reg();
$set['title']='Выбор семейного положения';
include_once 'sys/inc/thead.php';
title();
if (isset($_POST['save'])){
if (isset($_POST['sem_poloj']) && ($_POST['sem_poloj']==0 || $_POST['sem_poloj']==1 || $_POST['sem_poloj']==2 || $_POST['sem_poloj']==3 || $_POST['sem_poloj']==4 || $_POST['sem_poloj']==5 || $_POST['sem_poloj']==6 || $_POST['sem_poloj']==7|| $_POST['sem_poloj']==8))
{
$user['sem_poloj']=intval($_POST['sem_poloj']);
mysql_query("UPDATE `user` SET `sem_poloj` = '$user[sem_poloj]' WHERE `id` = '$user[id]' LIMIT 1");
}else $err[]='Ошибка в поле "Семейное положение"';
if (!isset($err))msg('Изменения успешно приняты');
}
err();
aut();
echo "<form method='post' action='?$passgen'>n";
if ($user['pol']==1) {
echo "<form method='post' action='?$passgen'>n";
echo "Семейное положение:<br />n<select name='sem_poloj'>n";
echo "<option value='0'".($user['sem_poloj']==0?" selected='selected'":null).">= |</option>n";
echo "<option value='1'".($user['sem_poloj']==1?" selected='selected'":null).">Не женат</option>n";
echo "<option value='2'".($user['sem_poloj']==2?" selected='selected'":null).">Есть подруга</option>n";
echo "<option value='3'".($user['sem_poloj']==3?" selected='selected'":null).">Встречаюсь</option>n";
echo "<option value='4'".($user['sem_poloj']==4?" selected='selected'":null).">Женат</option>n";
echo "<option value='5'".($user['sem_poloj']==5?" selected='selected'":null).">Влюблен</option>n";
echo "<option value='6'".($user['sem_poloj']==6?" selected='selected'":null).">Все сложно</option>n";
echo "<option value='7'".($user['sem_poloj']==7?" selected='selected'":null).">В активном поиске</option>n";
echo "<option value='8'".($user['sem_poloj']==8?" selected='selected'":null).">Сам по себе</option>n";
echo "</select><br />n";
} else {
echo "<form method='post' action='?$passgen'>n";
echo "Семейное положение:<br />n<select name='sem_poloj'>n";
echo "<option value='0'".($user['sem_poloj']==0?" selected='selected'":null).">= |</option>n";
echo "<option value='1'".($user['sem_poloj']==1?" selected='selected'":null).">Не Замужем</option>n";
echo "<option value='2'".($user['sem_poloj']==2?" selected='selected'":null).">Есть друг</option>n";
echo "<option value='3'".($user['sem_poloj']==3?" selected='selected'":null)."Встречаюсь</option>n";
echo "<option value='4'".($user['sem_poloj']==4?" selected='selected'":null).">Замужем</option>n";
echo "<option value='5'".($user['sem_poloj']==5?" selected='selected'":null).">Влюблена</option>n";
echo "<option value='6'".($user['sem_poloj']==6?" selected='selected'":null).">Все сложно</option>n";
echo "<option value='7'".($user['sem_poloj']==7?" selected='selected'":null).">В активном поиске</option>n";
echo "<option value='8'".($user['sem_poloj']==8?" selected='selected'":null).">Сама по себе</option>n";
echo "</select><br />n";
}
echo "<input type='submit' name='save' value='Сохранить' />n";
echo "</form>n";
include_once 'sys/inc/tfoot.php';
?>