<?php
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/adm_check.php';
include_once '../sys/inc/user.php';
user_access('adm_panel_show',null,'/index.php?'.SID);
include_once 'system.php';
$set['title']='System settings for '.$systems_bleik.'';
include_once '../sys/inc/thead.php';
title();
?>
<link rel="stylesheet" href="style.css" type="text/css" />
<?
/*
=============================
Автор: Shamsik
=============================
Модуль: Защита для админской части
=============================
*/
if (isset($_POST['save'])){

if(isset($_POST['text'])) {$text = $_POST['text'];}

if(isset($_POST['text1'])) {$text1 = $_POST['text1'];}
mysql_query("UPDATE edittext SET text='$text' WHERE id=1");
mysql_query("UPDATE edittext SET text1='$text1' WHERE id=1");

if($_POST['pocazbleik'])
{
$pocazbleik =$_POST['pocazbleik'];
}

if (isset($_POST['pocazbleik']) && $_POST['pocazbleik']==1)
{
$user['pocazbleik']=1;
mysql_query("UPDATE `user` SET `pocazbleik` = '1'");
}
else
{
$user['pocazbleik']=0;
mysql_query("UPDATE `user` SET `pocazbleik` = '0' ");
}
if($_POST['pocazspam'])
{
$pocazspam =$_POST['pocazspam'];
}


if (isset($_POST['pocazspam']) && $_POST['pocazspam']==1)
{
$user['pocazspam']=1;
mysql_query("UPDATE `user` SET `pocazspam` = '1'");
}
else
{
$user['pocazspam']=0;
mysql_query("UPDATE `user` SET `pocazspam` = '0'");
}
if($_POST['pocazspamadm'])
{
$pocazspam =$_POST['pocazspamadm'];
}


if (isset($_POST['pocazspamadm']) && $_POST['pocazspamadm']==1)
{
$user['pocazspamadm']=1;
mysql_query("UPDATE `user` SET `pocazspamadm` = '1'");
}
else
{
$user['pocazspam']=0;
mysql_query("UPDATE `user` SET `pocazspamadm` = '0'");
}


msg("Настройки успешно сохраннены");
}
err();
aut();

$gibleik = mysql_query("SELECT * FROM edittext 	WHERE id=1");
$gigbleik = mysql_fetch_array($gibleik);

$bleik1 = mysql_query("SELECT * FROM adm_pass");
$bleik = mysql_fetch_array($bleik1);
if($user['pocazbleik'] == 1)
{
if (user_access('adm_panel_show'))echo "<div class='foot'>Your username: <b>$bleik[user]</b><font color='fff'>|</font> Your password: <b>$bleik[pass]</b></div>\n";
}
echo '<div class="menu_razd">For admin</div>';
echo "<form method='post' action='?$passgen'>\n";
echo '<div class="posts">';
echo "<label><input type='checkbox' name='pocazbleik'".($user['pocazbleik']==1?' checked="checked"':null)." value='1' /> Show username and password admin</label><br />\n";
echo "<label><input type='checkbox' name='pocazspam'".($user['pocazspam']==1?' checked="checked"':null)." value='1' /> Notice to Users</label><br />\n";//Уведомление пользователя
echo "<label><input type='checkbox' name='pocazspamadm'".($user['pocazspamadm']==1?' checked="checked"':null)." value='1' /> Notice to the administrator</label><br />\n";//Уведомления админа
echo '<div class="menu_razd">Lyrics for notifications as spam</div>';
echo 'The text for the administrator to alert:<br/><input size=30 type="text" name="text" value="'.$gigbleik['text'].'"><br/>';
echo 'The text for the user to be notified<br/><input size=30 type="text" name="text1" value="'.$gigbleik['text1'].'">';
echo '</div>';
echo '<hr/>';
echo "<input type='submit' name='save' value='apply' />\n";
echo '<hr/>';
echo '</form>';
linbSAleik();
echo '<div class="foot">Create a username and password to protect your admins part</div>';
include_once '../sys/inc/tfoot.php';
?>