Файл: archive_01122016_1136/public_html/admin/bann.php
Строк: 155
<?php
$b = "b";
if($_GET['mode']==$b)
{
include ("../conf.php");
include ("../lock.php");
if ($user == $myrow["user"] && $pass == $myrow["pass"] && $user != '')
{
if($user == $adname){
include ("../head.php");
echo "<link rel='stylesheet' type='text/css' href='../style.css'/>";
echo "<a href=bann.php?mode=add&user=$user&pass=$pass>Забанить</a>";
echo "<a href=bann.php?mode=del&user=$user&pass=$pass>Разбан юзарей</a>";
echo "<a href=../menu.php?user=$user&pass=$pass>В меню</a>";
include ("../foot.php");
exit();
}
}
else
{
include ("../head.php");
echo "Ошибка! <br />Неверный <b>Ник</b> или <b>Пароль</b>!<br />";
echo <<<sss
<a href="../index.php">На главную</a>
sss;
}
}
$add = "add";
if($_GET['mode']==$add)
{
include ("../conf.php");
include ("../lock.php");
if ($user == $myrow["user"] && $pass == $myrow["pass"] && $user != '')
{
if($user == $adname){
include ("../head.php");
echo "<link rel='stylesheet' type='text/css' href='../style.css'/>";
echo "<div class='nav'>";
echo "<form action='bann.php?mode=s&user=$user&pass=$pass' method='post'>";
echo 'Ник: <br />
<input type="text" name="user_nick"><br>
Забанить на:<br>
<input type="text" name="time" value="1"><br>
<select name="type">
<option value="60">минут</option>
<option value="3600">часов</option>
<option value="86400">суток</option>
<option value="604800" checked>недель</option>
</select>
<br><input type="submit" value="Забанить"></form>';
echo "</div>";
echo "<a href=../menu.php?user=$user&pass=$pass>В меню</a>";
include ("../foot.php");
exit();
}
}
else
{
include ("../head.php");
echo "Ошибка! <br />Неверный <b>Ник</b> или <b>Пароль</b>!<br />";
echo <<<sss
<a href="../index.php">На главную</a>
sss;
}
}
$s = "s";
if($_GET['mode']==$s)
{
include ("../conf.php");
include ("../lock.php");
if ($user == $myrow["user"] && $pass == $myrow["pass"] && $user != '')
{
if($user == $adname){
include ("../head.php");
echo "<link rel='stylesheet' type='text/css' href='../style.css'/>";
if (isset($_POST['user_nick'])) {$user_nick = $_POST['user_nick']; if ($user_nick == '') {unset($user_nick);} }
if (isset($user_nick))
{
$t=time()+intval($_POST['type'])*intval($_POST['time']);
$result3 = mysql_query("INSERT INTO bann (`user_nick`,`time`) VALUES('".$user_nick."',$t)");
if ($result3 == 'true')
{
echo "<link rel='stylesheet' type='text/css' href='../style.css'/>";
echo "<div class='nav'>";
echo "Юзер забанен!<br /></div>";
echo "<a href=../menu.php?user=$user&pass=$pass>В меню</a>";
include ("../foot.php");
exit();
}
else
{
echo "<link rel='stylesheet' type='text/css' href='../style.css'/>";
echo "<div class='nav'>";
echo "Юзер не забанен!<br /></div>";
echo "<a href=../menu.php?user=$user&pass=$pass>В меню</a>";
include ("../foot.php");
exit();
}
}
else
{
echo "<link rel='stylesheet' type='text/css' href='../style.css'/>";
echo "<div class='nav'>";
echo "Вы ввели не всю информацию.<br /></div>";
echo "<a href=../menu.php?user=$user&pass=$pass>В меню</a>";
include ("../foot.php");
exit();
}
}
}
else
{
include ("../head.php");
echo "Ошибка! <br />Неверный <b>Ник</b> или <b>Пароль</b>!<br />";
echo <<<sss
<a href="../index.php">На главную</a>
sss;
}
}
$del = "del";
if($_GET['mode']==$del)
{
include ("../conf.php");
include ("../lock.php");
if ($user == $myrow["user"] && $pass == $myrow["pass"] && $user != '')
{
if($user == $adname){
include ("../head.php");
echo "<link rel='stylesheet' type='text/css' href='../style.css'/>";
echo <<<sss
<form name="" action="bann.php?mode=drop&user=$user&pass=$pass" method="post">
sss;
$result = mysql_query("SELECT * FROM bann");
$myrow = mysql_fetch_array($result);
do
{
echo "<link rel='stylesheet' type='text/css' href='../style.css'/>";
echo "<div class='nav'>";
echo " <input name='id' type='radio' value='".$myrow['id']." '>";
echo " ".$myrow['user_nick']." <br /></div>";
}
while ($myrow = mysql_fetch_array($result));
echo <<< sss
<div class='nav'>
<input type="submit" value="Разбанить"></form></div>
<a href=../menu.php?user=$user&pass=$pass>В меню</a>
sss;
include ("../foot.php");
}
}
else
{
include ("../head.php");
echo "Ошибка! <br />Неверный <b>Ник</b> или <b>Пароль</b>!<br />";
echo <<<sss
<a href="../index.php">На главную</a>
sss;
}
}
$drop = "drop";
if($_GET['mode']==$drop)
{
include ("../conf.php");
include ("../lock.php");
if ($user == $myrow["user"] && $pass == $myrow["pass"] && $user != '')
{
if($user == $adname){
if (isset($_POST['id'])) {$id = intval($_POST['id']);}
if (isset($id))
{
$result = mysql_query("DELETE FROM bann WHERE id='".$id."'");
if ($result == 'true') {
include ("../head.php");
echo "<link rel='stylesheet' type='text/css' href='../style.css'/>";
echo "<div class='nav'>";
echo "Юзер разбанен!</div>";
echo <<< sss
<a href=../menu.php?user=$user&pass=$pass>В меню</a>
sss;
include ("../foot.php");
}
else {
include ("../head.php");
echo "<link rel='stylesheet' type='text/css' href='../style.css'/>";
echo "<div class='nav'>";
echo "Юзер не разбанен!";
echo <<< sss
<a href=../menu.php?user=$user&pass=$pass>В меню</a>
sss;
include ("../foot.php");
}
}
else
{
echo "<p>Ошибка!!!</p>";
}
}
}
else
{
include ("../head.php");
echo "Ошибка! <br />Неверный <b>Ник</b> или <b>Пароль</b>!<br />";
echo <<<sss
<a href="../index.php">На главную</a>
sss;
include ("../foot.php");
}
}
$add2 = "add2";
if($_GET['mode']==$add2)
{
include ("../conf.php");
include ("../lock.php");
if ($user == $myrow["user"] && $pass == $myrow["pass"] && $user != '')
{
if($user == $adname){
include ("../head.php");
echo "<link rel='stylesheet' type='text/css' href='../style.css'/>";
$user_nick = mysql_real_escape_string(trim($_GET['user_nick']));
echo "<div class='nav'>";
echo "<form action='bann.php?mode=s&user=$user&pass=$pass' method='post'>";
echo "Ник: ".$user_nick."<br /><input name='user_nick' type='hidden' value='".$user_nick."'>";
echo 'Забанить на:<br>
<input type="text" name="time" value="1"><br>
<select name="type">
<option value="60">минут</option>
<option value="3600">часов</option>
<option value="86400">суток</option>
<option value="604800" checked>недель</option>
</select>
<br><input type="submit" value="Забанить"></form>';
echo "</div>";
echo "<a href=../menu.php?user=$user&pass=$pass>В меню</a>";
include ("../foot.php");
exit();
}
}
else
{
include ("../head.php");
echo "Ошибка! <br />Неверный <b>Ник</b> или <b>Пароль</b>!<br />";
echo <<<sss
<a href="../index.php">На главную</a>
sss;
}
}
?>