<?php
//////////////////////////////////////////
// CHAT POWERED : http://sim-sim.h2m.ru//
// ICQ : 378036650                     //
// Email : olegarhi75@mail.ru          //
// WEB SITE Version 1.0 www.waufon.ru  //
////////////////////////////////////////
require( "../inc/conf.inc.php" );
require( "../inc/check.php" );
$login = autorize();
$loginn = $login['login'];
$q1 = mysql_query( "select id from letters where id_to='{$id}' and new=1 and del_in=0;" );
$in1 = mysql_num_rows( $q1 );
$q2 = mysql_query( "select id from letters where id_to='{$id}' and del_in=0;" );
$in2 = mysql_num_rows( $q2 );
echo "<title>Личное</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\">Здарова, <b>".$row['login']."</b>! Если буш идти на вечеринку в общественное место,то протестируйсо.</div>";



if(!isset($_POST['action']))
{
$file = file("configs.dat");
$registration = intval($file[0]);
$adv = intval($file[1]);
$computer = intval($file[2]);
echo "<div class=\"form\">\n";
echo "<form method=\"post\" action=\"admin.php?nocache=$nocache&amp;ver=html&amp;id=$id&amp;password=$password&amp;mod=settings\">\n";
echo "Регистрация:<br/>\n";
echo "<select name=\"registration\">\n";
if($registration == 1)
{
echo "<option value=\"1\" selected=\"selected\">Включена</option>\n";
echo "<option value=\"0\">Выключена</option>\n";
}
else
{
echo "<option value=\"1\">Включена</option>\n";
echo "<option value=\"0\" selected=\"selected\">Выключена</option>\n";
}
echo "</select><br/>\n";
echo "Антиреклама:<br/>\n";
echo "<select name=\"adv\">\n";
if($adv == 1)
{
echo "<option value=\"1\" selected=\"selected\">Включена</option>\n";
echo "<option value=\"0\">Выключена</option>\n";
}
else
{
echo "<option value=\"1\">Включена</option>\n";
echo "<option value=\"0\" selected=\"selected\">Выключена</option>\n";
}
echo "</select><br/>\n";
echo "Защита от компьютеров:<br/>\n";
echo "<select name=\"computer\">\n";
if($computer == 1)
{
echo "<option value=\"1\" selected=\"selected\">Включена</option>\n";
echo "<option value=\"0\">Выключена</option>\n";
}
else
{
echo "<option value=\"1\">Включена</option>\n";
echo "<option value=\"0\" selected=\"selected\">Выключена</option>\n";
}
echo "</select><br/>\n";
echo "<input type=\"hidden\" name=\"action\" value=\"save\"/>\n";
echo "<input type=\"submit\" value=\"Сохранить\"/></form></div><br/>\n";
}
else
{
$registration = intval($_POST['registration']);
$adv = intval($_POST['adv']);
$computer = intval($_POST['computer']);

$file = fopen("configs.dat", "w");
$data = "$registration\n";
$data .= "$adv\n";
$data .= "$computer\n";
fwrite($file, $data);
fclose($file);

echo "Настройки успешно сохранены!<br/>\n";
}
?>