-
Notifications
You must be signed in to change notification settings - Fork 0
/
irp4.php
104 lines (96 loc) · 3.69 KB
/
irp4.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
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<link rel="stylesheet" href="shablon.css" type="text/css">
<title>Ñóòî÷íûå ïîêàçàíèÿ ñòîÿêîâûõ òåïëîâû÷èñëèòåëåé</title>
<body leftmargin=0 topmargin=5 rightmargin=0 bottommargin=0 marginwidth=0 marginheight=0>
<table width=1200px cellpadding=2 cellspacing=1 bgcolor=#664466 align=center>
<tr>
<?php
include("config/local.php");
$arr = get_defined_vars();
$i = mysql_connect ($mysql_host,$mysql_user,$mysql_password); $e=mysql_select_db ($mysql_db_name);
$query = 'SELECT * FROM dev_irp ORDER BY strut';
$a = mysql_query ($query,$i);
$uy = mysql_fetch_row ($a); $cn=0;
print '<td bgcolor=#ffcf68 align=center width="100px"><font class=tablz><a href="index.php?sel=irp4&pr=1&obj='.$_GET["obj"].'">Q</a>|<a href="index.php?sel=irp4&pr=2&obj='.$_GET["obj"].'">V</a>|<a href="index.php?sel=irp4&pr=3&obj='.$_GET["obj"].'">M</a>|<a href="index.php?sel=irp4&pr=4&obj='.$_GET["obj"].'">H1</a>|<a href="index.php?sel=irp4&pr=5&obj='.$_GET["obj"].'">H2</a></font></td>';
while ($uy)
{
print '<td bgcolor=#ffcf68 align=center><font class=tablz>'.$uy[3].'/'.$uy[4].'</font></td>';
$irp[$cn]=$uy[1];
$cn++;
$uy = mysql_fetch_row ($a);
}
?>
</tr>
<?php
$today=getdate();
$ye=$today["year"];
$mm=$today["mon"]=1;
$mx=$today["mday"]=2;
$mn=1; $nx=15; $nn=1;
$x=0;
$month=''.$month;
//echo $mx.'<br>';
if ($today["mon"]<10) $today["mon"]='0'.$today["mon"];
if ($today["mday"]<10) $today["mday"]='0'.$today["mday"];
for ($tn=$nx; $tn>=$nn; $tn--)
for ($tm=$mx; $tm>=$mn; $tm--)
{
$data0[$x]=0; $data1[$x]=0; $dtt=-1;
if ($tm<10)
{
$date1=$today["year"].$today["mon"].'0'.$tm.'000000';
$dat[$x]=$tm.'-'.$today["mon"].'-'.$today["year"];
}
else
{
$date1=$today["year"].$today["mon"].$tm.'000000';
$dat[$x]=$tm.'-'.$today["mon"].'-'.$today["year"];
}
if ($_GET["pr"]=='' || $_GET["pr"]=='1') $query = 'SELECT * FROM prdata WHERE type=2 AND value>0 AND value<2000 AND prm=13 AND pipe=0 AND date='.$date1;
if ($_GET["pr"]=='2') $query = 'SELECT * FROM prdata WHERE type=2 AND prm=11 AND value>0 AND value<2000 AND pipe=0 AND date='.$date1;
if ($_GET["pr"]=='3') $query = 'SELECT * FROM prdata WHERE type=2 AND prm=12 AND value>0 AND value<2000 AND pipe=0 AND date='.$date1;
if ($_GET["pr"]=='4') $query = 'SELECT * FROM prdata WHERE type=2 AND prm=1 AND pipe=0 AND date='.$date1;
if ($_GET["pr"]=='5') $query = 'SELECT * FROM prdata WHERE type=2 AND prm=1 AND pipe=1 AND date='.$date1;
//echo $query;
$a = mysql_query ($query,$i);
if ($a) $uy = mysql_fetch_row ($a);
while ($uy)
{
for ($y=0;$y<$cn;$y++)
if ($irp[$y]==$uy[1]) $data[$x][$y]=$uy[5];
$uy = mysql_fetch_row ($a);
}
if ($tm==1)
{
if ($today["mon"]>1) $today["mon"]--;
else { $today["mon"]=12; $today["year"]--; }
if ($today["mon"]<10) $today["mon"]='0'.$today["mon"];
$today["mday"]=31;
if (!checkdate ($today["mon"],31,$today["year"])) { $today["mday"]=30; }
if (!checkdate ($today["mon"],30,$today["year"])) { $today["mday"]=29; }
if (!checkdate ($today["mon"],29,$today["year"])) { $today["mday"]=28; }
$mx=$today["mday"];
}
$x++;
}
$max=$x;
//echo $max.' '.$x;
for ($y=0;$y<$max;$y++)
{
print '<tr><td align=center bgcolor=#ffcf68 width=100><font class=tablz>'.$dat[$y].'</font></td>';
for ($u=0;$u<$cn;$u++)
{
print '<td align=center bgcolor=#ffffff><font class=top5>';
if (!$data[$y][$u]) $data[$y][$u]=$data[$y+1][$u];
if ($data[$y][$u]) printf ("%.5f",$data[$y][$u]);
else printf ("-");
print '</font></td>';
}
print '</tr>';
}
?>
</table>
</body>
</html>