-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshelf.php
174 lines (168 loc) · 8.59 KB
/
shelf.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
<?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>
<tr><td>
<? include ("inc/menu.inc"); ?>
</td></tr>
<tr><td>
<table border=0 align=center bgcolor=#ffffff>
<font class="main">
<?php
$i = mysql_connect ($mysql_host,$mysql_user,$mysql_password); $e=mysql_select_db ($mysql_db_name);
$query = 'SELECT * FROM shelf WHERE id=\''.$_GET["id"].'\'';
$e = mysql_query ($query,$i);
if ($e) $ui = mysql_fetch_row ($e);
if ($ui == true) $sid=$ui[5];
print '<tr><td colspan=2><hr></td></tr>';
print '<tr><td valign=top>
<table border=0 valign=top align=left>
<tr><td><font class="fin1">Øêàô </font><font class="or1">'; print $ui[1]; print '</font></td></tr>';
print '<tr><td><font class="fin1">Óñòàíîâëåí â </font><font class="or1">';
$query = 'SELECT name FROM korp WHERE korp_id=\''. $ui[3].'\'';
$p = mysql_query ($query,$i);
$uo = mysql_fetch_row ($p);
if ($uo == true) print $uo[0];
else print 'Unknown';
print '</font></td></tr>';
print '<tr><td><font class="fin1">Îïèñàíèå, ðàñïîëîæåíèå </font><br><br><font class="or1">';
$query = 'SELECT * FROM shelf WHERE sid=\''.$sid.'\''; $mat='';
$e = mysql_query ($query,$i);
$ui = mysql_fetch_row ($e);
while ($ui)
{
$query = 'SELECT uzel FROM equipment WHERE shelf=\''.$ui[0].'\'';
$p = mysql_query ($query,$i);
if ($p) $uo = mysql_fetch_row ($p);
if ($uo == true) $uzel=$uo[0];
$query = 'SELECT * FROM uzel WHERE id=\''.$uzel.'\'';
$p = mysql_query ($query,$i);
if ($p) $uo = mysql_fetch_row ($p);
if ($uo == true) print '<a href="uzel.php?id='.$uzel.'">'.$uo[1].'</a>';
$ands='shelf=\''.$ui[0].'\'';
$mat=$mat.$ui[6];
print '<p>'.$ui[2].' <b>Îòâåòñòâåííûé, êëþ÷è: </b>'.$ui[4].'</p>';
$ui = mysql_fetch_row ($e);
if ($ui) $ands=$ands.' AND ';
}
print '</font></td></tr>';
print '</table></td>';
print '<td align=center width=300><a href="shelf/'.$sid.'.jpg"><img border=0 src="shelf/'.$sid.'_resize.jpg"></a></td>';
print '</tr><tr><td colspan=2><hr></td></tr>';
print '<tr><td valign=top><table>';
print '<tr><td colspan=3 align=center><table>';
$query = 'SELECT name,s_type,serial,shelf,date_dem_p,prichina_dem,date_mon_p,prichina_mon,Pmin,Pmax FROM equipment WHERE '.$ands;
$max=10;
print '<tr><td bgcolor=#e6e6e6><font class="main">Íàçâàíèå</td>
<td bgcolor=#e6e6e6><font class="main">Òèï ïðèáîðà</td><td bgcolor=#e6e6e6><font class="main">Ñåðèéíûé íîìåð</td>
<td bgcolor=#e6e6e6><font class="main">Øêàô</td>
<td bgcolor=#e6e6e6><font class="main">Äàòà ïîñëåäíåãî äåìîíòàæà</td><td bgcolor=#e6e6e6><font class="main">Ïðè÷èíà äåìîíòàæà</td>
<td bgcolor=#e6e6e6><font class="main">Äàòà ïîñëåäíåãî ìîíòàæà</td><td bgcolor=#e6e6e6><font class="main">Ïðè÷èíà ìîíòàæà</td>
<td bgcolor=#e6e6e6><font class="main">Pmin</td> <td bgcolor=#e6e6e6><font class="main">Pmax</td>';
$e = mysql_query ($query,$i);
for ($z=1;$z<=100;$z++)
{
$ui = mysql_fetch_row ($e);
if ($ui == true)
{
print '<tr>';
for ($j=0;$j<$max;$j++)
{
print '<td bgcolor=#ffffff><font class="dd">';
if ($j==22)
{
$query = 'SELECT caption FROM energy_supply WHERE id='.'\''. $ui[$j].'\'';
$p = mysql_query ($query,$i);
$uo = mysql_fetch_row ($p);
if ($uo == true) print $uo[0];
else print $ui[2];
}
else
if ($j==1)
{
$query = 'SELECT name FROM sensors WHERE id='.'\''. $ui[$j].'\'';
$p = mysql_query ($query,$i);
$uo = mysql_fetch_row ($p);
if ($uo == true) print $uo[0];
else print 'Unknown';
}
else
if ($j==10)
{
$query = 'SELECT name FROM uzel WHERE id='.'\''. $ui[$j].'\'';
$p = mysql_query ($query,$i);
$uo = mysql_fetch_row ($p);
if ($uo == true)
{
print '<a href="uzel.php?id='; print $ui[$j]; print '">';
echo $uo[0]; print '</a>';
}
else print 'Unknown';
}
else
if ($j==3)
{
$query = 'SELECT name FROM shelf WHERE id='.'\''. $ui[$j].'\'';
$p = mysql_query ($query,$i);
$uo = mysql_fetch_row ($p);
if ($uo == true) print $uo[0];
else print 'Unknown';
}
else
if ($j==23)
{
if ($ui[$j]==1) print 'Àáñîëþòíàÿ';
else print 'Îòíîñèòåëüíàÿ';
}
else echo $ui[$j];
print '</td>';
}
}
}
print '</table></td></tr>';
print '<tr><td><table><tr><td align=center><br><font class="down">Ñîáûòèÿ óçëîâ ó÷åòà øêàôà</font></td></tr>
<tr><td align=center><br><font class="down">Âûïîëíåííûå ïî øêàôó ðàáîòû è ðàñõîäíûå ìàòåðèàëû</font></td></tr>';
print '<tr><td align=center><br><font class="down">'.$mat.'</font></td></tr>';
print '</table></td></tr></table></td>';
print '<td><table><tr><td width=100 align=center valign=top align=center><a href="shelf/001.jpg" alt="Ôîòîãðàôèÿ óñòàíîâêè äàò÷èêà ðàñõîäà"><img src="shelf/001_resize.jpg" width=100></a><br><font class="fin8">Óçåë â ñáîðå</font></td>';
print '<td width=100 align=center><a href="shelf/002.jpg" alt="Ôîòîãðàôèÿ óñòàíîâêè äàò÷èêà ðàñõîäà"><img src="shelf/002_resize.jpg" width=100></a><br><font class="fin8">Óñòàíîâëåííûé äàò÷èê òåìïåðàòóðû</font></td>';
print '<td width=100 align=center><a href="shelf/003.jpg" alt="Ôîòîãðàôèÿ óñòàíîâêè äàò÷èêà ðàñõîäà"><img src="shelf/003_resize.jpg" width=100></a><br><font class="fin8">Ñìîíòèðîâàííûé ðàñõîäîìåð íà ïèòüåâóþ âîäó</font></td></tr>';
print '<tr><td width=100 align=center><a href="shelf/004.jpg" alt="Ôîòîãðàôèÿ óñòàíîâêè äàò÷èêà ðàñõîäà"><img src="shelf/004_resize.jpg" width=100></a><br><font class="fin8">Ñìîíòèðîâàííûé ðàñõîäîìåð íà òåïëî</font></td>';
print '<td width=100 align=center><a href="shelf/005.jpg" alt="Ôîòîãðàôèÿ óñòàíîâêè äàò÷èêà ðàñõîäà"><img src="shelf/005_resize.jpg" width=100></a><br><font class="fin8">Ñìîíòèðîâàííûé ðàñõîäîìåð íà òåïëî</font></td>';
print '<td width=100 align=center><a href="shelf/006.jpg" alt="Ôîòîãðàôèÿ óñòàíîâêè äàò÷èêà ðàñõîäà"><img src="shelf/006_resize.jpg" width=100></a><br><font class="fin8">Ðàçîäêà ïèòàíèÿ â ØÓÝÐ</font></td></tr>
<tr><td colspan=3 align=center bgcolor=#e6e6e6><font class="down">Äîáàâèòü ôîòîãðàôèþ</font></td></tr>
<form name="reda" method=post action="tobd.php" enctype="multipart/form-data">
<tr><td colspan=3><font class="down">Ôîòî</font><input name="photo" size=30 class=log type="file" style="height:18px"></td></tr>
<tr><td colspan=3><font class="down">Îïèñàíèå</font><input name="descr" size=25 class=log style="height:18px"><input alt="äîáàâèòü" border=0 hspace=3 name=A1 align=left src="files/forward.gif" type=image><input name="frm" size=1 style="height:1;width:1;visibility:hidden" value="24"><input name="id" size=1 style="height:1;width:1;visibility:hidden" value="'.$sid.'"></td></tr></form></table></td>';
print '</tr><tr><td colspan=3><hr></td></tr></table></td></tr>';
?>
</table>
</td></tr>
<? include ("inc/down.inc"); ?>
</td><tr>
</table>
</body>
</html>