summaryrefslogtreecommitdiffstats
path: root/frontends/php/report2.php
diff options
context:
space:
mode:
authorhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2004-09-28 17:58:11 +0000
committerhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2004-09-28 17:58:11 +0000
commit9c17c8be0eef94e9b0f62a9848d1dcd8a88d2130 (patch)
tree5788842d18d15c7226be38bb6b985dfe209c4ccd /frontends/php/report2.php
parent9e2510e64cdac6a2513278b703b54af1ee785614 (diff)
downloadzabbix-9c17c8be0eef94e9b0f62a9848d1dcd8a88d2130.tar.gz
zabbix-9c17c8be0eef94e9b0f62a9848d1dcd8a88d2130.tar.xz
zabbix-9c17c8be0eef94e9b0f62a9848d1dcd8a88d2130.zip
Frontend improvements.
git-svn-id: svn://svn.zabbix.com/trunk@1439 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/report2.php')
-rw-r--r--frontends/php/report2.php53
1 files changed, 18 insertions, 35 deletions
diff --git a/frontends/php/report2.php b/frontends/php/report2.php
index 31a42250..79dc74db 100644
--- a/frontends/php/report2.php
+++ b/frontends/php/report2.php
@@ -72,15 +72,8 @@
show_table_header($row["host"]);
$result=DBselect("select distinct h.hostid,h.host,t.triggerid,t.expression,t.description,t.value from triggers t,hosts h,items i,functions f where f.itemid=i.itemid and h.hostid=i.hostid and t.status=0 and t.triggerid=f.triggerid and h.hostid=".$_GET["hostid"]." and h.status in (0,2) and i.status=0 order by h.host, t.description");
- echo "<TABLE BORDER=0 COLS=3 WIDTH=100% BGCOLOR=\"#AAAAAA\" cellspacing=1 cellpadding=3>";
- echo "<TR BGCOLOR=\"#CCCCCC\">";
- echo "<TD><B>".S_DESCRIPTION."</B></TD>";
-// echo "<TD><B>Expression</B></TD>";
- echo "<TD WIDTH=5%><B>".S_TRUE."</B></TD>";
- echo "<TD WIDTH=5%><B>".S_FALSE."</B></TD>";
- echo "<TD WIDTH=5%><B>".S_UNKNOWN."</B></TD>";
- echo "<TD WIDTH=5%><B>".S_GRAPH."</B></TD>";
- echo "</TR>\n";
+ table_begin();
+ table_header(array(S_DESCRIPTION,S_TRUE,S_FALSE,S_UNKNOWN,S_GRAPH));
$col=0;
while($row=DBfetch($result))
{
@@ -90,35 +83,25 @@
}
$lasthost=$row["host"];
- if($col++%2 == 1) { echo "<TR BGCOLOR=#DDDDDD>"; }
- else { echo "<TR BGCOLOR=#EEEEEE>"; }
-
-// $description=$row["description"];
-
-// if( strstr($description,"%s"))
-// {
- $description=expand_trigger_description($row["triggerid"]);
-// }
- echo "<TD><a href=\"alarms.php?triggerid=".$row["triggerid"]."\">$description</a></TD>";
-// $description=rawurlencode($row["description"]);
+ $description=expand_trigger_description($row["triggerid"]);
+ $description="<a href=\"alarms.php?triggerid=".$row["triggerid"]."\">$description</a>";
-// echo "<TD>".explode_exp($row["expression"],1)."</TD>";
$availability=calculate_availability($row["triggerid"],0,0);
- echo "<TD><font color=\"AA0000\">";
- printf("%.4f%%",$availability["true"]);
- echo "</font></TD>";
- echo "<TD><font color=\"00AA00\">";
- printf("%.4f%%",$availability["false"]);
- echo "</font></TD>";
- echo "<TD>";
- printf("%.4f%%",$availability["unknown"]);
- echo "</TD>";
- echo "<TD>";
- echo "<a href=\"report2.php?hostid=".$_GET["hostid"]."&triggerid=".$row["triggerid"]."\">".S_SHOW."</a>";
- echo "</TD>";
- echo "</TR>\n";
+
+ $true=array("value"=>sprintf("%.4f%%",$availability["true"]), "class"=>"on");
+ $false=array("value"=>sprintf("%.4f%%",$availability["false"]), "class"=>"off");
+ $unknown=array("value"=>sprintf("%.4f%%",$availability["unknown"]), "class"=>"unknown");
+ $actions="<a href=\"report2.php?hostid=".$_GET["hostid"]."&triggerid=".$row["triggerid"]."\">".S_SHOW."</a>";
+
+ table_row(array(
+ $description,
+ $true,
+ $false,
+ $unknown,
+ $actions
+ ),$col++);
}
- echo "</table>\n";
+ table_end();
}
?>