-
Notifications
You must be signed in to change notification settings - Fork 0
/
irp7.php
102 lines (98 loc) · 4.65 KB
/
irp7.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
<!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">
<title>Ñèñòåìà ó÷åòà èíäèâèäóàëüíîãî ïîòðåáëåíèÿ ýíåðãîðåñóðñîâ :: Ðàñïðåäåëåíèå òåìïåðàòóðû ïîäàþùåãî è îáðàòíîãî ñòîÿêîâ</title>
<body leftmargin=0 topmargin=5 rightmargin=0 bottommargin=0 marginwidth=0 marginheight=0>
<table width=1200px cellpadding=1 cellspacing=1 align=center>
<tr bgcolor=#ffcf68 valign=top><td colspan=2 align=center><font class=tablz3>Ðàñïðåäåëåíèå òåìïåðàòóðû ïîäàþùåãî è îáðàòíîãî ñòîÿêîâ, çàôèêñèðîâàííûå â ìîìåíò âðåìåíè
<?php
include("config/local.php");
$arr = get_defined_vars();
$i = mysql_connect ($mysql_host,$mysql_user,$mysql_password); $e=mysql_select_db ($mysql_db_name);
$query = 'SELECT * FROM prdata WHERE type=0 AND device<40000000 AND device>30000000 ORDER BY date DESC';
$e = mysql_query ($query,$i);
$ui = mysql_fetch_row ($e);
print $ui[4];
?>
</font></td></tr>
<tr>
<td width=800 valign=top>
<?php
print '<img width=800 height=400 src="charts/barplots.php?type=1&obj='.$_GET["obj"].'">';
print '<img width=800 height=400 src="charts/barplots.php?type=2&obj='.$_GET["obj"].'">';
print '<img width=800 height=400 src="charts/barplots.php?type=3&obj='.$_GET["obj"].'">';
?>
</td>
<?php
print '<td width=400 valign=top><table width=400 bgcolor=#664466 valign=top cellpadding=1 cellspacing=1><tr><td bgcolor=#ffcf68 align=center><font class=tablz>#</font></td>';
print '<td bgcolor=#ffcf68 align=center><font class=tablz>H1</font></td>';
print '<td bgcolor=#ffcf68 align=center><font class=tablz>H2</font></td>';
print '<td bgcolor=#ffcf68 align=center><font class=tablz>T1</font></td>';
print '<td bgcolor=#ffcf68 align=center><font class=tablz>T2</font></td>';
print '<td bgcolor=#ffcf68 align=center><font class=tablz>V1</font></td>';
print '<td bgcolor=#ffcf68 align=center><font class=tablz>M1</font></td>';
print '<td bgcolor=#ffcf68 align=center><font class=tablz>Q</font></td>';
print '<td bgcolor=#ffcf68 align=center><font class=tablz>äàòà</font></td></tr>';
$query = 'SELECT * FROM dev_irp ORDER BY strut';
$a = mysql_query ($query,$i);
$uy = mysql_fetch_row ($a); $cn=0;
while ($uy)
{
print '<tr><td bgcolor=#ffcf68 align=center>';
print '<a style="cursor: pointer" onclick="(imgs)=window.open(\'edit.php?id='.$uy[1].'\',\'_blank\',\'width=790,height=520,toolbar=no,menubar=no,location=no,status=no,resizable=no,scrollbars=no,top=0,left=0\');">';
print '<font class=tablz>'.$uy[3].'</font></a>';
print '</td>';
$query = 'SELECT * FROM prdata WHERE type=2 AND device='.$uy[1].' ORDER BY date DESC,prm,pipe';
$e = mysql_query ($query,$i);
$ui = mysql_fetch_row ($e); $nc=0; $status=0;
while ($ui)
{
if (!$ui[5])
{
$query = 'SELECT * FROM hours WHERE type=1 AND device='.$uy[1].' AND prm='.$ui[2].' AND pipe='.$ui[7].' AND value>0 ORDER BY date DESC';
$r = mysql_query ($query,$i);
$ur = mysql_fetch_row ($r);
if (!$ur[5]) $ui[5]=$ur[5];
}
$date=$ui[4];
if ($ui[2]<11 || $ui[7]==0)
{
$nc++;
if (($ui[2]==11 || $ui[2]==12) && $ui[5]<0.09)
print '<td bgcolor=#5555f0 align=center><font class=tablz>'.number_format($ui[5],2).'</font></td>';
else
if ($ui[5]<-10 && $ui[2]==13) print '<td bgcolor=#5555f0 align=center><font class=tablz>!</font></td>';
else
print '<td bgcolor=#e8e8e8 align=center><font class=tablz>'.number_format($ui[5],2).'</font></td>';
}
$status=$ui[6];
$ui = mysql_fetch_row ($e);
}
$act='';
for ($g=$nc;$g<7;$g++) print '<td bgcolor=#e86666 align=center><font class=tablz>-</font></td>';
print '<td bgcolor=#e8e8e8 align=center><font class=tablz>'.$date.'</font></td>';
if ($ui[6]&0x1) $act=$act.' Òïð ìåíüøå íóëÿ';
if ($ui[6]&0x2) $act=$act.' Òîáð ìåíüøå íóëÿ';
if ($ui[6]&0x4) $act=$act.' Hïð ìåíüøå íóëÿ';
if ($ui[6]&0x8) $act=$act.' Hîáð ìåíüøå íóëÿ';
if ($ui[6]&0x10) $act=$act.' Vïð ìåíüøå íóëÿ';
if ($ui[6]&0x20) $act=$act.' Vîáð ìåíüøå íóëÿ';
if ($ui[6]&0x40) $act=$act.' Òïð > 120Ñ';
if ($ui[6]&0x80) $act=$act.' Òîáð > 120C';
if ($ui[6]&0x100) $act=$act.' Hïð > 1000';
if ($ui[6]&0x200) $act=$act.' Hîáð > 1000';
if ($ui[6]&0x400) $act=$act.' V > 100000';
if ($ui[6]&0x800) $act=$act.' M > 100000';
//if ($act!='') print '<td bgcolor=#ff5555 align=center><font class=tablz>'.$act.'</font></td></tr>';
//else print '<td bgcolor=#e8e8e8 align=center></td></tr>';
$uy = mysql_fetch_row ($a);
}
?>
</tr>
</table>
</body>
</html>