-
Notifications
You must be signed in to change notification settings - Fork 0
/
object_per2.php
100 lines (92 loc) · 4.78 KB
/
object_per2.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
<?php
print '<table><tr><td align=center class="m_separator">Íàçíà÷åíèå</td><td align=center class="menuitem">Îïðåäåëåíèå è ðàñ÷åò âîçìîæíîñòè âûñòàâèòü ïîñòàâùèêó â ñîîòâåñòâèè ñ äîãîâîðîì ôèíàíñîâûõ ïðåòåíçèé çà ïðè÷èíåííûé óùåðá</td></tr></table>';
print '<table border="0" cellpadding="0" cellspacing="0"><tbody>';
$query = 'SELECT * FROM objects WHERE id='.$_GET["id"];
$e = mysql_query ($query,$i);
if ($e) //$ui = mysql_fetch_row ($e);
$ui2 = mysql_fetch_array ($e, MYSQL_ASSOC);
if ($ui) $name=$ui[1];
$query = 'SELECT * FROM uprav WHERE id='.$ui2["uprav"];
$e2 = mysql_query ($query,$i);
if ($e2) $uo = mysql_fetch_row ($e2);
if ($uo) $uprav=$uo[1];
print '<tr><td align=center class="m_separator">Îò÷åò î ïåðåðûâàõ â ýíåðãîñíàáæåíèè çà '.$prevmonth.'</td></tr>';
print '<tr><td align=left>';
print '<table width="1200px">';
$query = 'SELECT * FROM devices WHERE object='.$_GET["id"];
$y = mysql_query ($query,$i);
if ($y) $uo = mysql_fetch_row ($y);
for ($day=1;$day<=31;$day++)
$hours[$mn][$day]=0;
$query = 'SELECT * FROM data WHERE type=1 AND value=0 AND prm=16 AND date>=20110101000000 AND source=2 AND device='.$uo[11];
$e = mysql_query ($query,$i);
if ($e) $ui = mysql_fetch_row ($e);
while ($ui)
{
$mon=$ui[2][5]*10+$ui[2][6];
$day=$ui[2][8]*10+$ui[2][9];
//echo $mon.' '.$day.'<br>';
$hours[$mon][$day]++;
$smon[$mon]++;
$ui = mysql_fetch_row ($e);
}
for ($day=1;$day<=31;$day++)
$hours2[$mn][$day]=0;
$query = 'SELECT * FROM data WHERE type=1 AND value=0 AND prm=13 AND date>=20110101000000 AND source=0 AND device='.$uo[11];
$e = mysql_query ($query,$i);
if ($e) $ui = mysql_fetch_row ($e);
while ($ui)
{
$mon=$ui[2][5]*10+$ui[2][6];
$day=$ui[2][8]*10+$ui[2][9];
//echo $mon.' '.$day.'<br>';
$hours2[$mon][$day]++;
$smon2[$mon]++;
$ui = mysql_fetch_row ($e);
}
for ($day=1;$day<=31;$day++)
$hours3[$mn][$day]=0;
$query = 'SELECT * FROM data WHERE type=1 AND value=0 AND prm=14 AND date>=20110101000000 AND source=0 AND device='.$uo[11];
$e = mysql_query ($query,$i);
if ($e) $ui = mysql_fetch_row ($e);
while ($ui)
{
$mon=$ui[2][5]*10+$ui[2][6];
$day=$ui[2][8]*10+$ui[2][9];
//echo $mon.' '.$day.'<br>';
$hours3[$mon][$day]++;
$smon3[$mon]++;
$ui = mysql_fetch_row ($e);
}
$dy=31;
if (!checkdate ($mn,31,$ye)) { $dy=30; }
if (!checkdate ($mn,30,$ye)) { $dy=29; }
if (!checkdate ($mn,29,$ye)) { $dy=28; }
print '<tr><td class="m_separator">Äàòà</td>';
for ($day=1;$day<=$dy;$day++)
print '<td class="m_separator">'.$day.'</td>';
print '<td class="m_separator">Âñåãî çà ìåñÿö</td></tr>';
print '<tr><td class="m_separator">Âîäà</td>';
for ($day=1;$day<=$dy;$day++)
if ($hours[$mn][$day]>=24) print '<td class="simple" align="center">24</td>';
else print '<td class="menuitem_bold" align="center">'.$hours[$mn][$day].'</td>';
print '<td class="m_separator">'.$smon[$mn].'</td></tr>';
print '<tr><td class="m_separator">Òåïëî</td>';
for ($day=1;$day<=$dy;$day++)
if ($hours2[$mn][$day]>=24) print '<td class="simple" align="center">24</td>';
else print '<td class="menuitem_bold" align="center">'.$hours2[$mn][$day].'</td>';
print '<td class="m_separator">'.$smon2[$mn].'</td></tr>';
print '<tr><td class="m_separator">Ý/ýíåðãèÿ</td>';
for ($day=1;$day<=$dy;$day++)
if ($hours3[$mn][$day]>=24) print '<td class="simple" align="center">24</td>';
else print '<td class="menuitem_bold" align="center">'.$hours3[$mn][$day].'</td>';
print '<td class="m_separator">'.$smon3[$mn].'</td></tr>';
print '</table></td></tr>';
print '</table>';
print '<table>';
if (!$smon[$mn] && !$smon2[$mn] && !$smon3[$mn]) print '<tr><td class="simple"><strong>Âûâîä:</strong><br>Ïåðåðûâîâ íå çàôèêñèðîâàíî</td></tr>';
else print '<tr><td class="simple"><strong>Âûâîä:</strong><br>Çàôèêñèðîâàíû ïåðåðûâû â ýíåðãîñíàáæåíèè</td></tr>';
print '<tr><td class="simple"><strong>Äîïóñòèìàÿ ïðîäîëæèòåëüíîñòü ïåðåðûâà ïîäà÷è õîëîäíîé âîäû:</strong><br>8 ÷àñîâ ñóììàðíî â òå÷åíèè 1 ìåñÿöà, 4 ÷àñà åäèíîâðåìåííî<br> Çà êàæäûé ÷àñ ïðåâûøåíèÿ äîïóñòèìîé ïðîäîëæèòåëüíîñòè ïåðåðûâà ïîäà÷è õîëîäíîé âîäû, èñ÷èñëåííîé ñóììàðíî çà ðàñ÷åòíûé ïåðèîä, â êîòîðîì ðàçìåð ïëàòû çà êîììóíàëüíóþ óñëóãó çà òàêîé ðàñ÷åòíûé ïåðèîä ñíèæàåòñÿ íà 0.15% ðàçìåðà ïëàòû çà òàêîé ðàñ÷åòíûé ïåðèîä.</td></tr>';
print '<tr><td class="simple"><strong>Ïåðåðûâû â òåïëîñíàáæåíèè:</strong><br> ñëó÷àÿõ ïåðåðûâîâ â òåïëîñíàáæåíèè "Ïîòðåáèòåëÿ" ïî âèíå "Ïîñòàâùèêà óñëóã", à òàêæå ïîäà÷è òåïëîâîé ýíåðãèè íåñîîòâåòñòâóþùåãî êà÷åñòâà çàôèêñèðîâàííîãî ìåòðîëîãè÷åñêè îñâèäåòåëüñòâîâàííûìè ïðèáîðàìè è ïðè íàëèèè äâóõñòîðîííåãî àêòà, "Ïîñòàâùèê óñëóã" âîçìåùàåò "Ïîòðåáèòåëþ" ïðè÷èíåííûé ðåàëüíûé óùåðá.</td></tr>';
print '</table>';
?>