-
Notifications
You must be signed in to change notification settings - Fork 0
/
uzel.php
295 lines (289 loc) · 15.4 KB
/
uzel.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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
<?php include("config/local.php"); ?>
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<!doctype php manual "-//by the PHP Documentation Group//en">
<!doctype odbc manual "-//by microsoft corp.//en">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<link rel="stylesheet" href="shablon.css" type="text/css">
<?
include_once("../../adodb/adodb.inc.php");
$db= &ADONewConnection($sqldriver);
if (!$db->Connect($mysql_host, $mysql_user, $mysql_password, $mysql_db_name))
{die("Error: ".$db->ErrorMsg());}
$resq = "SELECT * FROM users WHERE user='".$PHP_AUTH_USER."' AND passwd='".$PHP_AUTH_PW."';";
$rc=&$db->Execute($resq);
echo "<title>Ïîäðîáíî ïî óçëàì-Èíòåðôåéñ '".$priveleges[$rc->fields[user_priveleges]]."'</title></head><body>";
?>
</head>
<body><table cellpadding="0" cellspacing="0" border="0" style="width:100%;">
<tr><td><table cellpadding="0" cellspacing="0" border="0" style="width:100%;">
<tr>
<td id="header" style="width:100%;background-image: url(files/14164-598x134.jpg);">
<a href="http://www.tpchel.ru/" title="Íà ãëàâíóþ ñòðàíèöó ÎÀÎ Òåïëîïðèáîð"><img src="files/logo.gif" alt="Íà ãëàâíóþ ñòðàíèöó" class="logo" align="top" width="103" height="100" border="0"/>
</a><div class="transparent"><a href="http://www.rossich.ru/"><img src="files/transparent.gif" /></a></div>
</div></td></tr></table></td></tr>
<tr><td>
<table border=0 align=center bgcolor=#ffffff>
<tr><td>
<? include ("inc/menu.inc"); ?>
</td></tr>
<tr><td>
<table border=0 align=center bgcolor=#ffffff>
<font class="main">
<?php
$i = mysql_connect ($mysql_host,$mysql_user,$mysql_password); $e=mysql_select_db ($mysql_db_name);
$query = 'SELECT * FROM uzel WHERE id=\''.$_GET["id"].'\'';
$e = mysql_query ($query,$i);
if ($e)
{
$ui = mysql_fetch_row ($e);
if ($ui == true)
{
print '<tr><td colspan=4><hr></td></tr>';
print '<tr><td valign=top><table border=0 valign=top><tr><td><font class="fin1">Óçåë ó÷åòà </font><font class="or1">'; print $ui[1]; print '</font></td></tr>';
print '<tr><td><font class="zagl">Ýíåðãîðåñóðñ </font><font class="or1">';
$query = 'SELECT caption FROM energy_supply WHERE id=\''. $ui[2].'\'';
$p = mysql_query ($query,$i);
$uo = mysql_fetch_row ($p);
if ($uo == true) print $uo[0];
else print $ui[2];
print '</font></td></tr>';
print '<tr><td><font class="zagl">Êîðïóñ </font><font class="or1">';
$query = 'SELECT name FROM korp WHERE korp_id=\''. $ui[3].'\'';
$p = mysql_query ($query,$i);
$uo = mysql_fetch_row ($p);
if ($uo == true) print $uo[0];
else print 'Unknown';
print '</font></td></tr>';
print '<tr><td><hr></td></tr>';
print '<tr><td><table>';
//if ($ui[2]==7 || $ui[3]==101) $query = 'SELECT name,value FROM data WHERE korp=\''.$ui[3].'\' AND device=\''.$ui[4][3].$ui[4][4].$ui[4][0].$ui[4][1].'\' AND source=\''.$ui[2].'\'AND type=\'0\'';
if ($ui[2]==7 || $ui[3]==101) $query = 'SELECT name,value FROM data WHERE device=\''.$ui[4][3].$ui[4][4].$ui[4][0].$ui[4][1].'\' AND source=\''.$ui[2].'\' AND type=\'0\'';
else $query = 'SELECT name,value FROM data WHERE korp=\''.$ui[3].'\' AND device=\''.$ui[4][3].$ui[4][4].'\' AND source=\''.$ui[2].'\' AND type=\'0\'';
//echo $query;
$p = mysql_query ($query,$i);
for ($h=0;$h<50;$h++)
{
$uo = mysql_fetch_row ($p);
if ($uo == true)
{
print '<tr><td><font class="or1">';
print $uo[0]; print '</font><font class="menu"> ';
print $uo[1];
if (strstr ($uo[0],'Îáúåìíûé ðàñõîä') || strstr ($uo[0],'ðàñõîäà âîäû ïî')) print ' (ì3/÷)';
if (strstr ($uo[0],'àâëåíè')) print ' (ÌÏà)';
if (strstr ($uo[0],'åìïåðàòóð')) print ' (Ñ)';
if (strstr ($uo[0],'åïëîâàÿ ìîùíîñòü')) print ' (ÃÊàë/÷)';
if (strstr ($uo[0],'àññ')) print ' (êã/÷)';
if ($ui[2]==7) print ' (êÂò/÷)';
print '</font></td></tr>';
}
}
print '</table></td></tr></table></td>';
print '<td bgcolor=#ffffff valign=top><table><form name="redd" method=post action="report.php"><tr><td colspan=2 height=1 bgcolor=#e6e6e6>';
print '<input size=1 style="height:1;width:1;visibility:hidden" value="99" id="idbuy" name="idbuy"><input size=1 style="height:1;width:1;visibility:hidden" value="'.$ui[4].'" id="idkon" name="idkon">';
$today = getdate (); if ($today[mon]<10) $mon='0'.$today[mon]; else $mon=$today[mon];
if ($today[mday]<10) $mday='0'.$today[mday]; else $mday=$today[mday];
print '<input size=1 style="height:1;width:1;visibility:hidden" id="otch" name="otch" value="11">';
print '</td></tr></form>';
print '<tr><td bgcolor=#e6e6e6><font class="down">Àðõèâíûå äàííûå</font></td><td bgcolor=#e6e6e6></td></tr>';
if ($ui[7]==1)
{
print '<tr><td colspan=2><form name="redd" method=post action="report.php">';
print '<input size=1 style="height:1;width:1;visibility:hidden" value="99" id="idbuy" name="idbuy">';
print '<input size=1 style="height:1;width:1;visibility:hidden" value="'.$ui[2].'" id="source" name="source">';
print '<input size=1 style="height:1;width:1;visibility:hidden" value="'.$ui[3].'" id="idkorp" name="idkorp">';
print '<input size=1 style="height:1;width:1;visibility:hidden" value="'.$ui[4].'" id="idkon" name="idkon">';
print '<input size=1 style="height:1;width:1;visibility:hidden" id="otch" name="otch" value="21">';
print '<input size=1 style="height:1;width:1;visibility:hidden" value="'.$mday.'" id="day" name="day">';
print '<input size=1 style="height:1;width:1;visibility:hidden" value="'.$mon.'" id="month" name="month">';
print '<input size=1 style="height:1;width:1;visibility:hidden" value="'.$today[year].'" id="year" name="year"></td></tr>';
print '<tr><td><font class="down">×àñîâîé</font></td><td><input alt="see" border=0 src="files/outp.gif" type=image align=right style="cursor: hand"></form></td></tr>';
print '<tr><td colspan=2><form name="redd" method=post action="report.php">';
print '<input size=1 style="height:1;width:1;visibility:hidden" value="99" id="idbuy" name="idbuy">';
print '<input size=1 style="height:1;width:1;visibility:hidden" value="'.$ui[2].'" id="source" name="source">';
print '<input size=1 style="height:1;width:1;visibility:hidden" value="'.$ui[3].'" id="idkorp" name="idkorp">';
print '<input size=1 style="height:1;width:1;visibility:hidden" value="'.$ui[4].'" id="idkon" name="idkon">';
print '<input size=1 style="height:1;width:1;visibility:hidden" id="otch" name="otch" value="22">';
print '<input size=1 style="height:1;width:1;visibility:hidden" value="'.$mday.'" id="day" name="day">';
print '<input size=1 style="height:1;width:1;visibility:hidden" value="'.$mon.'" id="month" name="month">';
print '<input size=1 style="height:1;width:1;visibility:hidden" value="'.$today[year].'" id="year" name="year"></td></tr>';
print '<tr><td><font class="down">Äíåâíîé</font></td><td><input alt="see" border=0 src="files/outp.gif" type=image align=right style="cursor: hand"></form></td></tr>';
}
print '<tr><td colspan=2><form name="redd" method=post action="report.php">';
print '<input size=1 style="height:1;width:1;visibility:hidden" value="99" id="idbuy" name="idbuy">';
print '<input size=1 style="height:1;width:1;visibility:hidden" value="'.$ui[2].'" id="source" name="source">';
print '<input size=1 style="height:1;width:1;visibility:hidden" value="'.$ui[3].'" id="idkorp" name="idkorp">';
print '<input size=1 style="height:1;width:1;visibility:hidden" value="'.$ui[4].'" id="idkon" name="idkon">';
print '<input size=1 style="height:1;width:1;visibility:hidden" value="'.$ui[7].'" id="typ" name="typ">';
print '<input size=1 style="height:1;width:1;visibility:hidden" id="otch" name="otch" value="24">';
print '<input size=1 style="height:1;width:1;visibility:hidden" value="'.$mday.'" id="day" name="day">';
print '<input size=1 style="height:1;width:1;visibility:hidden" value="'.$mon.'" id="month" name="month">';
print '<input size=1 style="height:1;width:1;visibility:hidden" value="'.$today[year].'" id="year" name="year"></td></tr>';
print '<tr><td><font class="down">Ïî ìåñÿöàì</font></td><td><input alt="see" border=0 src="files/outp.gif" type=image align=right style="cursor: hand"></form></td></tr>';
print '<tr><td colspan=2 bgcolor=#bebebe></td></tr>';
print '<tr><td><br><font class="down">Ïàðàìåòðû íàñòðîéêè</font></td><td><br><a href="unastr.php?idlog='.$ui[4][0].$ui[4][1].$ui[4][3].$ui[4][4].'"><img alt="see" border=0 src="files/outp.gif"></a></td></tr>';
print '<tr><td colspan=2 bgcolor=#bebebe></td></tr>';
print '<tr><td><font class="down">IP àäðåñ ïðåîáðàçîâàòåëÿ</font></td><td><font class="zagl">';
if ($ui[5]=='com1') print '10.23.6.102';
if ($ui[5]=='com3') print '10.22.14.11';
if ($ui[5]=='com4') print '192.1.160.20';
if ($ui[5]=='com5') print '10.10.6.104';
if ($ui[5]=='com6') print '10.23.6.103';
if ($ui[5]=='com8') print '10.22.14.110';
if ($ui[5]=='com9') print '192.1.160.21';
if ($ui[5]=='odbc') print '10.3.21.250 (tsu_srv.jsc.tpchel.ru)';
print '</font></td></tr>';
print '<tr><td><font class="down">Àäðåñ íà øèíå</font></td><td><font class="zagl">'.$ui[7].'</font></td></tr>';
print '<tr><td><font class="down">Èäåíòèôèêàòîð</font></td><td><font class="zagl">'.$ui[4].'</font></td></tr>';
print '</table></td>';
if ($ui[2]<7)
{
print '<td bgcolor=#ffffff valign=top><table>';
print '<tr><td align=center><table border=0><tr><td colspan=2 bgcolor=#e6e6e6><font class="down">Ïåðåðûâû ýëåêòðîïèòàíèÿ</font></td></tr>';
print '<tr><td bgcolor=#e6e6e6 width=120><font class="or1">Äàòà</font></td><td><font class="or1" bgcolor=#e6e6e6>Ïðîäîëæèòåëüíîñòü (÷.)</font></td></tr>';
$query = 'SELECT * FROM elect WHERE logik_id LIKE \'%'.$ui[4][0].$ui[4][1].$ui[4][2].$ui[4][3].$ui[4][4].'%\' ORDER BY date DESC';
// echo $query;
$e = mysql_query ($query,$i);
for ($z=1;$z<=10;$z++)
{
$ui = mysql_fetch_row ($e);
if ($ui == true)
{
print '<tr>';
print '<td bgcolor=#e6e6e6><font class="dd">'.$ui[1][0].$ui[1][1].$ui[1][2].$ui[1][3].'-'.$ui[1][4].$ui[1][5].'-'.$ui[1][6].$ui[1][7].' '.$ui[1][8].$ui[1][9].':'.$ui[1][10].$ui[1][11].':'.$ui[1][12].$ui[1][13].'</font></td>';
print '<td><font class="dd">'.$ui[2].'</font></td>';
print '</tr>';
}
}
print '</table></td></tr></table></td>';
}
print '</tr><tr><td colspan=4><hr></td></tr></table></td></tr>';
print '<tr><td colspan=4 align=center><table>';
$query = 'SELECT name,s_type,serial,shelf,date_dem_p,prichina_dem,date_mon_p,prichina_mon,Pmin,Pmax FROM equipment WHERE uzel=\''.$_GET["id"].'\'';
$max=10;
print '<tr><td bgcolor=#e6e6e6><font class="main">Íàçâàíèå</td>
<td bgcolor=#e6e6e6><font class="main">Òèï ïðèáîðà</td><td bgcolor=#e6e6e6><font class="main">Ñåðèéíûé íîìåð</td>
<td bgcolor=#e6e6e6><font class="main">Øêàô</td>
<td bgcolor=#e6e6e6><font class="main">Äàòà ïîñëåäíåãî äåìîíòàæà</td><td bgcolor=#e6e6e6><font class="main">Ïðè÷èíà äåìîíòàæà</td>
<td bgcolor=#e6e6e6><font class="main">Äàòà ïîñëåäíåãî ìîíòàæà</td><td bgcolor=#e6e6e6><font class="main">Ïðè÷èíà ìîíòàæà</td>
<td bgcolor=#e6e6e6><font class="main">Pmin</td> <td bgcolor=#e6e6e6><font class="main">Pmax</td>';
$e = mysql_query ($query,$i);
for ($z=1;$z<=1000;$z++)
{
$ui = mysql_fetch_row ($e);
if ($ui == true)
{
print '<tr>';
for ($j=0;$j<$max;$j++)
{
print '<td bgcolor=#ffffff><font class="dd">';
if ($j==22)
{
$query = 'SELECT caption FROM energy_supply WHERE id='.'\''. $ui[$j].'\'';
$p = mysql_query ($query,$i);
$uo = mysql_fetch_row ($p);
if ($uo == true) print $uo[0];
else print $ui[2];
}
else
if ($j==1)
{
$query = 'SELECT name FROM sensors WHERE id='.'\''. $ui[$j].'\'';
$p = mysql_query ($query,$i);
$uo = mysql_fetch_row ($p);
if ($uo == true) print $uo[0];
else print 'Unknown';
}
else
if ($j==10)
{
$query = 'SELECT name FROM uzel WHERE id='.'\''. $ui[$j].'\'';
$p = mysql_query ($query,$i);
$uo = mysql_fetch_row ($p);
if ($uo == true)
{
print '<a href="uzel.php?id='; print $ui[$j]; print '">';
echo $uo[0]; print '</a>';
}
else print 'Unknown';
}
else
if ($j==3)
{
$query = 'SELECT name FROM shelf WHERE id='.'\''. $ui[$j].'\'';
$p = mysql_query ($query,$i);
$uo = mysql_fetch_row ($p);
if ($uo == true) print $uo[0];
else print 'Unknown';
}
else
if ($j==23)
{
if ($ui[$j]==1) print 'Àáñîëþòíàÿ';
else print 'Îòíîñèòåëüíàÿ';
}
else echo $ui[$j];
print '</td>';
}
}
}
print '<tr><td colspan=10 valign=top align=center><table align=center><tr><td bgcolor=#e6e6e6 colspan=3><font class="down">Ñîáûòèÿ óçëà ó÷åòà [<a style="cursor: pointer" onclick="(imgs)=window.open(\'edit.php?uzel='.$_GET["id"].'\',\'_blank\',\'width=590,height=320,toolbar=no,menubar=no,location=no,status=no,resizable=no,scrollbars=no,top=0,left=0\');">äîáàâèòü èíôîðìàöèþ</a>]</font></td></tr>
<tr><td bgcolor=#e6e6e6><font class="main">Ñîáûòèå</td><td bgcolor=#e6e6e6><font class="main">Âîçíèêíîâåíèå</td><td bgcolor=#e6e6e6><font class="main">Îáíàðóæåíèå</td><td bgcolor=#e6e6e6><font class="main">Óçåë ó÷åòà</td><td bgcolor=#e6e6e6><font class="main">Îïèñàíèå</td><td bgcolor=#e6e6e6><font class="main">Äàò÷èê</td></tr>';
$query = 'SELECT * FROM event2 WHERE uzel='.$_GET["id"].' ORDER BY date_end DESC';
$e = mysql_query ($query,$i);
$ui = mysql_fetch_row ($e);
while ($ui)
{
print '<tr>';
for ($j=1;$j<7;$j++)
{
print '<td bgcolor=#ffffff><font class="dd">';
if ($j==1)
{
$query = 'SELECT event FROM why WHERE id='.'\''. $ui[$j].'\'';
$p = mysql_query ($query,$i);
$uo = mysql_fetch_row ($p);
if ($uo == true) print $uo[0];
else print 'Unknown';
}
else
if ($j==4)
{
$query = 'SELECT name FROM uzel WHERE id='.'\''. $ui[$j].'\'';
$p = mysql_query ($query,$i);
$uo = mysql_fetch_row ($p);
if ($uo == true)
{
print '<a href="uzel.php?id='; print $ui[$j]; print '">';
echo $uo[0]; print '</a>';
}
else print 'Unknown';
}
else
if ($j==6)
{
$query = 'SELECT name FROM equipment WHERE id='.'\''. $ui[$j].'\'';
$p = mysql_query ($query,$i);
$uo = mysql_fetch_row ($p);
if ($uo == true) print $uo[0];
else print 'Íå ñâÿçàíî ñ äàò÷èêîì';
}
else print $ui[$j];
print '</font></td>';
}
print '</tr>';
$ui = mysql_fetch_row ($e);
}
print '</table></td></tr>';
}
}
?>
</table>
</td></tr>
<? include ("inc/down.inc"); ?>
</td><tr>
</table>
</body>
</html>