-
Notifications
You must be signed in to change notification settings - Fork 0
/
ecm_all.php
274 lines (245 loc) · 16.3 KB
/
ecm_all.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
<?php if (!$_GET["print"]) include ("ecm_all_menu.php"); ?>
<td style="padding-right: 3px; padding-left: 1px; margin-left: 1px; margin-right: 3px;" align="left" valign="top" width="100%">
<?php
function LoadData ($i, $prm, $channel, $type, $date, $date2)
{
$query = 'SELECT SUM(value) FROM data2 WHERE prm='.$prm.' AND channel='.$channel.' AND type='.$type.' AND date>='.$date.' AND date<'.$date2;
//echo $query;
if ($e6 = mysql_query ($query,$i)) if ($ui6 = mysql_fetch_row ($e6))
if ($ui6[0]) return $ui6[0];
}
$today=getdate(); $styear=$today["year"]; $enyear=$today["year"];
if ($_GET["styear"]!='') $styear=$_GET["styear"];
if ($_GET["enyear"]!='') $enyear=$_GET["enyear"];
if ($_GET["start"]=='') { if ($today["mon"]>1) $start=$today["mon"]-1; else { $start=12; $styear--; } }
else $start=$_GET["start"];
if ($_GET["end"]=='') $end=$today["mon"];
else $end=$_GET["end"];
$month=$start; include ("time.inc"); $month_begin=$month;
if ($end>1) $month=$end-1; else { $month=12; $end=1; $_GET["enyear"]--; }
// if (1) $month=$end; else { $month=12; $end=13; }
$end_day=31;
if (!checkdate ($month,31,$ye)) { $end_day=30; }
if (!checkdate ($month,30,$ye)) { $end_day=29; }
// if (!checkdate ($end-1,30,$ye)) { $end_day=29; }
if (!checkdate ($month,29,$ye)) { $end_day=28; }
include ("time.inc"); $month_end=$month;
$cn=1;
$date0=sprintf ("%d%02d01000000",$styear,$start);
$date2=sprintf ("%d%02d01000000",$enyear,$end);
$date1=sprintf ("%d0101000000",$styear);
$query = 'SELECT * FROM reports WHERE date='.$date0;
if ($e2 = mysql_query ($query,$i))
if ($ui2 = mysql_fetch_row ($e2))
{
$visa_date1=$ui2[1];
$visa1=$ui2[2];
$visa_date2=$ui2[3];
$visa2=$ui2[4];
$reps=$ui2[6];
}
if ($_POST["type"]=='1')
{
//echo 'cc='.$_COOKIE["user"].' '.$_POST["visa1"];
//$_COOKIE["name"]='FrolovNM' && $_POST["visa1"]
if ($_COOKIE["name"]=='KurnakovII' && $_POST["visa2"])
{
$query = 'UPDATE reports SET visa2=1,date2=CURRENT_TIMESTAMP WHERE date='.$date0;
//echo $query;
$e2 = mysql_query ($query,$i);
$query='INSERT INTO registers SET who="'.$_COOKIE['name'].'", ip="'.$_SERVER['REMOTE_ADDR'].'", channel=0, value1=0, value2=1, comment=\''.$_POST["visa1"].'\', what="ïîñòàâëåíà âèçà çà îò÷åò '.$date0.' - '.$date2.' ñî ñòîðîíû ÎÎÎ ÒÒ"';
//echo $query.'<br>';
mysql_query ($query,$i);
}
//if (1)
if ($_COOKIE["name"]=='FrolovNM' && $_POST["visa1"])
{
$query = 'UPDATE reports SET visa1=1,date1=CURRENT_TIMESTAMP WHERE date='.$date0;
//echo $query;
$e2 = mysql_query ($query,$i);
$query='INSERT INTO registers SET who="'.$_COOKIE['name'].'", ip="'.$_SERVER['REMOTE_ADDR'].'", channel=0, value1=0, value2=1, comment=\''.$_POST["visa1"].'\', what="ïîñòàâëåíà âèçà çà îò÷åò '.$date0.' - '.$date2.' ñî ñòîðîíû ÞÀÈÇ"';
//echo $query.'<br>';
mysql_query ($query,$i);
}
if ($_COOKIE["name"]=='KurnakovII' && $_POST["visa2"]=='')
{
$query = 'UPDATE reports SET visa2=0,date2=CURRENT_TIMESTAMP WHERE date='.$date0;
//echo $query;
$e2 = mysql_query ($query,$i);
$query='INSERT INTO registers SET who="'.$_COOKIE['name'].'", ip="'.$_SERVER['REMOTE_ADDR'].'", channel=0, value1=1, value2=0, comment=\''.$_POST["visa1"].'\', what="îòîçâàíà âèçà çà îò÷åò '.$date0.' - '.$date2.' ñî ñòîðîíû ÎÎÎ ÒÒ"';
//echo $query.'<br>';
mysql_query ($query,$i);
}
if ($_COOKIE["name"]=='FrolovNM' && $_POST["visa1"]=='')
{
$query = 'UPDATE reports SET visa1=0,date1=CURRENT_TIMESTAMP WHERE date='.$date0;
//echo $query;
$e2 = mysql_query ($query,$i);
$query='INSERT INTO registers SET who="'.$_COOKIE['name'].'", ip="'.$_SERVER['REMOTE_ADDR'].'", channel=0, value1=1, value2=0, comment=\''.$_POST["visa1"].'\', what="îòîçâàíà âèçà çà îò÷åò '.$date0.' - '.$date2.' ñî ñòîðîíû ÞÀÈÇ"';
//echo $query.'<br>';
mysql_query ($query,$i);
}
}
$query = 'SELECT SUM(value) FROM data2 WHERE prm=1 AND channel=50 AND type=4 AND date>='.$date1.' AND date<'.$date2;
// echo $query;
if ($e6 = mysql_query ($query,$i)) if ($ui6 = mysql_fetch_row ($e6))
if ($ui6[0]) $eksum_nach=$ui6[0];
// $eksum_nach=3141245.89;
// $eksum_nach=4391818.34;
//$eksum_nach-=1145610.84;
//$eksum_nach-=129299.07;
if ($styear==2012) $eksum_nach-=338424.26;
//$eksum_nach-=598061.39;
$query = 'SELECT SUM(value) FROM data2 WHERE prm=1 AND channel=50 AND type=4 AND date<'.$date2;
//echo $query;
if ($e6 = mysql_query ($query,$i)) if ($ui6 = mysql_fetch_row ($e6))
if ($ui6[0]) $eksum_all=$ui6[0];
// $eksum_all=5704992.62;
// $eksum_all=6955565.07;
//$eksum_all-=1864347.31;
$eksum_all-=1057160.73;
$query = 'SELECT * FROM tarifs WHERE date='.$date0;
if ($e2 = mysql_query ($query,$i))
if ($ui2 = mysql_fetch_row ($e2))
{
$tarif_elec=$ui2[4];
$tarif_hvs=$ui2[6];
$tarif_par=$ui2[9];
$tarif_gas=$ui2[10];
$tarif_vodootv=$ui2[11];
$tarif_sal=$ui2[12];
}
$eksum_data=LoadData ($i, 1,50,4,$date0,$date2);
$data0=LoadData ($i, 1,51,4,$date0,$date2)/$tarif_elec;
$data1=LoadData ($i, 2,51,4,$date0,$date2)/$tarif_gas;
$data3=LoadData ($i, 3,51,4,$date0,$date2)/$tarif_par;
$data2=0;
$data4=0;
$data5=0;
$data10=LoadData ($i, 1,52,4,$date0,$date2);
$data11=LoadData ($i, 2,52,4,$date0,$date2);
$data13=LoadData ($i, 3,52,4,$date0,$date2)/1000;
$data12=LoadData ($i, 4,52,4,$date0,$date2);
$data14=LoadData ($i, 5,52,4,$date0,$date2);
$data15=LoadData ($i, 6,52,4,$date0,$date2);
$ek0=$data0-$data10;
$ek1=$data1-$data11;
$ek2=$data2-$data12;
$ek3=$data3-$data13;
$ek4=$data4-$data14;
$ek5=0-$data15;
// echo $data3;
$ekpr0=($data0-$data10)*$tarif_elec;
$ekpr1=($data1-$data11)*$tarif_gas;
$ekpr2=($data2-$data12)*$tarif_hvs;
$ekpr3=($data3-$data13)*$tarif_par;
$ekpr4=($data4-$data14)*$tarif_vodootv;
$ekpr5=(0-$data15)*$tarif_sal;
//$eksum_nach=$ekpr0+$ekpr1+$ekpr2+$ekpr3+$ekpr4;
$eksum1=$eksum_data*0.2;
$eksum2=$eksum_data*0.8;
$rent=139358;
$total_pay=$eksum2-$rent;
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:60px"></td></tr>
<tr><td align="center"><font class="head4">Îò÷åò çà î÷åðåäíîé îò÷¸òíûé ïåðèîä î âåëè÷èíå ôàêòè÷åñêîé ýêîíîìèè</td></tr>
<tr><td style="height:60px"></td></tr>
<tr><td align="left"><font class="head4"> 1. Îò÷¸òíûé ïåðèîä: ñ "01" '.$month_begin.' '.$_GET["styear"].' ãîäà ïî "'.$end_day.'" '.$month_end.' '.$_GET["enyear"].' ãîäà</font></td></tr>
<tr><td align="left"><font class="head4"> </font></td></tr>
<tr><td align="left"><font class="head4"> 2.  îò÷åòå îòðàæåíà ýêîíîìèÿ ïî ñëåäóþùèì ìåðîïðèÿòèÿì: ÝÑÌ 1-17 ïðèëîæåíèÿ 3 ê äîãîâîðó ¹ 1-ÏÊ/333/À-10 îò 12 îêòÿáðÿ 2010 ã. Âðåìÿ ðàáîòû áîëüøèíñòâà îáîðóäîâàíèÿ - íåïîëíîå. Ýòî ó÷òåíî ïðè ðàñ÷åòå ýêîíîìèè.</font></td></tr>
<tr><td align="left"><font class="head4"> </font></td></tr>
<tr><td align="left"><font class="head4"> 3. Çàòðàòû ÒÝÐ çà îò÷åòíûé ïåðèîä ïî ðàñ÷åòó äî íà÷àëà ðåàëèçàöèè ïðîåêòà ýíåðãîñáåðåæåíèÿ:</font></td></tr>
<tr><td align="left"><font class="head4"> </font></td></tr>
</table>
<table border="0" cellpadding="1" cellspacing="1" style="background-color: #ffffff" align="left" width="800px" class="TableBorder">
<tr><td>
<table class="GirdStyle" cellspacing="0" cellpadding="3" rules="all" border="1" id="Datagrid2" style="width:100%;border-collapse:collapse;">
<tr class="gridHeaderStyle" align="center"><td>¹</td><td>Âèä ÒÝÐ</td><td>Çàòðàòû â íàòóðàëüíîì âûðàæåíèè</td><td>Çàòðàòû â äåíåæíîì âûðàæåíèè, ðóá. áåç ÍÄÑ.</td><td>Äåéñòâóþùàÿ öåíà (òàðèô), ðóá. áåç ÍÄÑ</td></tr>
<tr class="GridItemStyle"><td>1.</td><td >Ïðèðîäíûé ãàç</td><td >'.number_format($data1,2).'</td><td >'.(number_format($data1*$tarif_gas,2,'.','')).'</td><td >'.$tarif_gas.' ðóá. * 1000 ì3</td></tr>
<tr class="GridAlternateItemStyle"><td>2.</td><td>Ýëåêòðîýíåðãèÿ</td><td >'.number_format($data0,2).'</td><td >'.(number_format($data0*$tarif_elec,2,'.','')).'</td><td >'.$tarif_elec.' ðóá.êÂò*÷</td></tr>
<tr class="GridItemStyle"><td>3.</td><td >Âîäÿíîé ïàð (ñ ó÷¸òîì íåâîçâðàòà êîíäåíñàòà)</td><td >'.number_format($data3,2).'</td><td >'.(number_format($data3*$tarif_par,2,'.','')).'</td><td >'.$tarif_par.' ðóá.Ãêàë</td></tr>
<tr class="GridAlternateItemStyle"><td>4.</td><td>Õîëîäíîå âîäîñíàáæåíèå</td><td >'.number_format($data2,2).'</td><td >'.(number_format($data2*$tarif_hvs,2,'.','')).'</td><td >'.$tarif_hvs.' ì3</td></tr>
<tr class="GridItemStyle"><td>5.</td><td>Ñòî÷íûå âîäû</td><td >'.number_format($data4,2).'</td><td >'.(number_format($data4*$tarif_vodootv,2,'.','')).'</td><td >'.$tarif_vodootv.' ì3</td></tr>
<tr class="GridAlternateItemStyle"><td>6.</td><td>Ñîëü (âîäîïîäãîòîâêà)</td><td >'.number_format($data5,2).'</td><td >'.(number_format($data5*$tarif_salt,2,'.','')).'</td><td >'.$tarif_sal.' ðóá.êã</td></tr>
</table></td></tr></table>
<table border="0" cellpadding="0" cellspacing="0" width="800px">
<tr><td style="height:20px"></td></tr>
<tr><td align="left"><font class="head4">4. Çàòðàòû ÒÝÐ çà îò÷åòíûé ïåðèîä ôàêòè÷åñêèå ïîñëå íà÷àëà ðåàëèçàöèè ïðîåêòà ýíåðãîñáåðåæåíèÿ:</td></tr>
<tr><td style="height:20px"></td></tr>
</table>
<table border="0" cellpadding="1" cellspacing="1" style="background-color: #ffffff" align="left" width="800px" class="TableBorder">
<tr><td>
<table class="GirdStyle" cellspacing="0" cellpadding="3" rules="all" border="1" id="Datagrid2" style="width:100%;border-collapse:collapse;">
<tr class="gridHeaderStyle" align="center">
<td>¹</td><td>Âèä ÒÝÐ</td><td>Çàòðàòû â íàòóðàëüíîì âûðàæåíèè</td><td>Çàòðàòû â äåíåæíîì âûðàæåíèè, ðóá. áåç ÍÄÑ.</td><td>Äåéñòâóþùàÿ öåíà (òàðèô), ðóá. áåç ÍÄÑ</td></tr>
<tr class="GridItemStyle"><td>1.</td><td>Ïðèðîäíûé ãàç</td><td>'.number_format($data11,2).'</td><td>'.(number_format($data11*$tarif_gas,2,'.','')).'</td><td>'.$tarif_gas.' ðóá. * 1000 ì3</td></tr>
<tr class="GridAlternateItemStyle"><td>2.</td><td>Ýëåêòðîýíåðãèÿ</td><td>'.number_format($data10,2).'</td><td>'.(number_format($data10*$tarif_elec,2,'.','')).'</td><td>'.$tarif_elec.' ðóá.êÂò*÷</td></tr>
<tr class="GridItemStyle"><td>3.</td><td>Âîäÿíîé ïàð (ñ ó÷¸òîì íåâîçâðàòà êîíäåíñàòà)</td><td>'.number_format($data13,2).'</td><td>'.(number_format($data13*$tarif_par,2,'.','')).'</td><td>'.$tarif_par.' ðóá.Ãêàë</td></tr>
<tr class="GridAlternateItemStyle"><td>4.</td><td>Õîëîäíîå âîäîñíàáæåíèå</td><td>'.number_format($data12,2).'</td><td>'.(number_format($data12*$tarif_hvs,2,'.','')).'</td><td>'.$tarif_hvs.' ðóá.ì3</td></tr>
<tr class="GridItemStyle"><td>5.</td><td>Ñòî÷íûå âîäû</td><td >'.number_format($data14,2).'</td><td >'.(number_format($data14*$tarif_vodootv,2,'.','')).'</td><td >'.$tarif_vodootv.' ðóá.ì3</td></tr>
<tr class="GridAlternateItemStyle"><td>6.</td><td>Ñîëü (âîäîïîäãîòîâêà)</td><td >'.$data15.'</td><td >'.(number_format($data15*$tarif_sal,2,'.','')).'</td><td >'.$tarif_sal.' ðóá.êã</td></tr>
</table></td></tr></table>
<table border="0" cellpadding="0" cellspacing="0" width="800px">
<tr><td style="height:20px"></td></tr>
<tr><td align="left"><font class="head4">5. Ýêîíîìèÿ çà îò÷¸òíûé ïåðèîä ïî âèäàì ÒÝÐ:</td></tr>
<tr><td style="height:20px"></td></tr>
</table>
<table border="0" cellpadding="1" cellspacing="1" style="background-color: #ffffff" align="left" width="800px" class="TableBorder">
<tr><td>
<table class="GirdStyle" cellspacing="0" cellpadding="3" rules="all" border="1" id="Datagrid2" style="width:100%;border-collapse:collapse;">
<tr class="gridHeaderStyle" align="center">
<td>¹</td><td>Âèä ÒÝÐ</td><td>Çàòðàòû â íàòóðàëüíîì âûðàæåíèè</td><td>Çàòðàòû â äåíåæíîì âûðàæåíèè, ðóá. áåç ÍÄÑ.</td><td>Äåéñòâóþùàÿ öåíà (òàðèô), ðóá. áåç ÍÄÑ</td></tr>
<tr class="GridItemStyle"><td>1.</td><td >Ïðèðîäíûé ãàç</td><td >'.(number_format($ek1,2,'.','')).'</td><td >'.(number_format($ekpr1,2,'.','')).'</td><td >'.$tarif_gas.' ðóá. * 1000 ì3</td></tr>
<tr class="GridAlternateItemStyle"><td>2.</td><td >Ýëåêòðîýíåðãèÿ</td><td >'.(number_format($ek0,2,'.','')).'</td><td >'.(number_format($ekpr0,2,'.','')).'</td><td >'.$tarif_elec.' ðóá.êÂò*÷</td></tr>
<tr class="GridItemStyle"><td>3.</td><td >Âîäÿíîé ïàð (ñ ó÷¸òîì íåâîçâðàòà êîíäåíñàòà)</td><td >'.(number_format($ek3,2,'.','')).'</td><td >'.(number_format($ekpr3,2,'.','')).'</td><td >'.$tarif_par.' ðóá.Ãêàë</td></tr>
<tr class="GridAlternateItemStyle"><td>4.</td><td >Õîëîäíîå âîäîñíàáæåíèå</td><td >'.(number_format($ek2,2,'.','')).'</td><td >'.(number_format($ekpr2,2,'.','')).'</td><td >'.$tarif_hvs.' ðóá.ì3</td></tr>
<tr class="GridItemStyle"><td>5.</td><td>Ñòî÷íûå âîäû</td><td >'.(number_format($ek4,2,'.','')).'</td><td >'.(number_format($ek4*$tarif_vodootv,2,'.','')).'</td><td >'.$tarif_vodootv.' ðóá.ì3</td></tr>
<tr class="GridAlternateItemStyle"><td>6.</td><td>Ñîëü (âîäîïîäãîòîâêà)</td><td >'.$ek5.'</td><td >'.(number_format($ek5*$tarif_sal,2,'.','')).'</td><td >'.$tarif_sal.' ðóá.êã</td></tr>
</table></td></tr></table>
<table border="0" cellpadding="3" cellspacing="0" width="800px">
<tr><td style="height:40px"></td></tr>
<tr><td align="left"><font class="head3">6. Ñóììàðíàÿ ýêîíîìèÿ çà îò÷¸òíûé ïåðèîä: '.number_format($eksum_data,2).' ðóáëåé;</td></tr>
<tr><td align="left"><font class="head3">7. Äîëÿ ñóììàðíîé ýêîíîìèè Çàêàç÷èêà çà îò÷¸òíûé ïåðèîä: '.number_format($eksum1,2).' ðóáëåé;</td></tr>
<tr><td align="left"><font class="head3">8. Äîëÿ ñóììàðíîé ýêîíîìèè Èñïîëíèòåëÿ çà îò÷¸òíûé ïåðèîä: '.number_format($eksum2,2).' ðóáëåé;</td></tr>
<tr><td align="left"><font class="head3">9. Ñóììàðíûé ýêîíîìè÷åñêèé ýôôåêò ñ íà÷àëà êàëåíäàðíîãî ãîäà: '.number_format($eksum_nach,2).' ðóáëåé;</td></tr>
<tr><td align="left"><font class="head3">10. Ñóììàðíûé ýêîíîìè÷åñêèé ýôôåêò ñ ìîìåíòà íà÷àëà ðåàëèçàöèè ïðîåêòà ýíåðãîñáåðåæåíèÿ: '.number_format($eksum_all,2).' ðóáëåé;</td></tr>
<tr><td align="left"><font class="head3">11. Âûïëàòû Çàêàç÷èêà â ïîëüçó Èñïîëíèòåëÿ, ñäåëàííûå ïî Äîãîâîðó àðåíäû ¹ 1-ÏÊ-À1 îò 26 ñåíòÿáðÿ 2011 ã. çà îò÷¸òíûé ïåðèîä: '.number_format($rent,2).' ðóáëåé;</td></tr>
<tr><td align="left"><font class="head3">12. Ñóììà, ïðè÷èòàþùàÿñÿ ê âûïëàòå Èñïîëíèòåëþ çà îò÷¸òíûé ïåðèîä ñ ó÷¸òîì âûïëàò Çàêàç÷èêà ïî Äîãîâîðó àðåíäû ¹ 1-ÏÊ-À1 îò 26 ñåíòÿáðÿ 2011 ã.: '.number_format($total_pay,2).' ðóáëåé;</td></tr>
<tr><td align="left"><font class="head3">13. Ïåðåðàáîòêà ïî àãðåãàòàì ñîñòàâèëà:<br>'.$reps.'</td></tr>
<tr><td style="height:20px"></td></tr>
<tr><td align="left"><font class="head3">Ñîñòàâèë: Ìåíåäæåð ïî ìîíèòîðèíãó __________________ ÔÈÎ</td></tr>
<tr><td align="left"><font class="head3">Äàòà ___________</td></tr>
</table>';
if (!$_GET["print"])
{
$tm=$mn;
include ("time.inc");
$dats[$cn]=$dat[$cn].' '.$ye;
$mn--; if ($mn==0) { $mn=12; $ye--; $pims=$pm; }
$cn--;
print '<form name="frm1" method="post" action="'.$_SERVER['REQUEST_URI'].'">';
print '<table border="0" cellpadding="3" cellspacing="0" width="1100px"><br><br><br><br>';
print '<tr><td><font class="head3">Ñîãëàñîâàíî ñî ñòîðîíû ÞÀÈÇ-ÏÔÈ</font></td><td><font class="head3">'.$visa_date1.'</font></td><td>';
if (!$visa1 && !$visa2) print '<input id="visa1" name="visa1" class="simple2" style="width:100" align="center">';
else if ($visa1) print '<input id="visa1" name="visa1" class="simple2" style="width:100" align="center" value="ÑÎÃËÀÑÎÂÀÍÎ">';
print '</td>
<td><font class="head3">Ñîãëàñîâàíî ñî ñòîðîíû ÎÎÎ ÈÏÊ "Òåõíîëîãèè ýíåðãîñáåðåæåíèÿ"</font></td><td><font class="head3">'.$visa_date2.'</font></td><td>';
if (!$visa1 && !$visa2) print '<input id="visa2" name="visa2" class="simple2" style="width:100" align="center" disabled>';
else if ($visa1 && !$visa2) print '<input id="visa2" name="visa2" class="simple2" style="width:100" align="center">';
else if ($visa1 && $visa2) print '<input id="visa2" name="visa2" class="simple2" style="width:100" align="center" value="ÑÎÃËÀÑÎÂÀÍÎ">';
print '</td></tr>';
print '</table>';
print '<input name="type" type="hidden" value="1">';
print '<input type="submit" style="visibility: hidden">';
print '</form>';
}
?>
</td></tr></tbody></table></td>