<?php
//*********************/
//Скрипт переписан админом
//http://sim-sim.h2m.ru  Кот
//Помогал админ
//http://pfc.h2m.ru/ КОСМОС
//всю эту срань господнюю
//перехуяривали на дыры
//Nitrix http://waufon.ru
/*********************/
require( "../inc/conf.inc.php" );
require( "../inc/check.php" );
$login = autorize();
$sound =  $login['sound'] ;
$loginn = $login['login'];
if ( empty( $do ) )
{
echo "<title>Setup</title>\r\n<style type=\"text/css\">\r\nbody { font-size: {$fs}; color: {$tcol}; background-color: {$bcol} }\r\na:link,a:visited { text-decoration: underline; color: {$lcol} }\r\ndiv { background-color: {$rcol} }\r\n.cp \t{ border-style:solid; border-width: 0px; color: {$lcol} ; background-color: {$bcol}; text-align: left }\r\n</style>\r\n</head>\r\n<body>\r\n";
if($sound=="1")
{
echo "<!--h--><!--h--><a><bgsound src=\"../sound/prikaz.wav\"></br>";
}
echo"<div align=\"center\">Настройки</div>\r\n";
echo"<form method=\"post\" action=\"setup.php\">\r\n";
echo"Количество сообщений на страницу:<br/>\r\n";
echo"<input name=\"num_msgs\" maxlength=\"3\" value=\"".$row['num_msgs']."\"/>\r\n<br/>\r\n";
echo"Время до обновления в секундах:<br/>\r\n";
echo"<input name=\"time_update\" maxlength=\"3\" value=\"".$row['time_update']."\"/>\r\n<br/>\r\n";
echo"Система безопасности::<br/>\r\n<select name=\"safe\" title=\"Safe\">";
if ( empty( $row['safe'] ) )
{
echo "\r\n<option value=\"0\">Off</option>\r\n<option value=\"1\">On</option>";
}
else
{
echo "\r\n<option value=\"1\">On</option>\r\n<option value=\"0\">Off</option>";
}
#########эмоции##########
echo "\r\n</select><br/>\r\nЭмоции:<br/>\r\n<select name=\"em\" title=\"em\">";
if ( empty( $row['em'] ) )
{
echo "\r\n<option value=\"0\">Off</option>\r\n<option value=\"1\">On</option>";
}
else 
{
echo "\r\n<option value=\"1\">On</option>\r\n<option value=\"0\">Off</option>";
}
echo "\r\n</select><br/>\r\n";
#####################################*/
############цвет сообщений###########
echo "\r\n</select>\r\n Цвет сообщений:<br/>\r\n<select name=\"mcol\" title=\"mcol\">";
if ( empty( $row['mcol'] ) )
{
echo "\r\n<option value=\"0\">Off</option>\r\n<option value=\"1\">On</option>";
}
else {echo "\r\n<option value=\"1\">On</option>\r\n<option value=\"0\">Off</option>";
}
echo "\r\n</select><br/>\r\n";
#####################################*/
##########приветствия#############
echo"Автоприветствие при входе:<br/>\r\n<select name=\"autohello\" title=\"автоприветствие\">";
if ( empty( $row['autohello'] ) )
{
echo "\r\n<option value=\"1\">On</option>\r\n<option value=\"0\">Off</option>";
}
else
{
echo "\r\n<option value=\"0\">Off</option>\r\n<option value=\"1\">On</option>";
}
echo "\r\n</select><br/>\r\n";
echo"Приветствие бота:<br/>\r\n<select name=\"bothello\" title=\"bothello\">";
if ( empty( $row['bothello'] ) )
{
echo "\r\n<option value=\"1\">On</option>\r\n<option value=\"0\">Off</option>";
}
else
{
echo "\r\n<option value=\"0\">Off</option>\r\n<option value=\"1\">On</option>";
}
echo "\r\n</select><br/>\r\n";
#######################
#####выделение#####
echo "\r\n</select>\r\nВЫДЕЛЕНИЕ:<br/>\r\n<select name=\"vyd\" title=\"vyd\">";
if ( empty( $row['vyd'] ) )
{echo "\r\n<option value=\"0\">Off</option>\r\n<option value=\"1\">On</option>";}
else {echo "\r\n<option value=\"1\">On</option>\r\n<option value=\"0\">Off</option>";}
echo "\r\n</select><br/>\r\n";
##################*/
#####просмотр приватов#####
if ( 7 < $row['level'])
{
echo "Просмотр приватов:<br/>\r\n<select name=\"priv\" title=\"priv\">"; 
if (empty( $row['priv'] ))
 {
echo "\r\n<option value =\"0\">Off</option>\r\n<option value=\"1\">On</option>";
}
else
{
echo "\r\n<option value=\"1\">On</option>\r\n<option value =\"0\">Off</option>";
}
}
############################*/
echo "\r\n</select><br/>\r\nТранслит:<br/>\r\n<select name=\"trans\" title=\"Translit\">";
if ( empty( $row['trans'] ) )
{
echo "\r\n<option value=\"0\">Off</option>\r\n<option value=\"1\">On</option>";
}
else
{
echo "\r\n<option value=\"1\">On</option>\r\n<option value=\"0\">Off</option>";
}
echo "\r\n</select><br/>\r\n";

echo "Размер шрифта:<br/>\r\n<select name=\"fsize\" title=\"Font\">";
if ( empty( $row['fsize'] ) )
{
echo "\r\n<option value=\"0\">Мелкий</option>\r\n<option value=\"1\">Нормальный</option>";
}
else
{
echo "\r\n<option value=\"1\">Нормальный</option>\r\n<option value=\"0\">Мелкий</option>";
}
echo "\r\n</select><br/>\r\n";
if ( 8 < $row['level'])
{
echo "Невидимка:<br/>\r\n<select name=\"prizrak\" title=\"Font\">";
if ( empty( $row['prizrak'] ) )
{
echo "\r\n<option value=\"0\">Отключено</option>\r\n<option value=\"1\">Включено</option>";
}
else
{
echo "\r\n<option value=\"1\">Включено</option>\r\n<option value=\"0\">Отключено</option>";
}
echo "\r\n</select>\r\n";
}
#####выделение#####
echo "\r\n<br/></select>\r\nЗвуковые эфекты:<br/>\r\n<select name=\"sound\" title=\"sound\">";
if ( empty( $row['sound'] ) )
{echo "\r\n<option value=\"0\">Off</option>\r\n<option value=\"1\">On</option>";}
else {echo "\r\n<option value=\"1\">On</option>\r\n<option value=\"0\">Off</option>";}
echo "\r\n</select><br/>\r\n";
##################*/
//////////
echo "\r\n</select><br/>\r\n<input type=\"hidden\" name=\"do\" value=\"upd\"/>\r\n<input type=\"hidden\" name=\"id\" value=\"{$id}\"/>\r\n<input type=\"hidden\" name=\"pass\" value=\"{$pass}\"/> \r\n<input type=\"hidden\" name=\"rm\" value=\"{$rm}\"/> \r\n<input value=\"Сохранить\" type=\"submit\" class=\"cp\">\r\n</form>";
}
else
{
$num_msgs = intval( $num_msgs );
$time_update = intval( $time_update );
if ( empty( $num_msgs ) )
{
$num_msgs = 5;
}
if ( empty( $time_update ) )
{
$time_update = 300;
}
$safe = intval( $safe );
$trans = intval( $trans );
$em = intval( $em );
$vyd = intval( $vyd );
$sound = intval( $sound );
$priv = intval( $priv );
$smile = intval( $smile );
$fsize = intval( $fsize );
$prizrak = intval( $prizrak );
$mcol = intval( $mcol );
$inv = intval($inv);
$autohello = intval($autohello);
$bothello = intval($bothello);
if ( @mysql_query( "update users set num_msgs='".$num_msgs."', time_update='".$time_update."', trans='".$trans."', safe='".$safe."', fsize='".$fsize."', inv='".$inv."', vyd='".$vyd."', priv='".$priv."', autohello='".$autohello."', bothello='".$bothello."', em='".$em."', prizrak='".$prizrak."', mcol='".$mcol."' , sound='".$sound."' where id='".$id."';" ) )
{
$msg = "Ваш профиль изменен!";
}
else
{
$msg = "Ошибка...";
}
echo "\r\n<meta http-equiv=\"refresh\" content=\"1;URL=./index.php?id={$id}&amp;pass={$pass}\"/>\r\n<title>Reload...</title>\r\n<style type=\"text/css\">\r\nbody { font-size: {$fs}; color: {$tcol}; background-color: {$bcol} }\r\na:link,a:visited { text-decoration: underline; color: {$lcol} }\r\ndiv { background-color: {$rcol} }\r\n</style>\r\n</head>\r\n<body>\r\n<div align=\"center\">{$msg}</div>";
}
print "<a href=\"index.php?id={$id}&amp;pass={$pass}\">Личное</a><br/>\r\n<a href=\"../enter.php?id={$id}&amp;pass={$pass}\">Прихожая</a><br/>";
$end = gettime( );
echo "<p>{$ip}</p>";
echo "<p align=\"center\">\r\n[".round( $end - $mystart, 5 )."]\r\n</p></body></html>";
require("../inc/coper.php");
mysql_close( $link );
?>