Просмотр файла admin/user.php

Размер файла: 3.5Kb
<?php
####################
# Автор: [Svig]    #
# ICQ: 563000172   #
####################

$add = "add";
if($_GET['mode']==$add)
{

include ("../conf.php");
include ("../lock.php");

if ($user == $myrow["user"] && $pass == $myrow["pass"])
{
if($user == $adname){

include ("../head.php");
echo "<link rel='stylesheet' type='text/css' href='../style.css'/>";
echo <<< sss
<div class='nav'><form name="form" action="user.php?mode=user&user=$user&pass=$pass" method="post">
Ник юзера:<br />
<input name="user_name" type="text" value=""><br />
<input type="submit" value="Ok">
</form></div>
sss;
echo "<div class='nav'>• <a href=../menu.php?user=$user&pass=$pass>В меню</a></div>";
include ("../foot.php");
exit();

}
}
else
{
include ("../head.php");
echo "<link rel='stylesheet' type='text/css' href='../style.css'/>";
echo "Ошибка! <br />Неверный <b>Ник</b> или <b>Пароль</b>!<br />";
echo <<<sss
<a href="../index.php">На главную</a>
sss;
include ("../foot.php");
}
}


$user = "user";
if($_GET['mode']==$user)
{

include ("../conf.php");
include ("../lock.php");

if ($user == $myrow["user"] && $pass == $myrow["pass"])
{
if($user == $adname){

$user_name = mysql_real_escape_string(trim($_POST['user_name']));

$result = mysql_query("SELECT * FROM userlist WHERE user='".$user_name."'");
$myrow = mysql_fetch_array($result);


include ("../head.php");
echo "<link rel='stylesheet' type='text/css' href='../style.css'/>";
echo "<div class='nav'>";
echo "Ник: ".$myrow['user']."<br />ID: ".$myrow['id']."<br />Пароль: ".$myrow['pass']."";
echo "<form name='' action='user.php?mode=del&user=$user&pass=$pass' method='post'>";
echo "<input name='id' type='hidden' value='".$myrow['id']."'>";
echo "<input type='submit' value='Удалить юзера'></form></div>";

echo "<div class='nav'>• <a href=../menu.php?user=$user&pass=$pass>В меню</a></div>";
include ("../foot.php");
exit();

}
}
else
{
include ("../head.php");
echo "<link rel='stylesheet' type='text/css' href='../style.css'/>";
echo "Ошибка! <br />Неверный <b>Ник</b> или <b>Пароль</b>!<br />";
echo <<<sss
<a href="../index.php">На главную</a>
sss;
include ("../foot.php");
}
}


$del = "del";
if($_GET['mode']==$del)
{

include ("../conf.php");
include ("../lock.php");

if ($user == $myrow["user"] && $pass == $myrow["pass"])
{
if($user == $adname){

$id = mysql_real_escape_string(trim($_POST['id']));

if($id != '')
{
$result = mysql_query("DELETE FROM userlist WHERE id='".$id."'");

if ($result == 'true') {
include ("../head.php");
echo "<link rel='stylesheet' type='text/css' href='../style.css'/>";
echo "<div class='nav'>Юзер Удален!</div>";
echo "<div class='nav'><a href=../menu.php?user=$user&pass=$pass>В меню</a></div>";
include ("../foot.php");
exit();
}
}
else {
include ("../head.php");
echo "<link rel='stylesheet' type='text/css' href='../style.css'/>";
echo "<div class='nav'>";
echo "Юзер не Удален!</div>";
echo <<< sss
<div class='nav'>
• <a href=../menu.php?user=$user&pass=$pass>В меню</a>
</div>
sss;
include ("../foot.php");
exit();
}
}
else
{
echo "<p>Ошибка!!!</p>";
exit();
}
}
}
else
{
include ("../head.php");
echo "Ошибка! <br />Неверный <b>Ник</b> или <b>Пароль</b>!<br />";
echo <<<sss
<a href="../index.php">На главную</a>
sss;
include ("../foot.php");
}
?>