<?
$corec = $_SERVER['DOCUMENT_ROOT'];
require_once $corec.'/sys/inc/core.php';

only_reg();
$set['title']='Настройки приватности';
require_once $corec.'/sys/inc/thead.php';
title();
$set = intval($_GET['set']);

err();
if($set == '7')
{
if (isset($_POST['save'])){
mysql_query("UPDATE `user` SET `stena_zapret` = '".intval($_POST['stena_zapret'])."' WHERE `id`='".$user['id']."'");
echo '<font color="green">Успешно!!!</font>';
}
echo "<form method='post' action='?$passgen'>\n";
echo "<div class='ankus'><i><b>Разрешить писать на моей стене:</b></i><br />\n";
echo "<name=\"stena_zapret\">\n";

echo "<input type=\"radio\" name=\"stena_zapret\" value=\"0\" ".($post['stena_zapret']==0?" selected='selected'":null).">Всем</input><br/>\n";
echo "<input type=\"radio\" name=\"stena_zapret\" value=\"1\" ".($post['stena_zapret']==1?" selected='selected'":null).">Только друзьям</input><br />\n";
echo "</div>";
} else if($set == '6')
{
if (isset($_POST['save'])){
mysql_query("UPDATE `user` SET `panel` = '".intval($_POST['panel'])."' WHERE `id`='".$user['id']."'");
echo '<font color="green">Успешно!!!</font>';
}
echo "<form method='post' action='set.php?set=6&$passgen'>\n";
echo "<div class='ankus'><i><b>Вид панели:</b></i><br />\n";
echo "<name=\"panel\">\n";
echo "<input type=\"radio\" name=\"panel\" value=\"0\" ".($post['panel']==0?" selected='selected'":null).">Графичная</input><br />\n";

echo "<input type=\"radio\" name=\"panel\" value=\"1\" ".($post['panel']==1?" selected='selected'":null).">Текст+графика</input><br />\n";

echo "<input type=\"radio\" name=\"panel\" value=\"3\" ".($post['panel']==3?" selected='selected'":null).">Тач</input><br />\n";
echo "<input type='submit' name='save' value='Сохранить' /></div>";
echo "</form>\n";
echo '</div>';
} else if($set == '5')
{
if (isset($_POST['save'])){
mysql_query("UPDATE `user` SET `v_forum` = '".intval($_POST['v_forum'])."' WHERE `id`='".$user['id']."'");
echo '<font color="green">Успешно!!!</font>';
}
echo "<form method='post' action='set.php?set=5&$passgen'>\n";
echo "<div class='ankus'><i><b>Выводить на главной последнею  тему форума:</b></i><br />\n";
echo "<name=\"v_forum\">\n";

echo "<input type=\"radio\" name=\"v_forum\" value=\"0\" ".($post['v_forum']==0?" selected='selected'":null).">Да</input><br/>\n";

echo "<input type=\"radio\" name=\"v_forum\" value=\"1\" ".($post['v_forum']==1?" selected='selected'":null).">Нет</input><br />\n";
echo "<input type='submit' name='save' value='Сохранить' /></div>";
echo "</form>\n";
echo '</div>';
} else if($set == '4')
{
if (isset($_POST['save'])){
mysql_query("UPDATE `zapret_gar` = '".intval($_POST['zapret_gar'])."' WHERE `id`='".$user['id']."'");
echo '<font color="green">Успешно!!!</font>';
}
echo "<form method='post' action='set.php?set=4&$passgen'>\n";
echo "<div class='ankus'><i><b>Разрешить меня воровать в гарем:</b></i><br />\n";
echo "<name=\"zapret_gar\">\n";

echo "<input type=\"radio\" name=\"zapret_gar\" value=\"0\" ".($post['zapret_gar']==0?" selected='selected'":null).">Да</input><br/>\n";

echo "<input type=\"radio\" name=\"zapret_gar\" value=\"1\" ".($post['zapret_gar']==1?" selected='selected'":null).">Нет</input><br />\n";
echo "<input type='submit' name='save' value='Сохранить' /></div>";
echo "</form>\n";
echo '</div>';
} else if($set == '3')
{
if (isset($_POST['save'])){
mysql_query("UPDATE `user` SET `brak_zapret` = '".intval($_POST['brak_zapret'])."' WHERE `id`='".$user['id']."'");
echo '<font color="green">Успешно!!!</font>';
}
echo "<form method='post' action='set.php?set=3&$passgen'>\n";
echo "<div class='ankus'><i><b>Разрешить пользователям делать мне предложения бракосочетания:</b></i><br />\n";
echo "<name=\"brak_zapret\">\n";

echo "<input type=\"radio\" name=\"brak_zapret\" value=\"0\" ".($post['brak_zapret']==0?" selected='selected'":null).">Да</input><br/>\n";

echo "<input type=\"radio\" name=\"brak_zapret\" value=\"1\" ".($post['brak_zapret']==1?" selected='selected'":null).">Нет</input><br />\n";
echo "<input type='submit' name='save' value='Сохранить' /></div>";
echo "</form>\n";
echo '</div>';
} else if($set == '2')
{
if (isset($_POST['save'])){
mysql_query("UPDATE `user` SET `duel_zapret` = '".intval($_POST['duel_zapret'])."' WHERE `id`='".$user['id']."'");
echo '<font color="green">Успешно!!!</font>';
}
echo "<div class='ankus'><i><b>Разрешить вызывать меня на дуэль:</b></i><br />\n";
echo "<form method='post' action='set.php?set=2&$passgen'>\n";
echo "<name=\"duel_zapret\">\n";

echo "<input type=\"radio\" name=\"duel_zapret\" value=\"0\" ".($post['duel_zapret']==0?" selected='selected'":null).">Да</input><br/>\n";

echo "<input type=\"radio\" name=\"duel_zapret\" value=\"1\" ".($post['duel_zapret']==1?" selected='selected'":null).">Нет</input><br />\n";
echo "<input type='submit' name='save' value='Сохранить' /></div>";
echo "</form>\n";
echo '</div>';
} else if($set == '1')
{
if (isset($_POST['save'])){
mysql_query("UPDATE `user` SET `sticker` = '".intval($_POST['sticker'])."' WHERE `id`='".$user['id']."'");
echo '<font color="green">Успешно!!!</font>';
}
echo "<div class='ankus'><i><b>Разрешить дарить мне стикеры:</b></i><br />\n";
echo "<form method='post' action='set.php?set=1&$passgen'>\n";
echo "<name=\"sticker\">\n";

echo "<input type=\"radio\" name=\"sticker\" value=\"0\" ".($post['sticker']==0?" selected='selected'":null).">Да</input><br/>\n";

echo "<input type=\"radio\" name=\"sticker\" value=\"1\" ".($post['sticker']==1?" selected='selected'":null).">Нет</input><br />\n";
echo "<input type='submit' name='save' value='Сохранить' /></div>";
echo "</form>\n";
echo '</div>';
}else{
?>
<div class='ankus'>
*<a href='set.php?set=1'>Стикеры</a><br />
*<a href='set.php?set=2'>Дуэли</a><br />
*<a href='set.php?set=3'>Бракосочетания</a><br />
*<a href='set.php?set=4'>Гарем</a><br />
*<a href='set.php?set=5'>Форум</a><br />
*<a href='set.php?set=6'>Панель навигации</a><br />
*<a href='set.php?set=7'>Стена сообщений</a><br />
</div>
<?
}


require_once $corec.'/sys/inc/tfoot.php';
?>