-
Notifications
You must be signed in to change notification settings - Fork 0
/
object_raspheat2.php
73 lines (67 loc) · 4.24 KB
/
object_raspheat2.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
<?php
print '<table border="0" cellpadding="2" cellspacing="0"><tbody><tr><td align="center" colspan=2><h1>Àíàëèç ýôôåêòèâíîñòè ïîòðåáëåíèÿ òåïëîâîé ýíåðãèè ïî äíÿì íåäåëè çà '.$prevmonth.' (ÃÊàë)(Ñðåäíÿÿ âåëè÷èíà)</h1></td></tr></table>
<table><tr><td align="center" class="m_separator">Íàçíà÷åíèå</td><td align=center class="menuitem">Îöåíêà âîçìîæíîñòè äîïîëíèòåëüíîé ýêîíîìèè òåïëîâîé ýíåðãèè â âûõîäíûå è ïðàçäíè÷íûå äíè</td></tr></table>
<table border="0" cellpadding="2" cellspacing="0"><tbody><tr><td>
<table border="0" cellpadding="2" cellspacing="2"><tbody>
<tr><td><img src="charts/barplot_hourly.php?size=1&dev='.$device.'&type=6&year='.$ye.'&month='.$mn.'"></td></tr>
<tr><td></td></tr>
<tr><td>';
$today=getdate();
if ($_GET["year"]=='') $_GET["year"]=$today["year"];
if ($_GET["month"]=='') $_GET["month"]=$today["mon"]-1;
$sts=sprintf("%d%02d01000000",$_GET["year"],$_GET["month"]);
$fns=sprintf("%d%02d01000000",$_GET["year"],$_GET["month"]+1);
if (!$tarif_teplo) $tarif_teplo=1154.63;
for ($hr=0;$hr<=6;$hr++)
{
if ($_GET["src"]=='') $query = 'SELECT SUM(value),COUNT(id) FROM data WHERE type=2 AND prm=13 AND source=2 AND value>0 AND value<50 AND date>'.$sts.' AND date<'.$fns.' AND WEEKDAY(date)='.$hr;
if ($_GET["dev"]!='') $query = 'SELECT SUM(value),COUNT(id) FROM data WHERE type=2 AND device='.$device.' AND prm=13 AND source=2 AND value>0 AND value<50 AND date>'.$sts.' AND date<'.$fns.' AND WEEKDAY(date)='.$hr;
$a = mysql_query ($query,$i);
if ($a) $uy = mysql_fetch_row ($a);
if ($uy[1]) $data[$hr]=$uy[0]/$uy[1]-$data2;
if ($hr==0) $dat[$hr]='ïîíåäåëüíèê';
if ($hr==1) $dat[$hr]='âòîðíèê';
if ($hr==2) $dat[$hr]='ñðåäà';
if ($hr==3) $dat[$hr]='÷åòâåðã';
if ($hr==4) $dat[$hr]='ïÿòíèöà';
if ($hr==5) $dat[$hr]='ñóááîòà';
if ($hr==6) $dat[$hr]='âîñêðåñåíüå';
if ($hr>=5) $dt1+=$uy[0];
if ($hr<=4) $avg+=$data[$hr];
if ($hr<=4) $t1+=$data[$hr]; else $t2+=$data[$hr];
}
$avg/=5;
if ($t1+$t2>0) $pr1=number_format($t2*100/($t1+$t2),2);
else $pr1='-';
for ($hr=0;$hr<=6;$hr++) $avgg[$hr]=$avg;
print '<table cellpadding="2" cellspacing="1"><tr><td class="m_separator"></td>';
for ($hr=0;$hr<=6;$hr++) print '<td class="m_separator">'.$dat[$hr].'</td>';
print '</tr><tr align="center"><td class="m_separator">Ôàêò</td>';
for ($hr=0;$hr<=6;$hr++) print '<td class="simple">'.number_format($data[$hr],3).'</td>';
print '</tr><tr align="center"><td class="m_separator">Ñð.âåë.</td>';
for ($hr=0;$hr<=6;$hr++) print '<td class="simple">'.number_format($avg,3).'</td>';
print '</tr><tr align="center"><td class="m_separator">Ýêîíîìèÿ</td>';
for ($hr=0;$hr<=6;$hr++) print '<td class="simple">'.number_format($data[$hr]-$avg,3).'</td>';
print '</tr></table>';
print '</td></tr>
<tr><td></td></tr>
</tbody></table></td>
<td>
<table border="0" cellpadding="2" cellspacing="2"><tbody>
<tr><td>Òàðèô íà òåïëîâóþ ýíåðãèþ '.$tarif_teplo.' ðóá. ñ ÍÄÑ</td></tr>
<tr><td>
<table cellpadding="2" cellspacing="1"><tr><td class="m_separator"></td>
<td class="m_separator">Áóäíèå äíè</td><td class="m_separator">Âûõîäíûå è ïðàçäíè÷íûå äíè</td><td class="m_separator">Âñåãî</td></tr>
<tr><td class="m_separator">Èòîãî çà ìåñÿö</td>
<td class="m_separator">'.number_format($t1,4).'</td><td class="m_separator">'.number_format($t2,4).'</td><td class="m_separator">'.number_format($t1+$t2,2).'</td>
</tr></table>
</td></tr>
<tr><td class="m_separator">Âûâîä:</td></tr>
<tr><td> äàííîì ÌÓ ïîòðåáëåíèå òåïëà â âûõîäíûå è ïðàçäíè÷íûå äíè ñîñòàâëÿåò '.$pr1.'% îò îáùåãî îáúåìà ïîòðåáëåíèÿ. Ïðîâîäèòñÿ ðó÷íîå ðåãóëèðîâàíèå ïîòðåáëåíèÿ òåïëà â âûõîäíûå è ïðàçäíè÷íûå äíè, ÷òî ïîçâîëÿåò ñýêîíîìèòü '.$t2.'ÃÊàë='.number_format($tarif_teplo*$t2,2).'ðóá. â ìåñÿö</td></tr>
<tr><td class="m_separator">Ðåêîìåíäàöèè:</td></tr>
<tr><td>Àíàëèç ïîçâîëÿåò âûÿâèòü ðåçåðâû ýêîíîìèè òåïëîâîé ýíåðãèè â âûõîäíûå è ïðàçäíè÷íûå äíè, äëÿ ÷åãî ñëåäóåò ïðîâåñòè îáñëåäîâàíèå ñèñòåìû îòîïëåíèÿ è ðàçðàáîòàòü ìåðîïðèÿòèÿ ïî ñíèæåíèþ ïîòðåáëåíèÿ â íåðàáî÷åå âðåìÿ.</td></tr>
</table>
</td></tr>
<tr><td class="simple" colspan="2"><strong>Ðåêîìåíäàöèè:</strong><br>Íåîáõîäèìî îðãàíèçîâàòü ðàçäåëüíûé ó÷åò òåïëîâîé ýíåðãèè íà îòîïëåíèå è ÃÂÑ</td></tr>
</tbody></table>';
?>