<?
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['centr_vnimania']) && ($_POST['centr_vnimania']==1 || $_POST['centr_vnimania']==0))
{
if($user['balls']<5000){echo '<div class="foot"><b>У Вас не хватает LM (Xhata Money)</b></div>';
}
else
{
mysql_query("UPDATE `user` SET `balls` = '".($user['balls']-5000)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `date_last` = '".(time()-12)."' WHERE `id` = '$user[id]' LIMIT 1");
$user['centr_vnimania']=intval($_POST['centr_vnimania']);
mysql_query("UPDATE `user` SET `centr_vnimania` = '$user[centr_vnimania]' WHERE `id` = '$user[id]' LIMIT 1");
if (!isset($err))msg('Изменения успешно приняты');
}
}
else $err='Ошибка показа страницы в знакомствах';

}

err();

echo "<form method='post' action='?$passgen'>\n";
echo "<div class='menu_razd'>";
echo "Показывать мою страничку в 5-ке знакомств<br />\n<select name='centr_vnimania'>\n";
echo "<option value='1'".($user['centr_vnimania']==1?" selected='selected'":null).">Нет</option>\n";
echo "<option value='0'".($user['centr_vnimania']==0?" selected='selected'":null).">Да</option>\n";
echo "</select><br />\n";
echo "<input type='submit' name='save' value='Сохранить' />\n";
echo "</form>\n";
echo "</div>\n";
echo "<div class='rekl'>";
echo "<img src='/style/back.gif' alt='' class='icon'/>\n";
echo " <a href='/love/'>Знакомства</a> <br/>\n";
echo "</div>\n";
include_once '../sys/inc/tfoot.php';
?>