-
Notifications
You must be signed in to change notification settings - Fork 0
/
table3.php
162 lines (143 loc) · 6.57 KB
/
table3.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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<?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);
?>
<html><head>
<title>×åëÿáèíñêèé ñèòóàöèîííûé öåíòð ýíåðãîñáåðåæåíèÿ</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<link rel="stylesheet" href="files/structure_collage_ektron2.css" type="text/css">
<link rel="stylesheet" href="files/default.css" title="default" type="text/css">
<link rel="alternate stylesheet" href="files/default_larger.css" title="big" type="text/css">
<link rel="stylesheet" type="text/css" href="files/niftyCorners.css">
<link rel="stylesheet" type="text/css" href="files/niftyPrint.htm" media="print">
<link rel="stylesheet" type="text/css" href="files/quotetabs.css">
<link type="text/css" rel="stylesheet" href="files/ektron2.css">
<script language="javascript" type="text/javascript" src="files/ektron_003.js"></script>
<script language="javascript" type="text/javascript" src="files/ektron.js"></script>
<script language="javascript" type="text/javascript" src="files/ektron_002.js"></script>
<style type="text/css">
.normal { background-color: #ffffff }
.normalActive { background-color: #5d6d2f }
</style>
</head>
<body><center>
</center>
<div id="main" style="width:1900px">
<table border="0" cellpadding="0" cellspacing="0" width="99%">
<tbody><tr>
<td>
<table border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr><td>
<table border="0" cellpadding="0" cellspacing="5" width="100%">
<tbody>
<tr><td valign="top">
<table cellpadding=2 cellspacing=1 bgcolor=#82cc7f align=center>
<tr bgcolor="#476a94">
<td align="center"><font color="white">N</font></td>
<td align="center"><font color="white">S</font></td>
<td align="center"><font color="white">Óçåë ó÷åòà</font></td>
<td align="center"><font color="white">Äàòà ñåàíñà ñâÿçè</font></td>
<td align="center"><font color="white">Qïîò,ÃÊàë</font></td>
<td align="center"><font color="white">Tèñï,÷àñ</font></td>
<td align="center"><font color="white">Gïîä,ò.</font></td>
<td align="center"><font color="white">Gîáð,ò.</font></td>
<td align="center"><font color="white">Pïð,ÌÏà</font></td>
<td align="center"><font color="white">Pîáð,ÌÏà</font></td>
<td align="center"><font color="white">Võâñ,ì3</font></td>
</tr>
<?php
$query = 'SELECT * FROM objects WHERE type<10';
$e = mysql_query ($query,$i); $cm=0; $cnt=1;
if ($e) $ui = mysql_fetch_row ($e);
while ($ui)
{
$vpot=$tisp=$vpod=$vobr=$ppod=$pobr=$qpot=$vgvs=$vhvs=$gpod=0;
$dat='-';
$query = 'SELECT * FROM devices WHERE object='.$ui[0];
$u = mysql_query ($query,$i);
if ($u) $uo = mysql_fetch_row ($u);
$query = 'SELECT * FROM data WHERE type=0 AND value>0 AND device='.$uo[11].' ORDER BY date DESC';
$y = mysql_query ($query,$i);
if ($y) $uy = mysql_fetch_row ($y);
while ($uy)
{
if ($uy[8]==13 && $uy[6]==23 && !$qpot) $qpot=$uy[3];
if ($uy[8]==4 && $uy[6]==10 && !$tisp) $tisp=$uy[3];
if ($uy[8]==12 && $uy[6]==26 && !$vhvs) $vhvs=$uy[3];
if ($uy[8]==12 && $uy[6]==25 && !$vgvs) $vgvs=$uy[3];
if ($uy[8]==12 && $uy[6]==23 && !$gpod) $gpod=$uy[3];
if ($dat=='-') $dat=$uy[2];
$uy = mysql_fetch_row ($y);
}
$query = 'SELECT * FROM data WHERE type=2 AND (prm=12 OR prm=14 OR prm=16) AND value>0 AND device='.$uo[11].' ORDER BY date DESC';
$y = mysql_query ($query,$i);
if ($y) $uy = mysql_fetch_row ($y);
while ($uy)
{
if ($uy[8]==12 && $uy[6]==21 && !$vpod) $vpod=$uy[3];
if ($uy[8]==12 && $uy[6]==22 && !$vobr) $vobr=$uy[3];
if ($uy[8]==12 && $uy[6]==26 && !$vhvs) $vhvs=$uy[3];
//if ($uy[8]==14 && $uy[6]==1 && !$vhvs) $vhvs=$uy[3];
if ($uy[8]==16 && $uy[6]==0 && !$ppod) $ppod=$uy[3];
if ($uy[8]==16 && $uy[6]==1 && !$pobr) $pobr=$uy[3];
if ($dat=='-') $dat=$uy[2];
$uy = mysql_fetch_row ($y);
}
print '<tr id="row'.$ui[0].'" bgcolor="#ffffff" Onmouseover="this.className=\'normalActive\'; cursor:pointer" Onmouseout="this.className=\'normal\'" class="normal">';
print '<td align="center">'.$cnt.'</td>';
if ($uo[12]==0) print '<td align="center"><img src="files/status2.gif"></td>';
if ($uo[12]==1) print '<td align="center"><img src="files/status1.gif"></td>';
if ($uo[12]==2) print '<td align="center"><img src="files/status3.gif"></td>';
if ($uo[12]==3) print '<td align="center"><img src="files/status4.gif"></td>';
print '<td align="left"><a href="index.php?sel=object_days2&device='.$uo[11].'&object='.$ui[0].'" style="font-decoration:none"><b>'.$ui[1].'</b></a></td>';
print '<td align="center">'.$dat.'</td>';
if ($uo[14])
{
if ($qpot) print '<td align="center">'.number_format($qpot,3).'</td>';
else print '<td align="center" bgcolor="#eeeeee"></td>';
if ($tisp) print '<td align="center">'.number_format($tisp,1).'</td>';
else print '<td align="center" bgcolor="#eeeeee"></td>';
if ($vpod) print '<td align="center">'.number_format($vpod,0).'</td>';
else print '<td align="center" bgcolor="#eeeeee"></td>';
if ($vobr) print '<td align="center">'.number_format($vobr,0).'</td>';
else print '<td align="center" bgcolor="#eeeeee"></td>';
if ($ppod) print '<td align="center">'.number_format($ppod,3).'</td>';
else print '<td align="center" bgcolor="#eeeeee"></td>';
if ($pobr) print '<td align="center">'.number_format($pobr,3).'</td>';
else print '<td align="center" bgcolor="#eeeeee"></td>';
if ($vhvs) print '<td align="center">'.number_format($vhvs,2).'</td>';
else print '<td align="center" bgcolor="#eeeeee"></td>';
}
else print '<td></td><td></td><td></td><td></td><td></td><td></td>';
print '</tr>';
$desc=substr($ui[1],0,20);
$desc = str_replace("'", "", $desc);
$desc = str_replace("\"", "", $desc);
$desc=str_replace("ÌÄÎÓ äåòñêèé ñàä","ÌÄÎÓ",$desc);
$desc=str_replace("Ñðåäíÿÿ Øêîëà","ÑØ",$desc);
$desc=str_replace("Ãîðîäñêàÿ áîëüíèöà","ÃÁ",$desc);
//$vpod = str_replace(",", "", $vpod);
//$qpot = str_replace(",", "", $qpot);
//$tisp = str_replace(",", "", $tisp);
$dat1.='&nm'.$cm.'='.$desc.'&dt'.$cm.'='.$vpod;
$dat2.='&nm'.$cm.'='.$desc.'&dt'.$cm.'='.$qpot;
$dat3.='&nm'.$cm.'='.$desc.'&dt'.$cm.'='.$ppod;
$dat4.='&nm'.$cm.'='.$desc.'&dt'.$cm.'='.$tisp;
$ui = mysql_fetch_row ($e); $cm++; $cnt++;
}
?>
</tbody></table>
</tbody></table>
</td>
</tr></tbody></table>
</td></tr>
</tbody></table>
<br><br><br>
<br><br><br><br><br>
</div>
</html>