-
Notifications
You must be signed in to change notification settings - Fork 0
/
lk5.php
363 lines (337 loc) · 20 KB
/
lk5.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
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
<title>Àíàëèç ïîêàçàíèé ïî õîëîäíîé è ãîðÿ÷åé âîäå</title>
<?php
include("config/local.php");
$arr = get_defined_vars();
$_GET["abs"]=1;
$today=getdate(); $begintime=time();
$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);
$query = 'SELECT * FROM build WHERE build_id='.$_GET["obj"];
$a = mysql_query ($query,$i);
$uy = mysql_fetch_row ($a); $build=$uy[1];
$query = 'SELECT * FROM device WHERE type=2 ORDER BY flat';
$a = mysql_query ($query,$i);
$uy = mysql_fetch_row ($a); $cm=0; $all=0; $ssum0=$ssum1=$cold0=$hot0=0;
if ($_GET["date"]=='') $month=1;
else $month=$_GET["date"];
include("time.inc");
if ($_GET["date"]=='')
{
$st=sprintf ("%d%02d01000000",$today["year"],$today["mon"]-1);
$fn=sprintf ("%d%02d01000000",$today["year"],$today["mon"]);
$month=$today["mon"]-1;
$k=1;
}
else
{
if ($_GET["year"]!='') $today["year"]=$_GET["year"];
if ($_GET["date"]!=$today["mon"]) $k=1;
else $k=$today["mday"]/31;
if ($_GET["st"]=='') $st=sprintf("%d%02d01000000",$today["year"],$month); else $st=$_GET["st"];
if ($_GET["fn"]=='') $fn=sprintf("%d%02d15000000",$today["year"],$month+1); else $fn=$_GET["fn"];
}
$query = 'SELECT * FROM flats ORDER BY flat';
$a = mysql_query ($query,$i); $cn=0;
if ($a) $uy = mysql_fetch_row ($a);
while ($uy)
{
$data01[$cn]=$data02[$cn]=$data11[$cn]=$data12[$cn]=0;
$query = 'SELECT * FROM device WHERE type=2 AND flat='.$uy[1];
$e = mysql_query ($query,$i);
$ui = mysql_fetch_row ($e);
if ($ui)
{
$device[$cn]=$ui[1];
$dev_flat[$cn]=$uy[1];
$ust[$cn]=$ui[21];
$cn++;
}
$uy = mysql_fetch_row ($a);
}
$max=$cn-1; $cn=0;
$query = 'SELECT * FROM prdata WHERE type=2 AND (prm=8 OR prm=6) AND date<='.$fn.' AND date>='.$st.' AND value<1000 ORDER BY date DESC';
$e = mysql_query ($query,$i);
if ($e) $ui = mysql_fetch_row ($e);
while ($ui)
{
for ($w=0;$w<=$max;$w++)
if ($device[$w]==$ui[1])
{
if ($data11[$w]==0 && $ui[2]==8) $data11[$w]=$ui[5];
if ($data12[$w]==0 && $ui[2]==6) $data12[$w]=$ui[5];
if ($data11[$w]>0 && $ui[2]==8) $data01[$w]=$ui[5];
if ($data12[$w]>0 && $ui[2]==6) $data02[$w]=$ui[5];
}
$ui = mysql_fetch_row ($e);
}
// for ($w=0;$w<=$max;$w++) echo $data01[$w].' '.$data02[$w].' '.$data11[$w].' '.$data12[$w].'<br>';
$query = 'SELECT * FROM device WHERE type=2 GROUP BY flat ORDER BY flat';
$a = mysql_query ($query,$i); $cm=0;
if ($a) $uy = mysql_fetch_row ($a);
while ($uy)
{
// $query = 'SELECT * FROM flats WHERE flat='.$uy[10];
$query = 'SELECT * FROM flats WHERE flat='.$dev_flat[$cm];
$e = mysql_query ($query,$i);
$ui = mysql_fetch_row ($e);
$today["mday"]=31;
$cm=$ui[1];
$flat[$cm]=$ui[1]; $abn[$cm]=$ui[16]; $cold[$cm]=number_format($ui[10]*5.4*$k,2); $hot[$cm]=number_format($ui[10]*3.6*$k,2);
$nab[$cm]=$ui[10];
$cold0+=$cold[$cm];
$hot0+=$hot[$cm];
//echo $data01[$cm].' '.$data02[$cm].' '.$data11[$cm].' '.$data12[$cm].'<br>';
//$sum0[$cm]=$data11[$cm];//-$data01[$cm]; if ($sum0[$cm]<0) $sum0[$cm]=0; $ssum0+=$sum0[$cm];
//$sum1[$cm]=$data12[$cm];//-$data02[$cm]; if ($sum1[$cm]<0) $sum1[$cm]=0; $ssum1+=$sum1[$cm];
$sum0[$cm]+=$data11[$cm]-$data01[$cm]; if ($sum0[$cm]<0) $sum0[$cm]=0; $ssum0+=$data11[$cm]-$data01[$cm];
$sum1[$cm]+=$data12[$cm]-$data02[$cm]; if ($sum1[$cm]<0) $sum1[$cm]=0; $ssum1+=$data12[$cm]-$data02[$cm];
if ($_GET["abs"]==1) { $sum1[$cm]=$data12[$cm]; $sum0[$cm]=$data11[$cm]; }
while (1)
{
if (($nab[$cm]==0 && $sum0[$cm]>1) || ($nab[$cm]==0 && $sum1[$cm]>1))
{
$n1++;
if ($sum0[$cm]>1) $snab0+=$sum0[$cm];
if ($sum1[$cm]>1) $snab1+=$sum1[$cm];
break;
}
if (($sum0[$cm]>($cold[$cm]+$cold[$cm])) || ($sum1[$cm]>($hot[$cm]+$hot[$cm])))
{
$n2++;
if ($sum0[$cm]>1) $spr0+=($sum0[$cm]-$cold[$cm]);
if ($sum1[$cm]>1) $spr1+=($sum1[$cm]-$hot[$cm]);
break;
}
if ($sum0[$cm]>$cold[$cm] || $sum1[$cm]>$hot[$cm])
{
$n3++;
if ($sum0[$cm]>1) $spr0+=$sum0[$cm]-$cold[$cm];
if ($sum1[$cm]>1) $spr1+=$sum1[$cm]-$hot[$cm];
break;
}
if ($nab[$cm]>0 && ($sum0[$cm]<0.1 || $sum1[$cm]<0.1)) if ($uy[21]==0) { $n4++; break; }
$n0++; break;
//print '<td align=center bgcolor=#eeeeee><font class=top2>'.$flat[$cm].'</font></td>';
//print '<td align=left bgcolor=#eeeeee><a href="lk_hour.php?flat='.$flat[].'&device='.$uy[1].'&n1='.$n1.'&st='.$st.'&fn='.$fn.'"><font class=top2>'.$abn.'</font></td>';
$n1=0;
break;
}
$cm++;
$uy = mysql_fetch_row ($a);
}
$pr0=number_format($n0*100/$cm,2);
$pr1=number_format($n1*100/$cm,2);
$pr2=number_format($n2*100/$cm,2);
$pr3=number_format($n3*100/$cm,2);
$pr4=number_format($n4*100/$cm,2);
$pr00=number_format(100*($cold0-$ssum0)/$cold0,2);
$pr01=number_format(100*($hot0-$ssum1)/$hot0,2);
$today=getdate();
print '<table width=1200px cellpadding=1 cellspacing=1 bgcolor=#664466 align=center><tr bgcolor=#ffcf68 valign=top><td colspan=2 align=center><font class=tablz3>Ðàñïðåäåëåíèå è àíàëèç ïîòðåáëåíèÿ õîëîäíîé è ãîðÿ÷åé âîäû ïî îáúåêòó óë.'.$build.' çà '.$month.' '.$today["year"].'</td>';
$tm=$today["mon"];
$cn=8;
while ($cn)
{
if ($tm==1) $dat='ßíâàðü';
if ($tm==2) $dat='Ôåâðàëü';
if ($tm==3) $dat='Ìàðò';
if ($tm==4) $dat='Àïðåëü';
if ($tm==5) $dat='Ìàé';
if ($tm==6) $dat='Èþíü';
if ($tm==7) $dat='Èþëü';
if ($tm==8) $dat='Àâãóñò';
if ($tm==9) $dat='Ñåíòÿáðü';
if ($tm==10) $dat='Îêòÿáðü';
if ($tm==11) $dat='Íîÿáðü';
if ($tm==12) $dat='Äåêàáðü';
$sts=sprintf ("%d%02d01000000",$today["year"],$tm);
$fns=sprintf ("%d%02d01000000",$today["year"],$tm+1);
print '<td align=center><a href="index.php?sel=lk5&obj='.$_GET["obj"].'&st='.$sts.'&fn='.$fns.'&date='.$tm.'&year='.$today["year"].'"><font class=tablz3>'.$dat.'</font></td>';
if ($tm==1) { $tm=12; $today["year"]--; }
else $tm--;
$cn--;
$uy = mysql_fetch_row ($a);
}
print '</tr></table>';
?>
<table width=600px cellpadding=2 cellspacing=1 bgcolor=#ffffff align=center>
<tr><td valign=top>
<table width=250px cellpadding=2 cellspacing=1 bgcolor=#664466 align=right>
<tr><td bgcolor=#ffcf68 align=center><font class=tablz>öâåò</font></td><td bgcolor=#ffcf68 align=center><font class=tablz>ïðè÷èíû</font></td></tr>
<tr><td bgcolor=#ee5544 align=center><font class=top5>êðèòè÷íî</font></td><td bgcolor=#e8e8e8><font class=top5>- ïåðåðàñõîä áîëüøå íîðìàòèâà íà 50%</font></td></tr>
<tr><td bgcolor=#eeee33 align=center><font class=top5>âíèìàíèå</font></td><td bgcolor=#e8e8e8><font class=top5>- áîëüøå íîðìàòèâà</font></td></tr>
<tr><td bgcolor=#ee80ee align=center><font class=top5>íåïîðÿäîê</font></td><td bgcolor=#e8e8e8><font class=top5>- ðàñõîä, íî íèêòî íå ïðîïèñàí</font></td></tr>
<tr><td bgcolor=#775577 align=center><font class=top5>íåèñïðàâíîñòü</font></td><td bgcolor=#e8e8e8><font class=top5>- îòñóòñòâóþò ïîêàçàíèÿ / íå óñòàíîâëåí</font></td></tr>
</table>
</td><td valign=top>
<table width=270px cellpadding=2 cellspacing=1 bgcolor=#664466 align=left>
<?php
$today=getdate();
//print '<tr><td bgcolor=#ffcf68 align=center><font class=top5>Äàòà</font></td><td bgcolor=#ffcf68><font class=tablz>'.$month.' '.$today["year"].'</font></td></tr>';
?>
<tr><td bgcolor=#eeeeee align=center><font class=top5>Íîðìàòèâ ïîòðåáëåíèÿ ÕÂ</font></td><td bgcolor=#e8e8e8><font class=top5>5.4 ì3 â ìåñÿö</font></td></tr>
<tr><td bgcolor=#eeeeee align=center><font class=top5>Íîðìàòèâ ïîòðåáëåíèÿ ÃÂ</font></td><td bgcolor=#e8e8e8><font class=top5>3.6 ì3 â ìåñÿö</font></td></tr>
<?php
$query = 'SELECT SUM(square),SUM(rnum) FROM flats';
$a = mysql_query ($query,$i);
$uy = mysql_fetch_row ($a); $kk=$uy[1]; $kk1=$uy[0];
print '<tr><td bgcolor=#eeeeee align=center><font class=top5>Ñóììà ïîòðåáëåíèÿ ÕÂÑ</font></td><td bgcolor=#e8e8e8><font class=tablz>'.number_format($ssum0,2).' ì3</font></td>';
print '<tr><td bgcolor=#eeeeee align=center><font class=top5>Íîðìàòèâíîå ïîòðåáëåíèå ÕÂÑ</font></td><td bgcolor=#e8e8e8><font class=tablz>'.$cold0.' ì3</font></td>';
print '<tr><td bgcolor=#ffcf68 align=center><font class=top5>Ýêîíîìèÿ</font></td><td bgcolor=#e8e8e8><font class=tablz>'.$pr00.' %</font></td>';
print '<tr><td bgcolor=#eeeeee align=center><font class=top5>Ñóììà ïîòðåáëåíèÿ ÃÂÑ</font></td><td bgcolor=#e8e8e8><font class=tablz>'.number_format($ssum1,2).' ì3</font></td>';
print '<tr><td bgcolor=#eeeeee align=center><font class=top5>Íîðìàòèâíîå ïîòðåáëåíèå ÃÂÑ</font></td><td bgcolor=#e8e8e8><font class=tablz>'.$hot0.' ì3</font></td>';
print '<tr><td bgcolor=#ffcf68 align=center><font class=top5>Ýêîíîìèÿ</font></td><td bgcolor=#e8e8e8><font class=tablz>'.$pr01.' %</font></td>';
?>
</table>
</td>
<?php
print '<td valign=top><img src="charts/pieplot5.php?obj='.$_GET["obj"].'&n1='.$n1.'&n2='.$n2.'&n3='.$n3.'&n4='.$n0.'&n5='.$n4.'" width=200 height=140></td>';
?>
<td valign=top>
<table width=180px cellpadding=2 cellspacing=1 bgcolor=#664466 align=right>
<?php
print '<tr><td bgcolor=#ffcf68 align=center><font class=tablz>öâåò</font></td><td bgcolor=#ffcf68 align=center><font class=tablz>êîëè÷åñòâî</font></td></tr>
<tr><td bgcolor=#ee5544 align=center><font class=top5>êðèòè÷íî</font></td><td bgcolor=#e8e8e8><font class=tablz>'.$n2.' ('.$pr2.'%)</font></td></tr>
<tr><td bgcolor=#eeee33 align=center><font class=top5>âíèìàíèå</font></td><td bgcolor=#e8e8e8><font class=tablz>'.$n3.' ('.$pr3.'%)</font></td></tr>
<tr><td bgcolor=#ee80ee align=center><font class=top5>íåïîðÿäîê</font></td><td bgcolor=#e8e8e8><font class=tablz>'.$n1.' ('.$pr1.'%)</font></td></tr>
<tr><td bgcolor=#775577 align=center><font class=top5>íåèñïðàâíîñòü</font></td><td bgcolor=#e8e8e8><font class=tablz>'.$n4.' ('.$pr4.'%)</font></td></tr>
<tr><td bgcolor=green align=center><font class=top5>íîðìàëüíî</font></td><td bgcolor=#e8e8e8><font class=tablz>'.$n0.' ('.$pr0.'%)</font></td></tr>';
?>
</table>
</td>
<td valign=top>
<table width=280px cellpadding=2 cellspacing=1 bgcolor=#664466 align=left>
<tr><td bgcolor=#ffcf68 align=center><font class=tablz>ïîêàçàòåëü</font></td><td bgcolor=#ffcf68 align=center><font class=tablz>èíäèêàòîð</font></td></tr>
<?php
$tarif2=12.41;
$tarif3=0.0467*537;
print '<tr><td bgcolor=#eeeeee align=center><font class=tablz>Ïîòðåáëåíèå ÕÂÑ, ãäå íå ïðîïèñàíû</font></td><td bgcolor=#e8e8e8><font class=top5>'.number_format($snab0,2).' ì3</font></td></tr>';
print '<tr><td bgcolor=#eeeeee align=center><font class=tablz>Ïîòðåáëåíèå ÃÂÑ, ãäå íå ïðîïèñàíû</font></td><td bgcolor=#e8e8e8><font class=top5>'.number_format($snab1,2).' ì3</font></td></tr>';
print '<tr><td bgcolor=#eeeeee align=center><font class=tablz>Ïîòðåáëåíèå ñâåðõ íîðìû ÕÂÑ àáîíåíòàìè</font></td><td bgcolor=#e8e8e8><font class=top5>'.number_format($spr0,2).' ì3</font></td></tr>';
print '<tr><td bgcolor=#eeeeee align=center><font class=tablz>Ïîòðåáëåíèå ñâåðõ íîðìû ÃÂÑ àáîíåíòàìè</font></td><td bgcolor=#e8e8e8><font class=top5>'.number_format($spr1,2).' ì3</font></td></tr>';
?>
</table>
</td>
</tr></table>
<table width=1200px cellpadding=2 cellspacing=1 bgcolor=#664466 align=center>
<tr>
<?php
include("config/local.php");
$arr = get_defined_vars();
$today=getdate();
$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);
print '<td bgcolor=#ffcf68 align=center width="20px"><font class=tablz><a href="index.html">N</a></font></td>';
print '<td bgcolor=#ffcf68 align=center><font class=tablz>Àáîíåíò</font></td>';
print '<td bgcolor=#ffcf68 align=center><font class=tablz>Ê</font></td>';
print '<td bgcolor=#ffcf68 colspan=2 align=center><font class=tablz>Võâñ</font></td>';
print '<td bgcolor=#ffcf68 colspan=2 align=center><font class=tablz>Vãâñ</font></td>';
print '<td bgcolor=#ffcf68 align=center width="20px"><font class=tablz><a href="index.html">N</a></font></td>';
print '<td bgcolor=#ffcf68 align=center><font class=tablz>Àáîíåíò</font></td>';
print '<td bgcolor=#ffcf68 align=center><font class=tablz>Ê</font></td>';
print '<td bgcolor=#ffcf68 colspan=2 align=center><font class=tablz>Võâñ</font></td>';
print '<td bgcolor=#ffcf68 colspan=2 align=center><font class=tablz>Vãâñ</font></td>';
print '<td bgcolor=#ffcf68 align=center width="20px"><font class=tablz><a href="index.html">N</a></font></td>';
print '<td bgcolor=#ffcf68 align=center><font class=tablz>Àáîíåíò</font></td>';
print '<td bgcolor=#ffcf68 align=center><font class=tablz>Ê</font></td>';
print '<td bgcolor=#ffcf68 colspan=2 align=center><font class=tablz>Võâñ</font></td>';
print '<td bgcolor=#ffcf68 colspan=2 align=center><font class=tablz>Vãâñ</font></td>';
print '<td bgcolor=#ffcf68 align=center width="20px"><font class=tablz><a href="index.html">N</a></font></td>';
print '<td bgcolor=#ffcf68 align=center><font class=tablz>Àáîíåíò</font></td>';
print '<td bgcolor=#ffcf68 align=center><font class=tablz>Ê</font></td>';
print '<td bgcolor=#ffcf68 colspan=2 align=center><font class=tablz>Võâñ</font></td>';
print '<td bgcolor=#ffcf68 colspan=2 align=center><font class=tablz>Vãâñ</font></td></tr>';
print '<tr><td bgcolor=#ffcf68 align=center width="20px"></td><td bgcolor=#ffcf68 align=center></td><td bgcolor=#ffcf68 align=center></td>';
print '<td bgcolor=#ffcf68 align=center><font class=tablz>ïîò</font></td>';
print '<td bgcolor=#ffcf68 align=center><font class=tablz>íîð</font></td>';
print '<td bgcolor=#ffcf68 align=center><font class=tablz>ïîò</font></td>';
print '<td bgcolor=#ffcf68 align=center><font class=tablz>íîð</font></td>';
print '<td bgcolor=#ffcf68 align=center width="20px"></td><td bgcolor=#ffcf68 align=center></td><td bgcolor=#ffcf68 align=center></td>';
print '<td bgcolor=#ffcf68 align=center><font class=tablz>ïîò</font></td>';
print '<td bgcolor=#ffcf68 align=center><font class=tablz>íîð</font></td>';
print '<td bgcolor=#ffcf68 align=center><font class=tablz>ïîò</font></td>';
print '<td bgcolor=#ffcf68 align=center><font class=tablz>íîð</font></td>';
print '<td bgcolor=#ffcf68 align=center width="20px"></td><td bgcolor=#ffcf68 align=center></td><td bgcolor=#ffcf68 align=center></td>';
print '<td bgcolor=#ffcf68 align=center><font class=tablz>ïîò</font></td>';
print '<td bgcolor=#ffcf68 align=center><font class=tablz>íîð</font></td>';
print '<td bgcolor=#ffcf68 align=center><font class=tablz>ïîò</font></td>';
print '<td bgcolor=#ffcf68 align=center><font class=tablz>íîð</font></td>';
print '<td bgcolor=#ffcf68 align=center width="20px"></td><td bgcolor=#ffcf68 align=center></td><td bgcolor=#ffcf68 align=center></td>';
print '<td bgcolor=#ffcf68 align=center><font class=tablz>ïîò</font></td>';
print '<td bgcolor=#ffcf68 align=center><font class=tablz>íîð</font></td>';
print '<td bgcolor=#ffcf68 align=center><font class=tablz>ïîò</font></td>';
print '<td bgcolor=#ffcf68 align=center><font class=tablz>íîð</font></td>';
print '</tr>';
?>
</tr>
<?php
$query = 'SELECT * FROM device WHERE type=2 GROUP BY flat ORDER BY flat';
$a = mysql_query ($query,$i);
$uy = mysql_fetch_row ($a); $cm=0; $all=0; $ssum0=$ssum1=$cold0=$hot0=0;
while ($uy)
{
$query = 'SELECT * FROM flats WHERE flat='.$uy[10];
$e = mysql_query ($query,$i);
$ui = mysql_fetch_row ($e);
$cm=$ui[1];
if ($flat[$cm]%4==1) print '<tr bgcolor=#e8e8e8>';
while (1)
if ($uy[21]==0)
{
if ($nab[$cm]==0 && $sum0[$cm]>1) { $n1=1; print '<td align=center bgcolor=#ee80ee><font class=top2>'.$flat[$cm].'</font></td>';
print '<td align=left bgcolor=#ee80ee><a href="lk_hour.php?flat='.$flat[$cm].'&obj='.$_GET["obj"].'&device='.$uy[1].'&n1='.$n1.'&st='.$st.'&fn='.$fn.'"><font class=top2>'.$abn[$cm].'</font></td>';break; }
if ($nab[$cm]==0 && $sum1[$cm]>1) { $n1=2; print '<td align=center bgcolor=#ee80ee><font class=top2>'.$flat[$cm].'</font></td>';
print '<td align=left bgcolor=#ee80ee><a href="lk_hour.php?flat='.$flat[$cm].'&obj='.$_GET["obj"].'&device='.$uy[1].'&n1='.$n1.'&st='.$st.'&fn='.$fn.'"><font class=top2>'.$abn[$cm].'</font></td>';break; }
if ($sum0[$cm]>($cold[$cm]+$cold[$cm])) { $n1=3; print '<td align=center bgcolor=#ee5544><font class=top2>'.$flat[$cm].'</font></td>';
print '<td align=left bgcolor=#ee5544><a href="lk_hour.php?flat='.$flat[$cm].'&obj='.$_GET["obj"].'&device='.$uy[1].'&n1='.$n1.'&st='.$st.'&fn='.$fn.'"><font class=top2>'.$abn[$cm].'</font></td>';break; }
if ($sum1[$cm]>($hot[$cm]+$hot[$cm])) { $n1=4; print '<td align=center bgcolor=#ee5544><font class=top2>'.$flat[$cm].'</font></td>';
print '<td align=left bgcolor=#ee5544><a href="lk_hour.php?flat='.$flat[$cm].'&obj='.$_GET["obj"].'&device='.$uy[1].'&n1='.$n1.'&st='.$st.'&fn='.$fn.'"><font class=top2>'.$abn[$cm].'</font></td>';break; }
if ($sum0[$cm]>$cold[$cm]) { $n1=5; print '<td align=center bgcolor=#eeee33><font class=top2>'.$flat[$cm].'</font></td>';
print '<td align=left bgcolor=#eeee33><a href="lk_hour.php?flat='.$flat[$cm].'&obj='.$_GET["obj"].'&device='.$uy[1].'&n1='.$n1.'&st='.$st.'&fn='.$fn.'"><font class=top2>'.$abn[$cm].'</font></td>';break; }
if ($sum1[$cm]>$hot[$cm]) { $n1=6; print '<td align=center bgcolor=#eeee33><font class=top2>'.$flat[$cm].'</font></td>';
print '<td align=left bgcolor=#eeee33><a href="lk_hour.php?flat='.$flat[$cm].'&obj='.$_GET["obj"].'&device='.$uy[1].'&n1='.$n1.'&st='.$st.'&fn='.$fn.'"><font class=top2>'.$abn[$cm].'</font></td>';break; }
if ($nab[$cm]>0 && $sum0[$cm]<0.1)
if ($uy[21]==0) { $n1=7; print '<td align=center bgcolor=#775577><font class=top2>'.$flat[$cm].'</font></td>';
print '<td align=left bgcolor=#775577><a href="lk_hour.php?flat='.$flat[$cm].'&obj='.$_GET["obj"].'&device='.$uy[1].'&n1='.$n1.'&st='.$st.'&fn='.$fn.'"><font class=top2>'.$abn[$cm].'</font></td>';break; }
if ($nab[$cm]>0 && $sum1[$cm]<0.1)
if ($uy[21]==0) { $n1=8; print '<td align=center bgcolor=#775577><font class=top2>'.$flat[$cm].'</font></td>';
print '<td align=left bgcolor=#775577><a href="lk_hour.php?flat='.$flat[$cm].'&obj='.$_GET["obj"].'&device='.$uy[1].'&n1='.$n1.'&st='.$st.'&fn='.$fn.'"><font class=top2>'.$abn[$cm].'</font></td>';break; }
print '<td align=center bgcolor=#eeeeee><font class=top2>'.$flat[$cm].'</font></td>';
print '<td align=left bgcolor=#eeeeee><a href="lk_hour.php?flat='.$flat[$cm].'&obj='.$_GET["obj"].'&device='.$uy[1].'&n1='.$n1.'&st='.$st.'&fn='.$fn.'"><font class=top2>'.$abn[$cm].'</font></td>';
$n1=0;
break;
}
else {
print '<td align=center bgcolor=#ffffff><font class=top2>'.$flat[$cm].'</font></td>';
print '<td align=left bgcolor=#ffffff>í/ó</font></td>';
break;
}
print '<td align=center bgcolor=#ffffff><font class=top2>'.$nab[$cm].'</font></td>';
print '<td align=center align=left bgcolor=#ffffff><font class=top2>'.number_format($sum0[$cm],2).'</font></td>';
print '<td align=center align=left bgcolor=#eeeeee><font class=top2>'.$cold[$cm].'</font></td>';
//print '</tr><tr><td></td><td></td><td></td>';
print '<td align=center align=left bgcolor=#ffffff><font class=top2>'.number_format($sum1[$cm],2).'</font></td>';
print '<td align=center align=left bgcolor=#eeeeee><font class=top2>'.$hot[$cm].'</font></td>';
if ($flat[$cm]%4==0) print '</tr>';
$cm++;
$uy = mysql_fetch_row ($a);
}
print '<td colspan=21 bgcolor=#e8e8e8></tr>';
?>
</table>
<br>
<table width=1200px cellpadding=2 cellspacing=1 bgcolor=#ffffff align=center>
<?php
$query = 'SELECT * FROM build WHERE build_id='.$_GET["obj"];
$a = mysql_query ($query,$i);
$uy = mysql_fetch_row ($a);
if ($uy[4])
for ($ent=1;$ent<=$uy[4];$ent++)
{
print '<tr><td><img width=1200 height=350 src="charts/barplots9.php?type=1&obj='.$_GET["obj"].'&n1='.$ent.'&st='.$st.'&fn='.$fn.'"></td></tr>';
}
?>