-
Notifications
You must be signed in to change notification settings - Fork 0
/
ecm_pom2.php
155 lines (145 loc) · 8.52 KB
/
ecm_pom2.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
<?php
if ($_GET["post"]=='8')
{
$today=getdate();
if ($_GET["month"]=='') $mn=$today["mon"];
else $mn=$_GET["month"];
$tm=$dy=31;
if (!checkdate ($mn,31,$ye)) { $dy=30; }
if (!checkdate ($mn,30,$ye)) { $dy=29; }
if (!checkdate ($mn,29,$ye)) { $dy=28; }
for ($tn=1; $tn<=$dy; $tn++)
for ($tn=1; $tn<=$dy; $tn++)
{
$f=$tn.'-1';
//if (is_array($_REQUEST)) foreach(array_keys($_REQUEST) as $var_to_kill)
if (is_array($_POST))
foreach ($_POST as $key => $var)
if (isset($_POST[$key]) && $var === $_POST[$key])
echo 'found '.$key.' = '.$var."\n";
}
}
?>
<td align="left" valign="top" width="200">
<table border="0" cellpadding="0" cellspacing="0" width="200">
<tbody><tr>
<td bgcolor="#1881b6" nowrap="nowrap" height="20" valign="middle" width="11"><img src="files/icons_featured_co.gif" height="17" hspace="1" vspace="1" width="20"></td>
<td class="BlockHeaderLeftRight" height="20" width="148"> <span id="IndicesLbl">Ìåñÿö</span></td>
<td class="vdots" width="1"></td></tr>
<?php
$today=getdate();
if ($_GET["year"]=='') $ye=$today["year"];
else $ye=$_GET["year"];
if ($_GET["month"]=='') $mn=$today["mon"];
else $mn=$_GET["month"];
for ($pm=1; $pm<=12; $pm++)
{
$date=sprintf ("%d%02d%02d000000",$ye,$pm,1);
$date2=sprintf ("%d%02d%02d000000",2010,$pm,1);
$month=$pm; include ("time.inc");
if ($pm==$mn) print '<tr><td align="center" style="font-family: Verdana; font-size: xx-small; color: #006995"><img alt="" src="files/SideArrow.gif" hspace="3"></td><td bgcolor="#dedede"> <a class="clickablebluetext" href="index.php?sel=ecm_pom2&month='.$pm.'&object='.$_GET["object"].'">'.$month.', '.$ye.'</a></td><td class="vdots"></td></tr>';
else print '<tr><td align="center" style="font-family: Verdana; font-size: xx-small; color: #006995"><img alt="" src="files/SideArrow.gif" hspace="3"></td><td> <a class="clickablebluetext" href="index.php?sel=ecm_pom2&month='.$pm.'&object='.$_GET["object"].'">'.$month.', '.$ye.'</a></td><td class="vdots"></td></tr>';
}
?>
</table><br>
<table id="Table1" border="0" cellpadding="0" cellspacing="0" width="200">
<tbody><tr>
<td bgcolor="#1881b6" nowrap="nowrap" height="20" valign="middle" width="21"><img src="files/icons_featured_co.gif" height="17" hspace="1" vspace="1" width="20"></td>
<td class="BlockHeaderLeftRight" height="20" width="178"> <span id="IndicesLbl">Îáúåêòû</span></td>
<td class="vdots" width="1"></td></tr>
<?php
$query = 'SELECT * FROM objects';
$e = mysql_query ($query,$i);
if ($e) $ui = mysql_fetch_row ($e);
while ($ui)
{
if ($ui[0]==$_GET["object"]) print '<tr style="font-family: Verdana; font-size: xx-small;"><td colspan=3 style="padding-left:5px" bgcolor="#dedede"><a href="index.php?sel=ecm_pom2&month='.$_GET["month"].'&object='.$ui[0].'" onmouseover="arrowOn(this);" onmouseout="arrowOff(this);">'.$ui[1].'</a></td></tr>';
else print '<tr style="font-family: Verdana; font-size: xx-small;"><td colspan=3 style="padding-left:5px"><a href="index.php?sel=ecm_pom2&month='.$_GET["month"].'&object='.$ui[0].'" onmouseover="arrowOn(this);" onmouseout="arrowOff(this);">'.$ui[1].'</a></td></tr>';
print '<tr><td colspan="3" style="height:5px"></td></tr>';
$ui = mysql_fetch_row ($e);
}
?>
</table></td>
<td style="padding-right: 3px; padding-left: 1px; margin-left: 1px; margin-right: 3px;" align="left" valign="top" width="100%">
<form name="frm9" method="post" action="index.php?sel=ecm_pom&month='.$_GET["month"].'&object='.$_GET["object"].'">
<input name="post" type="hidden" value="8">
<?php
$query = 'SELECT * FROM objects WHERE id='.$_GET["object"];
$e = mysql_query ($query,$i);
if ($e) $ui = mysql_fetch_row ($e);
print '<table border="0" cellpadding="0" cellspacing="0" style="padding-left:5px" width="800px">
<tr><td>ÓÒÂÅÐÆÄÀÞ</td><td width="100px"></td><td>ÓÒÂÅÐÆÄÀÞ</td></tr>
<tr><td>Äèðåêòîð ÎÎÎ "ÞÀÈÇ-ÏÔÈ"</td><td></td><td>Äèðåêòîð ÎÎÎ ÈÏÊ "Òåõíîëîãèè ýíåðãîñáåðåæåíèÿ"</td></tr>
<tr><td colspan="3" style="height:20px"></td></tr>
<tr><td>_______________ Ï.Þ. Ñèíåîê</td><td></td><td>________________ È.È. Êóðíàêîâ</td></tr>
<tr><td>"___"________________201___ ãîä</td><td></td><td>"___"________________201___ ãîä</td></tr>
<tr><td colspan="3"></td></tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="800px">
<tr><td style="height:40px"></td></tr>
<tr><td align="center"><font class="head4">Äàííûå ìîíèòîðèíãà ðàáîòû ñèñòåì îòîïëåíèÿ ïî ïîìåùåíèÿì ÎÎÎ "ÞÀÈÇ-ÏÔÈ" ïîñëå íà÷àëà ðåàëèçàöèè ýíåðãîñáåðåãàþùåãî ïðîåêòà</td></tr>
<tr><td style="height:40px"></td></tr>
</table>
<table border="0" cellpadding="1" cellspacing="1" style="background-color: #ffffff" align="left" width="800px">
<tr class="BlockHeaderLeftRight" align="left"><td colspan="8">Íàèìåíîâàíèå ïîìåùåíèÿ: '.$ui[1].'</td></tr>
<tr class="BlockHeaderLeftRight" align="left"><td colspan="8">Òèï óñòàíîâëåííûõ îòîïèòåëüíûõ ïðèáîðîâ: '.$ui[7].'</td></tr>
<tr class="BlockHeaderLeftRight" align="center"><td>Äàòà</td><td colspan="2">Òåìïåðàòóðà</td><td colspan="3">Ðàñõîä</td><td>Íàðàáîòêà âåíòèëÿòîðîâ</td><td>Íàðàáîòêà ãîðåëîê</td></tr>
<tr align="center"><td class="simple"></td><td class="simple">óëèöà</td><td class="simple">âíóòðè</td><td class="simple">ÝÝ</td><td class="simple">Ãàç</td><td class="simple">Âîäà</td><td class="simple"></td><td class="simple"></td></tr>';
$tm=$dy=31;
if (!checkdate ($mn,31,$ye)) { $dy=30; }
if (!checkdate ($mn,30,$ye)) { $dy=29; }
if (!checkdate ($mn,29,$ye)) { $dy=28; }
for ($tn=1; $tn<=$dy; $tn++)
{
$data1=$data2=$data3=$data4=$data5=$data6=$data7='';
$date1=sprintf ("%d%02d%02d000000",$ye,$mn,$tn);
$query = 'SELECT * FROM devices WHERE type=11 AND object='.$_GET["object"];
$a = mysql_query ($query,$i);
if ($a)
while ($uy = mysql_fetch_row ($a))
{
$query = 'SELECT * FROM channels WHERE device='.$uy[11];
$a2 = mysql_query ($query,$i);
if ($a2) $uy2 = mysql_fetch_row ($a2);
while ($uy2 = mysql_fetch_row ($a2))
{
$query = 'SELECT * FROM data WHERE type=2 AND date='.$date1.' AND channel='.$uy2[0];
if ($a3 = mysql_query ($query,$i))
while ($uy3 = mysql_fetch_row ($a3))
{
if ($uy3[8]=='4' && $uy3[6]=='0') { $data2=$uy3[3]; $chan2=$uy3[0]; }
if ($uy3[8]=='11' && $uy3[6]=='2') { $data4=$uy3[3]; $chan4=$uy3[0]; }
if ($uy3[8]=='12' && $uy3[6]=='0') { $data5=$uy3[3]; $chan5=$uy3[0]; }
if ($uy3[8]=='14' && $uy3[6]=='0') { $data3=$uy3[3]; $chan3=$uy3[0]; }
if ($uy3[8]=='2' && $uy3[6]=='0') { $data6+=$uy3[3]; $data7+=$uy3[3]; $chan4=$uy3[0]; }
if ($uy3[8]=='2' && $uy3[6]=='0') { $data6+=$uy3[3]; $data7+=$uy3[3]; $chan4=$uy3[0]; }
}
}
}
$query = 'SELECT * FROM data WHERE type=2 AND date='.$date1.' AND value<50 AND channel=604';
//echo $query;
if ($a3 = mysql_query ($query,$i))
if ($uy3 = mysql_fetch_row ($a3)) $data1=$uy3[3];
$date2=sprintf ("%02d-%02d-%d",$tn,$mn,$ye);
print '<tr><td class="BlockHeaderLeftRight" align="center">'.$date2.'</td>
<td class="simple"><input name="'.$tn.'-'.$chan1.'" class="simple2" value="'.number_format($data1,2).'"></td>
<td class="simple"><input name="'.$tn.'-'.$chan2.'" class="simple2" value="'.number_format($data2,3).'"></td>
<td class="simple"><input name="'.$tn.'-'.$chan3.'" class="simple2" value="'.number_format($data3,3).'"></td>
<td class="simple"><input name="'.$tn.'-'.$chan4.'" class="simple2" value="'.number_format($data4,3).'"></td>
<td class="simple"><input name="'.$tn.'-'.$chan5.'" class="simple2" value="'.number_format($data5,3).'"></td>
<td class="simple"><input name="'.$tn.'-'.$chan6.'" class="simple2" value="'.number_format($data6,3).'"></td>
<td class="simple"><input name="'.$tn.'-'.$chan7.'" class="simple2" value="'.number_format($data7,3).'"></td></tr>';
}
print '<table border="0" cellpadding="5" cellspacing="0" width="800px">
<tr><td style="height:20px"></td></tr>
<tr><td align="left"><font class="head4">Ñîãëàñîâàíî:</font></td></tr>
<tr><td style="height:20px"></td></tr>
<tr><td align="left"><font class="head4">Ïðåäñòàâèòåëü Çàêàç÷èêà _____________________ÔÈÎ</font></td></tr>
<tr><td align="left"><font class="head4">Ïðåäñòàâèòåëü Èñïîëíèòåëÿ __________________ÔÈÎ</font></td></tr>
<tr><td align="left"><font class="head4">Ìåíåäæåð ïðîåêòà __________________________ÔÈÎ</font></td></tr>
<tr><td style="height:20px"></td></tr>
<tr><td style="height:20px"><input name="add" value="ñîõðàíèòü" type="submit" style="width:111; height:22px;"></td></tr>
</table>';
?>
</form>
</td></tr></tbody></table></td>