-
Notifications
You must be signed in to change notification settings - Fork 0
/
ecm_ecog.php
300 lines (265 loc) · 13.2 KB
/
ecm_ecog.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
<?php
if ($_GET["type"]=='')
{
print '<table id="Table8" align="center" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr><td class="BlockHeaderMiddle" style="padding-left: 22px;" align="left" height="20" valign="center"><span id="Label5">Ðàñ÷åò ýêîíîìè÷åñêîãî ýôôåêòà äëÿ ìåðîïðèÿòèÿ</span></td></tr>
<tr><td align="center" bgcolor="#e8f0f5" valign="middle">
<table>
<tr><td width="1000px">
<table border="0" cellpadding="2" cellspacing="2"><tbody>'; $cn=0;
$today=getdate();
if ($_GET["year"]=='') $ye=$today["year"];
else $ye=$_GET["year"];
if ($_GET["month"]=='') $mn=$today["mon"];
else $mn=$_GET["month"];
$tarif1=1.7; $tarif2=776; $tarif3=2282;
for ($pm=1; $pm<=12; $pm++)
{
$tm=$dy=31;
if (!checkdate ($mn,31,$ye)) { $dy=30; }
if (!checkdate ($mn,30,$ye)) { $dy=29; }
if (!checkdate ($mn,29,$ye)) { $dy=28; }
$hr1[$cn]=$dy*24-rand(0,250);
$hr0[$cn]=$dy*24-$hr1[$cn];
$data1[$cn]=rand(300000,450000)/100;
$data3[$cn]=rand(400000,550000)/100;
$data0[$cn]=rand(200000,300000)/5000;
$data2[$cn]=rand(240000,350000)/50000;
$t1[$cn]=95;
$t2[$cn]=rand(9000,10500)/100;
$t3[$cn]=rand(9200,11500)/100;
$ithr1+=$hr1[$cn];
$ithr0+=$hr0[$cn];
$at1+=$t1[$cn]; $at2+=$t2[$cn]; $at3+=$t3[$cn];
if ($t3[$cn]>$t2[$cn]) $qual[$cn]=100+($t3[$cn]-$t2[$cn])*100/$t3[$cn];
else $qual[$cn]=100+($t3[$cn]-$t2[$cn])*100/$t3[$cn];
$eco[$cn]=($data1[$cn]-$data3[$cn])*$tarif1+$data0[$cn]*$tarif2+$data2[$cn]*$tarif3;
$it0+=$data0[$cn]; $it1+=$data1[$cn]; $it2+=$data2[$cn]; $it3+=$data3[$cn];
$itqual+=$qual[$cn]; $iteco+=$eco[$cn];
$tm=$pm;
include ("time.inc");
$dats[$cn]=$dat[$cn];
$req.='dat'.$cn.'='.$dat[$cn].'&';
$req.='da'.$cn.'='.number_format($data1[$cn]*$tarif1,0).'&';
$req.='db'.$cn.'='.number_format($data0[$cn]*$tarif2,0).'&';
$req.='dc'.$cn.'='.number_format($data3[$cn]*$tarif1,0).'&';
$req.='dd'.$cn.'='.number_format($data2[$cn]*$tarif3,0).'&';
$cn++;
}
$at1=$at1/12; $at2=$at2/12; $at3=$at3/12;
print '<tr class="BlockHeaderLeftRight" align="center"><td>Ìåñÿö</td><td colspan="2">×àñîâ ðàáîòû / íåðàá.</td>
<td colspan="2">Äî ïðîâåäåíèÿ ÝÑÌ</td>
<td colspan="2">Ïîñëå ïðîâåäåíèÿ ÝÑÌ</td>
<td colspan="3">Òåõíîëîãè÷åñêèå ïàðàìåòðû</td>
<td>Êà÷åñòâåííàÿ îöåíêà</td><td>Ýêîíîìèÿ</td></tr>';
print '<tr class="BlockHeaderLeftRight" align="center"><td></td><td>÷àñ.</td><td>÷àñ.</td><td class="BlockHeaderLeftRight">Ýëåêòðîýíåðãèÿ, êÂò</td><td class="BlockHeaderLeftRight">Ïàð, ò.ì3</td>
<td class="BlockHeaderLeftRight">Ýëåêòðîýíåðãèÿ, êÂò</td><td class="BlockHeaderLeftRight">Ãàç, ò.ì3</td>
<td>Tíîðì</td><td>Tïàð</td><td>Tòåê</td>
<td>% íîðì</td><td>ðóá.</td></tr>';
for ($pm=0; $pm<=11; $pm++)
{
print '<tr><td class="BlockHeaderLeftRight"><a href="index.php?sel=ecm&id='.$_GET["id"].'&type=2&month='.$pm.'" style="color:#ffffff">'.$dats[$pm].'</a></td>
<td class="simple">'.$hr1[$pm].'</td>
<td class="simple">'.$hr0[$pm].'</td>
<td class="simple">'.$data1[$pm].'</td>
<td class="simple">'.$data0[$pm].'</td>
<td class="simple">'.$data3[$pm].'</td>
<td class="simple">'.$data2[$pm].'</td>
<td class="simple">'.$t1[$pm].'</td>
<td class="simple">'.$t2[$pm].'</td>
<td class="simple">'.$t3[$pm].'</td>
<td class="simple">'.number_format($qual[$pm],2).'</td>
<td class="simple">'.number_format($eco[$pm],2).'</td></tr>';
}
print '<tr><td class="BlockHeaderLeftRight">Èòîãî/Ñð.</td>
<td class="BlockHeaderLeftRight">'.$ithr1.'</td>
<td class="BlockHeaderLeftRight">'.$ithr0.'</td>
<td class="BlockHeaderLeftRight">'.$it1.'</td>
<td class="BlockHeaderLeftRight">'.$it0.'</td>
<td class="BlockHeaderLeftRight">'.$it3.'</td>
<td class="BlockHeaderLeftRight">'.$it2.'</td>
<td class="BlockHeaderLeftRight">'.number_format($at1,2).'</td>
<td class="BlockHeaderLeftRight">'.number_format($at2,2).'</td>
<td class="BlockHeaderLeftRight">'.number_format($at3,2).'</td>
<td class="BlockHeaderLeftRight">'.$itqual1.'</td>
<td class="BlockHeaderLeftRight">'.number_format($iteco,2).'</td></tr>';
print '</table></td></tr><tr><td><img src="charts/barplots38.php?'.$req.'"></td></tr>';
}
if ($_GET["type"]=='2')
{
if ($_GET["month"]=='') $_GET["month"]=1;
$month=$_GET["month"]+1; include ("time.inc");
print '<table id="Table8" align="center" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr><td class="BlockHeaderMiddle" style="padding-left: 22px;" align="left" height="20" valign="center"><span id="Label5">Ðàñ÷åò ýêîíîìè÷åñêîãî ýôôåêòà äëÿ ìåðîïðèÿòèÿ çà '.$month.'</span></td></tr>
<tr><td align="center" valign="middle">
<table>
<tr><td width="1000px">
<table border="0" cellpadding="2" cellspacing="2"><tbody>'; $cn=0;
$today=getdate();
if ($_GET["year"]=='') $ye=$today["year"];
else $ye=$_GET["year"];
if ($_GET["month"]=='') $mn=$today["mon"];
else $mn=$_GET["month"];
$tarif1=1.7; $tarif2=776; $tarif3=2282;
$tm=1; $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++)
{
$date1=sprintf ("%d%02d%02d000000",$ye,$mn,$tn);
$date2=sprintf ("%02d-%02d",$mn,$tn);
$dats[$cn]=sprintf ("%02d-%02d-%d",$tn,$mn,$ye);
$hr1[$cn]=24-rand(0,5);
$hr0[$cn]=24-$hr1[$cn];
$data1[$cn]=rand(300000,450000)/(100*$dy);
$data3[$cn]=rand(400000,550000)/(100*$dy);
$data0[$cn]=rand(200000,300000)/(5000*$dy);
$data2[$cn]=rand(240000,350000)/(50000*$dy);
$t1[$cn]=95;
$t2[$cn]=rand(9000,10500)/100;
$t3[$cn]=rand(9200,11500)/100;
$ithr1+=$hr1[$cn];
$ithr0+=$hr0[$cn];
$at1+=$t1[$cn]; $at2+=$t2[$cn]; $at3+=$t3[$cn];
if ($t3[$cn]>$t2[$cn]) $qual[$cn]=100+($t3[$cn]-$t2[$cn])*100/$t3[$cn];
else $qual[$cn]=100+($t3[$cn]-$t2[$cn])*100/$t3[$cn];
$eco[$cn]=($data1[$cn]-$data3[$cn])*$tarif1+$data0[$cn]*$tarif2+$data2[$cn]*$tarif3;
$it0+=$data0[$cn]; $it1+=$data1[$cn]; $it2+=$data2[$cn]; $it3+=$data3[$cn];
$itqual+=$qual[$cn]; $iteco+=$eco[$cn];
$req.='dat'.$cn.'='.$date2.'&';
$req.='da'.$cn.'='.number_format($data1[$cn]*$tarif1,0).'&';
$req.='db'.$cn.'='.($data0[$cn]*$tarif2).'&';
$req.='dc'.$cn.'='.number_format($data3[$cn]*$tarif1,0).'&';
$req.='dd'.$cn.'='.number_format($data2[$cn]*$tarif3,0).'&';
$cn++;
}
$at1=$at1/$dy; $at2=$at2/$dy; $at3=$at3/$dy;
print '<tr class="BlockHeaderLeftRight" align="center"><td>Äåíü</td><td colspan="2">×àñîâ ðàáîòû / íåðàá.</td>
<td colspan="2">Äî ïðîâåäåíèÿ ÝÑÌ</td>
<td colspan="2">Ïîñëå ïðîâåäåíèÿ ÝÑÌ</td>
<td colspan="3">Òåõíîëîãè÷åñêèå ïàðàìåòðû</td>
<td>Êà÷åñòâåííàÿ îöåíêà</td><td>Ýêîíîìèÿ</td></tr>';
print '<tr class="BlockHeaderLeftRight" align="center"><td></td><td>÷àñ.</td><td>÷àñ.</td><td class="BlockHeaderLeftRight">Ýëåêòðîýíåðãèÿ, êÂò</td><td class="BlockHeaderLeftRight">Ïàð, ò.ì3</td>
<td class="BlockHeaderLeftRight">Ýëåêòðîýíåðãèÿ, êÂò</td><td class="BlockHeaderLeftRight">Ãàç, ò.ì3</td>
<td>Tíîðì</td><td>Tïàð</td><td>Tòåê</td>
<td>% íîðì</td><td>ðóá</td></tr>';
for ($pm=0; $pm<$dy; $pm++)
{
$day=$pm+1;
print '<tr align="center"><td class="BlockHeaderLeftRight"><a href="index.php?sel=ecm&id='.$_GET["id"].'&type=1&month='.$_GET["month"].'&day='.$day.'" style="color:#ffffff">'.$dats[$pm].'</a></td>
<td class="simple">'.$hr1[$pm].'</td>
<td class="simple">'.$hr0[$pm].'</td>
<td class="simple">'.number_format($data1[$pm],2).'</td>
<td class="simple">'.number_format($data0[$pm],2).'</td>
<td class="simple">'.number_format($data3[$pm],2).'</td>
<td class="simple">'.number_format($data2[$pm],2).'</td>
<td class="simple">'.$t1[$pm].'</td>
<td class="simple">'.$t2[$pm].'</td>
<td class="simple">'.$t3[$pm].'</td>
<td class="simple">'.number_format($qual[$pm],2).'</td>
<td class="simple">'.number_format($eco[$pm],2).'</td></tr>';
}
print '<tr><td class="BlockHeaderLeftRight">Èòîãî/Ñð.</td>
<td class="BlockHeaderLeftRight">'.$ithr1.'</td>
<td class="BlockHeaderLeftRight">'.$ithr0.'</td>
<td class="BlockHeaderLeftRight">'.number_format($it1,2).'</td>
<td class="BlockHeaderLeftRight">'.number_format($it0,2).'</td>
<td class="BlockHeaderLeftRight">'.number_format($it3,2).'</td>
<td class="BlockHeaderLeftRight">'.number_format($it2,2).'</td>
<td class="BlockHeaderLeftRight">'.number_format($at1,2).'</td>
<td class="BlockHeaderLeftRight">'.number_format($at2,2).'</td>
<td class="BlockHeaderLeftRight">'.number_format($at3,2).'</td>
<td class="BlockHeaderLeftRight">'.$itqual1.'</td>
<td class="BlockHeaderLeftRight">'.number_format($iteco,2).'</td></tr>';
print '</table></td></tr><tr><td><img src="charts/barplots38.php?'.$req.'"></td></tr>';
}
if ($_GET["type"]=='1')
{
$month=$_GET["month"]+1; include ("time.inc");
print '<table id="Table8" align="center" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr><td class="BlockHeaderMiddle" style="padding-left: 22px;" align="left" height="20" valign="center"><span id="Label5">Ðàñ÷åò ýêîíîìè÷åñêîãî ýôôåêòà äëÿ ìåðîïðèÿòèÿ çà '.$_GET["day"].' '.$month.'</span></td></tr>
<tr><td align="center" valign="middle">
<table>
<tr><td width="1000px">
<table border="0" cellpadding="2" cellspacing="2"><tbody>'; $cn=0;
$today=getdate();
if ($_GET["year"]=='') $ye=$today["year"];
else $ye=$_GET["year"];
if ($_GET["month"]=='') $mn=$today["mon"];
else $mn=$_GET["month"];
if ($_GET["day"]=='') $dy=$today["days"];
else $dy=$_GET["day"];
$tarif1=1.7; $tarif2=776; $tarif3=2282;
for ($tn=0; $tn<=23; $tn++)
{
$date1=sprintf ("%d%02d%02d%02d0000",$ye,$mn,$dy,$tn);
$date2=sprintf ("%02d-%02d %02d:00",$dy,$mn,$tn);
$dats[$cn]=sprintf ("%02d:00",$tn);
$hr1[$cn]=number_format(rand(40,129)/100,0);
$hr0[$cn]=1-$hr1[$cn];
$data1[$cn]=rand(300000,450000)/(100*$dy*24);
$data3[$cn]=rand(400000,550000)/(100*$dy*24);
$data0[$cn]=rand(200000,300000)/(5000*$dy*24);
$data2[$cn]=rand(240000,350000)/(50000*$dy*24);
$t1[$cn]=95;
$t2[$cn]=rand(10000,10500)/100;
$t3[$cn]=rand(10200,11500)/100;
$ithr1+=$hr1[$cn];
$ithr0+=$hr0[$cn];
$at1+=$t1[$cn]; $at2+=$t2[$cn]; $at3+=$t3[$cn];
if ($t3[$cn]>$t2[$cn]) $qual[$cn]=100+($t3[$cn]-$t2[$cn])*100/$t3[$cn];
else $qual[$cn]=100+($t3[$cn]-$t2[$cn])*100/$t3[$cn];
$eco[$cn]=($data1[$cn]-$data3[$cn])*$tarif1+$data0[$cn]*$tarif2+$data2[$cn]*$tarif3;
$it0+=$data0[$cn]; $it1+=$data1[$cn]; $it2+=$data2[$cn]; $it3+=$data3[$cn];
$itqual+=$qual[$cn]; $iteco+=$eco[$cn];
$req.='dat'.$cn.'='.$dats[$cn].'&';
$req.='da'.$cn.'='.number_format($data1[$cn]*$tarif1,0).'&';
$req.='db'.$cn.'='.($data0[$cn]*$tarif2).'&';
$req.='dc'.$cn.'='.number_format($data3[$cn]*$tarif1,0).'&';
$req.='dd'.$cn.'='.number_format($data2[$cn]*$tarif3,0).'&';
$cn++;
}
$at1=$at1/24; $at2=$at2/24; $at3=$at3/24;
print '<tr class="BlockHeaderLeftRight" align="center"><td>×àñ</td><td colspan="2">×àñîâ ðàáîòû / íåðàá.</td>
<td colspan="2">Äî ïðîâåäåíèÿ ÝÑÌ</td>
<td colspan="2">Ïîñëå ïðîâåäåíèÿ ÝÑÌ</td>
<td colspan="3">Òåõíîëîãè÷åñêèå ïàðàìåòðû</td>
<td>Êà÷åñòâåííàÿ îöåíêà</td><td>Ýêîíîìèÿ</td></tr>';
print '<tr class="BlockHeaderLeftRight" align="center"><td></tdÄåíü><td>÷àñ.</td><td>÷àñ.</td><td class="BlockHeaderLeftRight">Ýëåêòðîýíåðãèÿ, êÂò</td><td class="BlockHeaderLeftRight">Ïàð, ò.ì3</td>
<td class="BlockHeaderLeftRight">Ýëåêòðîýíåðãèÿ, êÂò</td><td class="BlockHeaderLeftRight">Ãàç, ò.ì3</td>
<td>Tíîðì</td><td>Tïàð</td><td>Tòåê</td>
<td>% íîðì</td><td>ðóá</td></tr>';
for ($pm=0; $pm<24; $pm++)
{
print '<tr align="center"><td class="BlockHeaderLeftRight"><a href="index.php?sel=ecm&id='.$_GET["id"].'&type=1" style="color:#ffffff">'.$dats[$pm].'</a></td>
<td class="simple">'.$hr1[$pm].'</td>
<td class="simple">'.$hr0[$pm].'</td>
<td class="simple">'.number_format($data1[$pm],2).'</td>
<td class="simple">'.number_format($data0[$pm],2).'</td>
<td class="simple">'.number_format($data3[$pm],2).'</td>
<td class="simple">'.number_format($data2[$pm],2).'</td>
<td class="simple">'.$t1[$pm].'</td>
<td class="simple">'.$t2[$pm].'</td>
<td class="simple">'.$t3[$pm].'</td>
<td class="simple">'.number_format($qual[$pm],2).'</td>
<td class="simple">'.number_format($eco[$pm],2).'</td></tr>';
}
print '<tr align="center"><td class="BlockHeaderLeftRight">Èòîãî/Ñð.</td>
<td class="BlockHeaderLeftRight">'.$ithr1.'</td>
<td class="BlockHeaderLeftRight">'.$ithr0.'</td>
<td class="BlockHeaderLeftRight">'.number_format($it1,2).'</td>
<td class="BlockHeaderLeftRight">'.number_format($it0,2).'</td>
<td class="BlockHeaderLeftRight">'.number_format($it3,2).'</td>
<td class="BlockHeaderLeftRight">'.number_format($it2,2).'</td>
<td class="BlockHeaderLeftRight">'.number_format($at1,2).'</td>
<td class="BlockHeaderLeftRight">'.number_format($at2,2).'</td>
<td class="BlockHeaderLeftRight">'.number_format($at3,2).'</td>
<td class="BlockHeaderLeftRight">'.$itqual1.'</td>
<td class="BlockHeaderLeftRight">'.number_format($iteco,2).'</td></tr>';
print '</table></td></tr><tr><td><img src="charts/barplots38.php?'.$req.'"></td></tr>';
}
?>