summaryrefslogtreecommitdiffstats
path: root/frontends/php/report3.php
diff options
context:
space:
mode:
authorhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2004-12-29 12:10:56 +0000
committerhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2004-12-29 12:10:56 +0000
commitca14a88699c81eb597ea4671c035d6e26af53de9 (patch)
treead77b9cfd8c8b0236d516f6e54c7de883099530a /frontends/php/report3.php
parenta790c3ea95d122d3f4779bce8ae0468e4ff79121 (diff)
downloadzabbix-ca14a88699c81eb597ea4671c035d6e26af53de9.tar.gz
zabbix-ca14a88699c81eb597ea4671c035d6e26af53de9.tar.xz
zabbix-ca14a88699c81eb597ea4671c035d6e26af53de9.zip
Fixes for service availability report.
git-svn-id: svn://svn.zabbix.com/trunk@1568 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/report3.php')
-rw-r--r--frontends/php/report3.php45
1 files changed, 22 insertions, 23 deletions
diff --git a/frontends/php/report3.php b/frontends/php/report3.php
index 40b21c9b..fdc4a060 100644
--- a/frontends/php/report3.php
+++ b/frontends/php/report3.php
@@ -76,16 +76,8 @@
echo "<br>";
- echo "<TABLE BORDER=0 COLS=3 WIDTH=100% BGCOLOR=\"#AAAAAA\" cellspacing=1 cellpadding=3>";
- echo "<TR BGCOLOR=\"#CCCCCC\">";
- echo "<TD WIDTH=15%><B>From</B></TD>";
- echo "<TD WIDTH=15%><B>Till</B></TD>";
- echo "<TD WIDTH=10%><B>OK</B></TD>";
- echo "<TD WIDTH=10%><B>Problems</B></TD>";
- echo "<TD WIDTH=15%><B>Percentage</B></TD>";
- echo "<TD><B>SLA</B></TD>";
- echo "</TR>\n";
-
+ table_begin();
+ table_header(array(S_FROM,S_TILL,S_OK,S_PROBLEMS,S_PERCENTAGE,S_SLA));
$col=0;
$year=date("Y");
for($year=date("Y")-2;$year<=date("Y");$year++)
@@ -109,39 +101,46 @@
break;
}
$stat=calculate_service_availability($service["serviceid"],$period_start,$period_end);
-
- if($col++%2==0) { echo "<tr bgcolor=#EEEEEE>"; }
- else { echo "<tr bgcolor=#DDDDDD>"; }
- echo "<td>"; echo date("d M Y",$period_start); echo "</td>";
- echo "<td>"; echo date("d M Y",$period_end); echo "</td>";
+ $from=date("d M Y",$period_start);
+ $till=date("d M Y",$period_end);
+
$t=sprintf("%2.2f%%",$stat["problem"]);
$t_time=sprintf("%dd %dh %dm",$stat["problem_time"]/(24*3600),($stat["problem_time"]%(24*3600))/3600,($stat["problem_time"]%(3600))/(60));
$f=sprintf("%2.2f%%",$stat["ok"]);
$f_time=sprintf("%dd %dh %dm",$stat["ok_time"]/(24*3600),($stat["ok_time"]%(24*3600))/3600,($stat["ok_time"]%(3600))/(60));
- echo "<td>"; echo "<font color=\"00AA00\">$f_time</font>" ; echo "</td>";
- echo "<td>"; echo "<font color=\"AA0000\">$t_time</a>" ; echo "</td>";
- echo "<td>"; echo "<font color=\"00AA00\">$f</font>/<font color=\"AA0000\">$t</font>" ; echo "</td>";
+
+ $ok=array("value"=>$f_time,"class"=>"off");
+ $problems=array("value"=>$t_time,"class"=>"on");
+ $percentage=array("value"=>$f,"class"=>"off");
+
if($service["showsla"]==1)
{
if($stat["ok"]>=$service["goodsla"])
{
- echo "<td><font color=\"00AA00\">".$service["goodsla"]."%</font></td>";
+ $sla=array("value"=>$service["goodsla"],"class"=>"off");
}
else
{
- echo "<td><font color=\"AA0000\">".$service["goodsla"]."%</font></td>";
+ $sla=array("value"=>$service["goodsla"],"class"=>"on");
}
}
else
{
- echo "<td>-</td>";
+ $sla="-";
}
- echo "</tr>";
+ table_row(array(
+ $from,
+ $till,
+ $ok,
+ $problems,
+ $percentage,
+ $sla
+ ),$col++);
}
}
- echo "</TABLE>";
+ table_end();
show_footer();
?>