-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
210 lines (193 loc) · 8.67 KB
/
index.php
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
<?php
include("config/local.php");
$i = mysql_connect ($mysql_host,$mysql_user,$mysql_password); $e=mysql_select_db ($mysql_db_name);
$query = "set character_set_client='cp1251'"; mysql_query ($query,$i);
$query = "set character_set_results='cp1251'"; mysql_query ($query,$i);
$query = "set collation_connection='cp1251_general_ci'"; mysql_query ($query,$i);
//echo $_POST['name'].' | '.$_POST['pass'];
if($_POST['name'] && $_POST['pass'])
{
$query='SELECT id,pass,name,login FROM users WHERE login=\''.mysql_real_escape_string($_POST['name']).'\' LIMIT 1';
# ВытаÑкиваем из БД запиÑÑŒ, у которой логин равнÑетьÑÑ Ð²Ð²ÐµÐ´ÐµÐ½Ð½Ð¾Ð¼Ñƒ
$quer = mysql_query ($query,$i);
$data = mysql_fetch_assoc($quer);
echo $data['pass'].' | '.$_POST['pass'];
if($data['pass'] == $_POST['pass'])
{
$query='UPDATE users SET ip="'.$_SERVER['REMOTE_ADDR'].'" WHERE id="'.$data['id'].'"';
mysql_query ($query,$i);
echo $query;
setcookie("id", $data['id'], time()+60*60*24*30);
setcookie("name", $data['name'], time()+60*60*24*30);
print '<script> window.location.href="index.php" </script>';
$query = 'INSERT INTO registers SET who="'.$data['name'].'", ip="'.$_SERVER['REMOTE_ADDR'].'", what="user login success"';
mysql_query ($query,$i);
echo $query;
}
else
{
$query='INSERT INTO registers SET who="'.$data['name'].'", ip="'.$_SERVER['REMOTE_ADDR'].'", what="user login failed with pass '.$_POST["pass"].'"';
mysql_query ($query,$i);
echo $query;
}
}
if ($_GET["action"]=='logout')
{
setcookie("id", "", time() - 3600);
setcookie("name", "", time() - 3600);
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head>
<meta http-equiv="content-type" content="text/html; charset=Windows-1251">
<title>ÎÀÎ Àãðîêîìïëåêñ "×óðèëîâî"</title>
<link href="/favicon.ico" rel="shortcut icon">
<meta content="JavaScript" name="vs_defaultClientScript">
<link href="files/BaseStyle.css" type="text/css" rel="stylesheet">
<link href="files/pop_style.css" type="text/css" rel="stylesheet">
<link href="files/StockMarkets.css" type="text/css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="ddlevelsfiles/ddlevelsmenu-base.css" />
<link rel="stylesheet" type="text/css" href="ddlevelsfiles/ddlevelsmenu-topbar.css" />
<link rel="stylesheet" type="text/css" href="ddlevelsfiles/ddlevelsmenu-sidebar.css" />
<script type="text/javascript" src="ddlevelsfiles/ddlevelsmenu.js"></script>
</head>
<body bottommargin="0" leftmargin="0" topmargin="0" rightmargin="0">
<?php
if (!$_GET["print"])
print '<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody><tr><td>
<table border="0" cellpadding="0" cellspacing="0" width="100%"></table>
</td></tr>
<tr>
<td class="LeftBorderThik" height="20">
<table id="Table1" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody><tr>
<td bgcolor="#15873c">
<div id="ddtopmenubar" class="mattblackmenu">
<ul>
<li><a href="index.php" rel="ddsubmenu1">Ãëàâíàÿ</a></li>
<li><a href="index.php" rel="ddsubmenu2">Îáúåêòû ó÷åòà</a></li>
<li><a href="index.php" rel="ddsubmenu3">Òåõíè÷åñêèé àíàëèç</a></li>
<li><a href="index.php" rel="ddsubmenu4">Ýêîíîìè÷åñêèé àíàëèç</a></li>
<li><a href="index.php" rel="ddsubmenu5">Òðåíäû</a></li>
<li><a href="index.php" rel="ddsubmenu6">Ïðåäóïðåæäåíèÿ</a></li>
<li><a href="index.php" rel="ddsubmenu7">Èíôîðìàöèÿ</a></li>
</ul>
</div>
<script type="text/javascript">
ddlevelsmenu.setup("ddtopmenubar", "topbar") //ddlevelsmenu.setup("mainmenuid", "topbar|sidebar")
</script>
<ul id="ddsubmenu1" class="ddsubmenustyle">
<li><a href="index.php?sel=channels2">Óçëû ó÷åòà ïî ðåñóðñàì</a>
<ul>
<li><a href="index.php?sel=channels2&type=3">Ó÷åò ãàçà</a></li>
<li><a href="index.php?sel=channels2&type=2">Ó÷åò âîäû</a></li>
<li><a href="index.php?sel=channels2&type=1">Ó÷åò ýëåêòðîýíåðãèè</a></li>
<li><a href="index.php?sel=channels2&type=4">Ó÷åò òåïëà</a></li>
</ul>
</li>
<li><a href="index.php?sel=reports">Ñòàíäàðòíûå îò÷åòû</a>
<ul>
<li><a href="index.php">Îò÷åò çà î÷åðåäíîé îò÷¸òíûé ïåðèîä</a></li>
<li><a href="index.php">Îò÷åò îá îáùåé ýêîíîìèè</a></li>
</ul>
</li>
</ul>
<ul id="ddsubmenu2" class="ddsubmenustyle">
<li><a href="index.php?sel=devices">Êîíòðîëëåðû ó÷åòà</a></li>
<li><a href="index.php?sel=channels2">Êàíàëû èçìåðåíèÿ</a></li>
<li><a href="index.php?sel=currents">Òåêóùèå çíà÷åíèÿ</a></li>
</ul>
<ul id="ddsubmenu3" class="ddsubmenustyle">
<li><a href="index.php?sel=devices">Òåõíè÷åñêèå äàííûå</a>
<ul>
<li><a href="index.php?sel=details&name=edizm">Åäèíèöû èçìåðåíèÿ</a></li>
<li><a href="index.php?sel=details&name=protocols">Ïðîòîêîëû îáìåíà</a></li>
<li><a href="index.php?sel=details&name=var2">Èçìåðÿåìûå ïàðàìåòðû</a></li>
<li><a href="index.php?sel=details&name=energy">Âèäû ýíåðãîðåñóðñîâ</a></li>
</ul>
</li>
<li><a href="index.php?sel=minmax">Àíàëèç íà ìèíèìóìû è ìàêñèìóìû</a></li>
<li><a href="index.php?sel=channels3">Íàêîïèòåëüíûå èòîãè</a></li>
<li><a href="index.php?sel=archives">Âñå àðõèâû</a>
<ul>
<li><a href="index.php?sel=archives2">×àñîâûå</a></li>
<li><a href="index.php?sel=archives">Ïî äíÿì</a></li>
</ul>
</li>
</ul>
<ul id="ddsubmenu4" class="ddsubmenustyle">
<li><a href="">Ïîòðåáëåíèå ïî óçëàì</a></li>
<li><a href="index.php?sel=eco&id=2">Öåíû íà ýíåðãîðåñóðñû</a></li>
<li><a href="index.php?sel=eco&id=3">Ðàñêëàä ïîòðåáëåíèÿ ïî ýíåðãîðåñóðñàì</a></li>
<li><a href="index.php?sel=eco&id=4">Ðàñêëàä ïîòðåáëåíèÿ ýíåðãîðåñóðñîâ ïî âðåìåíè</a></li>
<li><a href="index.php?sel=analys">Ñòàíäàðòíûé îò÷åò ïî ýêîíîìè÷åñêîìó ýôôåêòó</a></li>
</ul>
<ul id="ddsubmenu7" class="ddsubmenustyle">
<li><a href="index.php?sel=about">Î ïðåäïðèÿòèè</a></li>
<li><a href="index.php?sel=about2">Î ïðîãðàììå</a></li>
</ul>
<ul id="ddsubmenu6" class="ddsubmenustyle">
<li><a href="index.php?sel=register">Ðàáîòîñïîñîáíîñòü îáîðóäîâàíèÿ</a></li>
<li><a href="index.php?sel=register2">Æóðíàë ñîáûòèé</a></li>
</ul>
<ul id="ddsubmenu5" class="ddsubmenustyle">
<li><a href="index.php?sel=trends&type=1">×àñîâûå</a></li>
<li><a href="index.php?sel=trends&type=2">Ñóòî÷íûå</a></li>
<li><a href="index.php?sel=trends&type=4">Ïî ìåñÿöàì</a></li>
<li><a href="index.php?sel=trends&type=9">Èíòåðâàëüíûå</a></li>
</ul>
</td><td bgcolor="#15873c">
<a href="'.$_SERVER['REQUEST_URI'].'&print=1"><img border="0" src="files/prin2.gif"></a></td></tr>
<tr>
<td bgcolor="#ffffff">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody><tr>
<td nowrap="nowrap" valign="middle"></td>
<td height="5" valign="middle" width="100%"></td>
</tr></tbody></table>
</td></tr></tbody></table>
</td></tr></tbody></table>';
?>
<table cellpadding="0" cellspacing="0" width="100%" border=0>
<tbody><tr><td colspan="3">
<?php
if ($_GET["menu"]=='' && $_GET["sel"]=='') include("main.php");
else { $file=$_GET["sel"].'.php'; include $file; }
?>
</td></tr></table></td></tr>
<tr><td colspan="3">
<?php
if (!$_GET["print"]) print '
<tr>
<td colspan="3" align="center" valign="top">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody><tr>
<td style="font-size: 8pt; font-family: Verdana;" align="center">
<hr size="1" color="#15873C">
<table id="Table1" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody><tr>
<td align="center"><img src="files/spacer_003.gif" height="31" width="137"></td>
<td style="font-size: 8pt; font-family: Verdana;" align="center"><a href="http://www.churilovo-agro.ru/">
Copyright ©</a> 2010-2014, churilovo-agro.
<br>
<a href="http://www.churilovo-agro.ru/" target="_blank">Ñàéò ïðåäïðèÿòèÿ</a> |
<a href="index.php?sel=about" target="_blank">Èíôîðìàöèÿ î ñèñòåìå</a>
<font size="1" face="Verdana">Èíòåðôåéñ îïòèìèçèðîâàí ïîä ðàçðåøåíèå â 1280 x 1024 èëè âûøå, áðàóçåð Firefox è íåáîëüøîé ðàçìåð øðèôòà</font></td>
<td align="center" nowrap="nowrap" valign="middle"><a href="" title="" target="_blank"><img style="border: medium none ;" src="files/churilovo-logo.png" alt="ÞÓÀÈÇ"></a><img src="files/spacer_003.gif" height="31" width="50"></td>
</tr>
</tbody></table>
<br>
</td></tr>
</tbody></table>';
?>
</td>
</tr>
</tbody></table>
<div id="SummaryDiv" style="border: 1px solid black; display: none; width: 113px; position: absolute; height: 20px; background-color: rgb(255, 255, 204);" ms_positioning="FlowLayout">
<table border="0" cellpadding="2" height="38" width="111">
<tbody><tr><td class="blacktext" nowrap="nowrap">Current</td><td class="blackText" id="tdSummary1"></td></tr>
<tr><td class="blacktext" nowrap="nowrap">Net Change</td><td class="blackText" id="tdSummary2"></td></tr>
</tbody></table>
</div>
</body></html>