-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdetail.php
187 lines (177 loc) · 8.88 KB
/
detail.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
<?php include("config/local.php"); ?>
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<!doctype php manual "-//by the PHP Documentation Group//en">
<!doctype odbc manual "-//by microsoft corp.//en">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<link rel="stylesheet" href="shablon.css" type="text/css">
<?
include_once("../../adodb/adodb.inc.php");
$db= &ADONewConnection($sqldriver);
if (!$db->Connect($mysql_host, $mysql_user, $mysql_password, $mysql_db_name))
{die("Error: ".$db->ErrorMsg());}
$resq = "SELECT * FROM users WHERE user='".$PHP_AUTH_USER."' AND passwd='".$PHP_AUTH_PW."';";
$rc=&$db->Execute($resq);
echo "<title>Îò÷åò ïî àðåíäàòîðó - Èíòåðôåéñ'".$priveleges[$rc->fields[user_priveleges]]."'</title></head><body>";
?>
</head>
<body><table cellpadding="0" cellspacing="0" border="0" style="width:100%;">
<tr><td><table cellpadding="0" cellspacing="0" border="0" style="width:100%;">
<tr>
<td id="header" style="width:100%;background-image: url(files/14164-598x134.jpg);">
<a href="http://www.tpchel.ru/" title="Íà ãëàâíóþ ñòðàíèöó ÎÀÎ Òåïëîïðèáîð"><img src="files/logo.gif" alt="Íà ãëàâíóþ ñòðàíèöó" class="logo" align="top" width="103" height="100" border="0"/>
</a><div class="transparent"><a href="http://www.rossich.ru/"><img src="files/transparent.gif" /></a></div>
</div></td></tr></table></td></tr>
<tr><td>
<table border=0 align=center bgcolor=#ffffff valign=top>
<tr><td>
<? include ("inc/menu.inc"); ?>
</td></tr>
<tr><td>
<table border=0 align=center bgcolor=#ffffff valign=top width=1000>
<?php
$i = mysql_connect ($mysql_host,$mysql_user,$mysql_password); $e=mysql_select_db ($mysql_db_name);
$arr = get_defined_vars();
//-------------------------------------------------------
$query = 'SELECT caption FROM buyers WHERE idx='.'\''.$idbuy.'\'';
$p = mysql_query ($query,$i);
$uo = mysql_fetch_row ($p);
if ($uo == true) $buyers=$uo[0];
else $buyers='Íåèçâåñòåí';
print '<tr><td bgcolor=#e6e6e6 colspan=2><font class="menu"> </font></td></tr>';
print '<tr><td colspan=2><table><tr>';
$today = getdate ();
for ($o=0;$o<12;$o++)
{
if ($today[mon]>1) $today[mon]--;
else
{
$today[mon]=12;
$today[year]--;
}
if ($today[mon]==1) $month1='ßíâàðü'; if ($today[mon]==2) $month1='Ôåâðàëü';
if ($today[mon]==3) $month1='Ìàðò'; if ($today[mon]==4) $month1='Àïðåëü';
if ($today[mon]==5) $month1='Ìàé'; if ($today[mon]==6) $month1='Èþíü';
if ($today[mon]==7) $month1='Èþëü'; if ($today[mon]==8) $month1='Àâãóñò';
if ($today[mon]==9) $month1='Ñåíòÿáðü'; if ($today[mon]==10) $month1='Îêòÿáðü';
if ($today[mon]==11) $month1='Íîÿáðü'; if ($today[mon]==12) $month1='Äåêàáðü';
print '<td bgcolor=#f0f0f0><a href="detail.php?month='.$today["mon"].'&year='.$today["year"].'&idbuy='.$idbuy.'"><font class="menu">['.$month1.','.$today[year].']</font></td>';
}
print '</tr></table></td></tr>';
print '<tr><td bgcolor=#e6e6e6 colspan=2><font class="menu">Îò÷åò ïî àðåíäàòîðó '.$buyers.' íà ';
if ($arr["month"]==1) $month1='ßíâàðü'; if ($arr["month"]==2) $month1='Ôåâðàëü';
if ($arr["month"]==3) $month1='Ìàðò'; if ($arr["month"]==4) $month1='Àïðåëü';
if ($arr["month"]==5) $month1='Ìàé'; if ($arr["month"]==6) $month1='Èþíü';
if ($arr["month"]==7) $month1='Èþëü'; if ($arr["month"]==8) $month1='Àâãóñò';
if ($arr["month"]==9) $month1='Ñåíòÿáðü'; if ($arr["month"]==10) $month1='Îêòÿáðü';
if ($arr["month"]==11) $month1='Íîÿáðü'; if ($arr["month"]==12) $month1='Äåêàáðü';
// if ($arr["month"]<12) $arr["month"]++; else { $arr["month"]=1; $arr["year"]++; }
if ($arr["year"]=="") print 'òåêóùèé ìîìåíò';
else print $month1.','.$arr[year];
print '</font></td></tr>';
print '<tr><td bgcolor=#e6e6e6 colspan=1><font class="menu">Òåïëîâàÿ ýíåðãèÿ äíåâíîé W,ÃÊàë</font></td><td bgcolor=#e6e6e6 colspan=1><font class="menu">Òåïëîâàÿ ýíåðãèÿ ïî ìåñÿöàì W,ÃÊàë</font></td></tr>';
print '<tr><td width=500 colspan=1>';
print '<img border=0 src="charts/arend_xy.php?idbuy='.$idbuy.'&source=1&month='.$arr["month"].'&year='.$arr["year"].'"></td>';
print '<td width=500 colspan=1>';
print '<img border=0 src="charts/arend_bar.php?idbuy='.$idbuy.'&source=1&month='.$arr["month"].'&year='.$arr["year"].'"></td></tr>';
print '<tr><td bgcolor=#e6e6e6 colspan=1><font class="menu">Ïîæàðíî-ïèòüåâàÿ âîäà äíåâíîé V,ì3</font></td><td bgcolor=#e6e6e6 colspan=1><font class="menu">Ïîæàðíî-ïèòüåâàÿ âîäà ïî ìåñÿöàì V,ì3</font></td></tr>';
print '<tr><td width=500 colspan=1>';
print '<img border=0 src="charts/arend_xy.php?idbuy='.$idbuy.'&source=2&month='.$arr["month"].'&year='.$arr["year"].'"></td>';
print '<td width=500 colspan=1>';
print '<img border=0 src="charts/arend_bar.php?idbuy='.$idbuy.'&source=2&month='.$arr["month"].'&year='.$arr["year"].'"></td></tr>';
print '<tr><td bgcolor=#e6e6e6 colspan=1><font class="menu">Ñæàòûé âîçäóõ äíåâíîé V,ì3</font></td><td bgcolor=#e6e6e6 colspan=1><font class="menu">Ñæàòûé âîçäóõ ïî ìåñÿöàì V,ì3</font></td></tr>';
print '<tr><td width=500 colspan=1>';
print '<img border=0 src="charts/arend_xy.php?idbuy='.$idbuy.'&source=5&month='.$arr["month"].'&year='.$arr["year"].'"></td>';
print '<td width=500 colspan=1>';
print '<img border=0 src="charts/arend_bar.php?idbuy='.$idbuy.'&source=5&month='.$arr["month"].'&year='.$arr["year"].'"></td></tr>';
print '<tr><td bgcolor=#e6e6e6 colspan=1><font class="menu">Êèñëîðîä äíåâíîé V,ì3</font></td><td bgcolor=#e6e6e6 colspan=1><font class="menu">Ýëåêòðè÷åñêàÿ ýíåðãèÿ ïî ìåñÿöàì W,êÂò</font></td></tr>';
print '<tr><td width=500 colspan=1>';
print '<img border=0 src="charts/arend_xy.php?idbuy='.$idbuy.'&source=6&month='.$arr["month"].'&year='.$arr["year"].'"></td>';
print '<td width=500 colspan=1>';
print '<img border=0 src="charts/arend_bar.php?idbuy='.$idbuy.'&source=7&month='.$arr["month"].'&year='.$arr["year"].'"></td></tr>';
print '<tr><td colspan=2><font class="menu">Ïîäðîáíûé ðàñêëàä ïî îáúåêòàì, ïðèíàäëåæàùèì àðåíäàòîðó</font></td></tr>';
print '<tr><td colspan=2><table border=0 align=center bgcolor=#ffffff valign=top width=1000>';
print '<tr>';
print '<td bgcolor=#e6e6e6 align=center><font class="main">Íàçâàíèå</font></td>';
print '<td bgcolor=#e6e6e6 align=center><font class="main">Êîðïóñ</font></td>';
print '<td bgcolor=#e6e6e6 align=center><font class="main">Òèï</font></td><td align=center bgcolor=#e6e6e6><font class="main">Íîìåð ÁÒÈ / Èíâåíòàðíûé</font></td>';
print '<td align=center bgcolor=#e6e6e6><font class="main">Ïîëåçíûé îáúåì</td>';
print '<td bgcolor=#e6e6e6 align=center><font class="main">Òåïëî W,ÃÊàë</td><td align=center bgcolor=#e6e6e6><font class="main">Âîäà V,ì3</td><td bgcolor=#e6e6e6 align=center><font class="main">Ñæàòûé âîçäóõ V,ì3</td>';
print '</tr>';
$today = getdate ();
if ($today["mon"]<10) $today["mon"]='0'.$today["mon"];
if ($arr["month"]<10) $arr["month"]='0'.$arr["month"];
if ($arr["year"]!="") $bdate=$arr["year"].$arr["month"].'01000000';
else $bdate=$today["year"].$today["mon"].'01000000';
$query = 'SELECT * FROM korp WHERE korp_id<100';
$b = mysql_query ($query,$i);
if ($b)
for ($t=1;$t<=50;$t++)
{
$uo = mysql_fetch_row ($b);
if ($uo == true)
{
$tepl=0; $voda=0; $vozd=0;
$query = 'SELECT SUM(value) FROM data WHERE type=4 AND date='.$bdate.' AND korp='.$uo[1].' AND name LIKE \'%ýíåðãèè%\' AND source=1';
//echo $query.'<br>';
$a = mysql_query ($query,$i);
if ($a)
{
$uy = mysql_fetch_row ($a);
if ($uy == true) $tepl=$uy[0];
}
$query = 'SELECT SUM(value) FROM data WHERE type=4 AND date='.$bdate.' AND korp='.$uo[1].' AND name LIKE \'%îáúåìà%\' AND source=2';
$a = mysql_query ($query,$i);
if ($a)
{
$uy = mysql_fetch_row ($a);
if ($uy == true) $voda=$uy[0];
}
$query = 'SELECT SUM(value) FROM data WHERE type=4 AND date='.$bdate.' AND korp='.$uo[1].' AND name LIKE \'%îáúåìà%\' AND source=5';
$a = mysql_query ($query,$i);
if ($a)
{
$uy = mysql_fetch_row ($a);
if ($uy == true) $vozd=$uy[0];
}
//echo '['.$uo[2].'] '.$tepl.' '.$voda.' '.$vozd.'<br>';
$query = 'SELECT name,idkorp,type,BTI,volume,K2,K3,K6 FROM obj WHERE type!=1 AND idbuy='.$idbuy.' AND idkorp='.$uo[1];
//echo $query.'<br>';
$a = mysql_query ($query,$i);
for ($r=0;$r<300;$r++)
{
$uy = mysql_fetch_row ($a);
if ($uy == true)
{
print '<tr>';
for ($y=0;$y<8;$y++)
{
print '<td>';
if ($y==1) print $uo[2];
else if ($y==2)
{
if ($uy[2]=='1') print 'Êîðïóñ';
if ($uy[2]=='2') print 'Ïîìåùåíèå';
if ($uy[2]=='3') print 'Àãðåãàò';
}
else if ($y<5) print $uy[$y];
if ($y==5) printf ("%.5f",$uy[$y]*$tepl);
if ($y==6) printf ("%.5f",$uy[$y]*$voda);
if ($y==7) printf ("%.5f",$uy[$y]*$vozd);
print '</td>';
}
}
print '</tr>';
}
}
}
print '</table></td></tr>';
?>
</table><br>
</td><tr>
</table><br>
</td><tr>
</table>
</body>
</html>