index.php
3.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
<?
session_start();
?>
<HTML>
<HEAD>
<TITLE>Администратор</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<META Name="KEYWORDS" Content="<? echo $keyword; ?>">
<META Name="DESCRIPTION" Content="<? echo $description;?>">
<LINK HREF="./screen.css" TYPE="text/css" REL="stylesheet">
<script type="text/javascript" src="fckeditor/fckeditor.js"></script>
</HEAD>
<?
include ("./func.php");
include ("../lib/db_class.php");
include ("../config.php");
$db = new DBClass(SERVER,USER,PASSWORD,DBNAME);
if (isset($_POST['name'])&&isset($_POST['pass']))
{
$name = $_POST['name'];
$pass = $_POST['pass'];
$colum = "name, pass";
$table = "users";
$where = "name = "."'$name'"." and pass = "."'$pass'"."";
$query = $db->select($colum,$table,$where);
if(count($query) > 0)
{
$_SESSION['valid_user'] = $query[0][name];
}
else {
$message = "Вы ввели неправильный логин или пароль";
}
}
if ($_GET['action'] == "exit")
{
unset($_SESSION['valid_user']);
}
if (!empty($_SESSION['valid_user']))
{
if (isset($_GET['action']))
{
$action = $_GET['action'];
}
if (isset($_POST['action']))
{
$action = $_POST['action'];
}
if ((!isset($_GET['action']))and(!isset($_POST['action'])))
{
$action = "hero3_users";
}
$lang="ua";
?>
<BODY BGCOLOR=#FFFFFF LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 RIGHTMARGIN=0 bottommargin=0>
<table cellpadding=0 cellspacing=0 width=100% height=100% border = 0 style="border-style:solid; border-width:15px; border-color:#DEDEDE">
<tr>
<td width="250" valign="top" class = "tabl5" style="padding-top:10; padding-left:10">
<?
include ("./materials/adm_menu/adm_menu.php");
?>
</td>
<td valign="top">
<br><br>
<?
if (isset($action))
{
include ("./materials/$action/$action.php");
}
?>
</td>
</tr>
</table>
<?
} else {
?>
<div align="center" valign="middle">
<form method="post" action="index.php">
<table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%">
<tr>
<td align="center" valign="top" style="padding-top:200px">
<table cellpadding="0" cellspacing="0" border="0" height="130px">
<tr>
<td>
<table cellpadding="0" cellspacing="0" border="0" width="250px" height="130px" class="login_form">
<?
if (isset($name))
{
?>
<tr>
<td class="text_login_error">
<?
echo $message;
?>
</td>
</tr>
<?
}
?>
<tr>
<td align="center">
<table cellpadding="0" cellspacing="5" border="0" width="230px">
<tr>
<td class="text_login" width="50px">
<b>Логин:</b>
</td>
<td>
<input type="text" name="name" class="input_text_login">
</td>
</tr>
<tr>
<td class="text_login" width="50px">
<b>Пароль:</b>
</td>
<td>
<input type="password" name="pass" class="input_text_login">
</td>
</tr>
<tr>
<td colspan="2" align="center" style="padding-top:10">
<input type="submit" value="Войти" class="button_login_2">
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
<div>
<?
}
?>
</BODY>
</HTML>