summaryrefslogtreecommitdiffstats
path: root/frontends/php
diff options
context:
space:
mode:
authorhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2004-11-20 17:08:41 +0000
committerhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2004-11-20 17:08:41 +0000
commit7ce63d5fa0fa7b06e7bb125cceb2521d83a6ad83 (patch)
treeae45e08353c8e756d89d843f7316b3de08ac98b4 /frontends/php
parent6a36d80ad7af382a5e894b64fb4018313549a9dd (diff)
downloadzabbix-7ce63d5fa0fa7b06e7bb125cceb2521d83a6ad83.tar.gz
zabbix-7ce63d5fa0fa7b06e7bb125cceb2521d83a6ad83.tar.xz
zabbix-7ce63d5fa0fa7b06e7bb125cceb2521d83a6ad83.zip
Cosmetic changes.
git-svn-id: svn://svn.zabbix.com/trunk@1498 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php')
-rw-r--r--frontends/php/audit.php4
-rw-r--r--frontends/php/include/config.inc.php42
-rw-r--r--frontends/php/items.php17
-rw-r--r--frontends/php/media.php52
-rw-r--r--frontends/php/report2.php45
-rw-r--r--frontends/php/triggers.php97
6 files changed, 73 insertions, 184 deletions
diff --git a/frontends/php/audit.php b/frontends/php/audit.php
index 31d640a4..dd5c64f3 100644
--- a/frontends/php/audit.php
+++ b/frontends/php/audit.php
@@ -66,7 +66,6 @@
show_table_header_end();
?>
-<FONT COLOR="#000000">
<?php
$sql="select max(auditid) as max from audit";
$result=DBselect($sql);
@@ -155,9 +154,6 @@
}
table_end();
?>
-</FONT>
-</TR>
-</TABLE>
<?php
show_footer();
diff --git a/frontends/php/include/config.inc.php b/frontends/php/include/config.inc.php
index 85c8b626..1b3cf7d3 100644
--- a/frontends/php/include/config.inc.php
+++ b/frontends/php/include/config.inc.php
@@ -1142,12 +1142,12 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid";
}
?>
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta name="Author" content="Alexei Vladishev">
- <link rel="stylesheet" href="css.css">
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<meta name="Author" content="Alexei Vladishev">
+<link rel="stylesheet" href="css.css">
<?php
if($USER_DETAILS['alias']=='guest')
@@ -1164,11 +1164,11 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid";
echo "<title>$title</title>";
}
- echo "</head>";
+echo "</head>";
?>
- <body>
+<body>
<?php
if($nomenu == 0)
{
@@ -1658,14 +1658,14 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid";
);
?>
- <table border=0 cellspacing=0 cellpadding=5 width="100%" bgcolor="#FFFFFF">
- <tr>
- <td width="118" height="31" class="top_header_left"><img width="118" height="31" src="images/general/zabbix.png" border="0" alt="ZABBIX"></td>
- </tr>
- </table>
+<table border=0 cellspacing=0 cellpadding=5 width="100%" bgcolor="#FFFFFF">
+<tr>
+<td width="118" height="31" class="top_header_left"><img width="118" height="31" src="images/general/zabbix.png" border="0" alt="ZABBIX"></td>
+</tr>
+</table>
- <table class="menu" cellspacing=0 cellpadding=5>
- <tr>
+<table class="menu" cellspacing=0 cellpadding=5>
+<tr>
<?php
$i=0;
foreach($menu as $label=>$sub)
@@ -1686,10 +1686,10 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid";
$i++;
}
?>
- </tr>
- </table>
- <table class="menu" width=100% cellspacing=0 cellpadding=5>
- <tr><td class="horizontal_menu" height=24 colspan=9><b>
+</tr>
+</table>
+<table class="menu" width=100% cellspacing=0 cellpadding=5>
+<tr><td class="horizontal_menu" height=24 colspan=9><b>
<?php
$i=0;
foreach($menu[$active_level1]["level2"] as $label=>$sub)
@@ -1702,8 +1702,8 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid";
}
?>
</b></td>
- </table>
- <p>
+</table>
+<p>
<?php
diff --git a/frontends/php/items.php b/frontends/php/items.php
index 40dcdcaa..b2d57993 100644
--- a/frontends/php/items.php
+++ b/frontends/php/items.php
@@ -201,9 +201,12 @@
<?php
- $lasthost="";
if(isset($_GET["hostid"])&&!isset($_GET["type"]))
{
+ table_begin();
+ table_header(array(S_ID,S_KEY,S_DESCRIPTION,nbsp(S_UPDATE_INTERVAL),S_HISTORY,S_TRENDS,S_SHORT_NAME,S_TYPE,S_STATUS,S_ACTIONS));
+ echo "<form method=\"get\" action=\"items.php\">";
+ echo "<input class=\"biginput\" name=\"hostid\" type=hidden value=".$_GET["hostid"]." size=8>";
$result=DBselect("select h.host,i.key_,i.itemid,i.description,h.port,i.delay,i.history,i.lastvalue,i.lastclock,i.status,i.lastdelete,i.nextcheck,h.hostid,i.type,i.trends from hosts h,items i where h.hostid=i.hostid and h.hostid=".$_GET["hostid"]." order by h.host,i.key_,i.description");
$col=0;
while($row=DBfetch($result))
@@ -212,18 +215,6 @@
{
continue;
}
- if($lasthost != $row["host"])
- {
- if($lasthost != "")
- {
- echo "</TABLE><BR>";
- }
- echo "<form method=\"get\" action=\"items.php\">";
- echo "<input class=\"biginput\" name=\"hostid\" type=hidden value=".$_GET["hostid"]." size=8>";
- table_begin();
- table_header(array(S_ID,S_KEY,S_DESCRIPTION,nbsp(S_UPDATE_INTERVAL),S_HISTORY,S_TRENDS,S_SHORT_NAME,S_TYPE,S_STATUS,S_ACTIONS));
- }
- $lasthost=$row["host"];
$input="<INPUT TYPE=\"CHECKBOX\" class=\"biginput\" NAME=\"".$row["itemid"]."\"> ".$row["itemid"];
diff --git a/frontends/php/media.php b/frontends/php/media.php
index e215b8d4..cd4a0312 100644
--- a/frontends/php/media.php
+++ b/frontends/php/media.php
@@ -88,51 +88,31 @@
show_table_header(S_MEDIA_BIG);
?>
-<FONT COLOR="#000000">
<?php
$sql="select m.mediaid,mt.description,m.sendto,m.active from media m,media_type mt where m.mediatypeid=mt.mediatypeid and m.userid=".$_GET["userid"]." order by mt.type,m.sendto";
$result=DBselect($sql);
- echo "<TABLE BORDER=0 WIDTH=100% align=center BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>";
- echo "<TR>";
- echo "<TD><B>".S_TYPE."</B></TD>";
- echo "<TD><B>".S_SEND_TO."</B></TD>";
- echo "<TD><B>".S_STATUS."</B></TD>";
- echo "<TD><B>".S_ACTIONS."</B></TD>";
- echo "</TR>";
+ table_begin();
+ table_header(array(S_TYPE, S_SEND_TO,S_STATUS,S_ACTIONS));
$col=0;
- for($i=0;$i<DBnum_rows($result);$i++)
+ while($row=DBfetch($result))
{
- if($col==1)
- {
- echo "<TR BGCOLOR=#DDDDDD>";
- $col=0;
- } else
+ if($row["active"]==0)
{
- echo "<TR BGCOLOR=#EEEEEE>";
- $col=1;
- }
- $mediaid=DBget_field($result,$i,0);
- $description=DBget_field($result,$i,1);
- echo "<TD>";
- echo $description;
- echo "</TD>";
- echo "<TD>",DBget_field($result,$i,2),"</TD>";
- echo "<TD>";
- if(DBget_field($result,$i,3)==0)
- {
- echo "<a href=\"media.php?register=disable&mediaid=$mediaid&userid=".$_GET["userid"]."\"><font color=\"00AA00\">".S_ENABLED."</font></A>";
+ $status="<a href=\"media.php?register=disable&mediaid=".$row["mediaid"]."&userid=".$_GET["userid"]."\"><font color=\"00AA00\">".S_ENABLED."</font></A>";
}
else
{
- echo "<a href=\"media.php?register=enable&mediaid=$mediaid&userid=".$_GET["userid"]."\"><font color=\"AA0000\">".S_DISABLED."</font></A>";
+ $status="<a href=\"media.php?register=enable&mediaid=".$row["mediaid"]."&userid=".$_GET["userid"]."\"><font color=\"AA0000\">".S_DISABLED."</font></A>";
}
- echo "</TD>";
- echo "<TD>";
- echo "<A HREF=\"media.php?register=change&mediaid=$mediaid&userid=".$_GET["userid"]."\">".S_CHANGE."</A>";
- echo "</TD>";
- echo "</TR>";
+ $actions="<A HREF=\"media.php?register=change&mediaid=".$row["mediaid"]."&userid=".$_GET["userid"]."\">".S_CHANGE."</A>";
+ table_row(array(
+ $row["description"],
+ $row["sendto"],
+ $status,
+ $actions
+ ),$col++);
}
if(DBnum_rows($result)==0)
{
@@ -140,12 +120,8 @@
echo "<TD COLSPAN=4 ALIGN=CENTER>".S_NO_MEDIA_DEFINED."</TD>";
echo "<TR>";
}
-
- echo "</TABLE>";
+ table_end();
?>
-</FONT>
-</TR>
-</TABLE>
<?php
if(isset($_GET["mediaid"]))
diff --git a/frontends/php/report2.php b/frontends/php/report2.php
index d15a2d91..8a3b2c96 100644
--- a/frontends/php/report2.php
+++ b/frontends/php/report2.php
@@ -93,51 +93,6 @@
show_header2($h1, $h2, "<form name=\"form2\" method=\"get\" action=\"report2.php\">", "</form>");
?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<?php
-/*
- show_table_header_begin();
- echo S_AVAILABILITY_REPORT_BIG;
-
- show_table_v_delimiter();
-
- $result=DBselect("select h.hostid,h.host from hosts h,items i where h.status in (0,2) and h.hostid=i.hostid group by h.hostid,h.host order by h.host");
-
- while($row=DBfetch($result))
- {
- if(!check_right("Host","R",$row["hostid"]))
- {
- continue;
- }
- if( isset($_GET["hostid"]) && ($_GET["hostid"] == $row["hostid"]) )
- {
- echo "<b>[";
- }
- echo "<a href='report2.php?hostid=".$row["hostid"]."'>".$row["host"]."</a>";
- if(isset($_GET["hostid"]) && ($_GET["hostid"] == $row["hostid"]) )
- {
- echo "]</b>";
- }
- echo " ";
- }
-
- show_table_header_end();
-*/
-?>
-
<?php
if(isset($_GET["hostid"])&&!isset($_GET["triggerid"]))
{
diff --git a/frontends/php/triggers.php b/frontends/php/triggers.php
index edfddc60..3aeee56d 100644
--- a/frontends/php/triggers.php
+++ b/frontends/php/triggers.php
@@ -211,9 +211,12 @@
if(isset($_GET["hostid"])&&!isset($_GET["triggerid"]))
{
+ table_begin();
+ table_header(array(S_ID,S_DESCRIPTION,S_EXPRESSION, S_SEVERITY, S_STATUS, S_ACTIONS));
+ echo "<form method=\"get\" action=\"triggers.php\">";
+ echo "<input class=\"biginput\" name=\"hostid\" type=hidden value=".$_GET["hostid"]." size=8>";
$result=DBselect("select distinct h.hostid,h.host,t.triggerid,t.expression,t.description,t.status,t.value,t.priority from triggers t,hosts h,items i,functions f where f.itemid=i.itemid and h.hostid=i.hostid and t.triggerid=f.triggerid and h.hostid=".$_GET["hostid"]." order by h.host,t.description");
- $lasthost="";
$col=0;
while($row=DBfetch($result))
{
@@ -221,104 +224,72 @@
{
continue;
}
- if($lasthost!=$row["host"])
- {
- if($lasthost!="")
- {
- echo "</TABLE><BR>";
- }
-# echo "<br>";
-# show_table_header("<A HREF='triggers.php?hostid=".$row["hostid"]."'>".$row["host"]."</A>");
- echo "<form method=\"get\" action=\"triggers.php\">";
- echo "<input class=\"biginput\" name=\"hostid\" type=hidden value=".$_GET["hostid"]." size=8>";
- echo "<TABLE BORDER=0 COLS=3 WIDTH=100% BGCOLOR=\"#AAAAAA\" cellspacing=1 cellpadding=3>";
- echo "<TR BGCOLOR=\"#CCCCCC\">";
- echo "<TD WIDTH=\"8%\"><B>Id</B></TD>";
- echo "<TD><B>".S_DESCRIPTION."</B></TD>";
- echo "<TD><B>".S_EXPRESSION."</B></TD>";
- echo "<TD WIDTH=5%><B>".S_SEVERITY."</B></TD>";
- echo "<TD WIDTH=5%><B>".S_STATUS."</B></TD>";
- echo "<TD WIDTH=15% NOSAVE><B>".S_ACTIONS."</B></TD>";
- echo "</TR>\n";
- }
- $lasthost=$row["host"];
- if($col++%2 == 1) { echo "<TR BGCOLOR=#DDDDDD>"; }
- else { echo "<TR BGCOLOR=#EEEEEE>"; }
-
-// $description=stripslashes(htmlspecialchars($row["description"]));
-
-// if( strstr($description,"%s"))
-// {
- $description=expand_trigger_description($row["triggerid"]);
-// }
- echo "<TD><INPUT TYPE=\"CHECKBOX\" class=\"biginput\" NAME=\"".$row["triggerid"]."\"> ".$row["triggerid"]."</TD>";
- echo "<TD>";
- echo $description;
+ $description=expand_trigger_description($row["triggerid"]);
+ $id="<INPUT TYPE=\"CHECKBOX\" class=\"biginput\" NAME=\"".$row["triggerid"]."\"> ".$row["triggerid"];
$sql="select t.triggerid,t.description from triggers t,trigger_depends d where t.triggerid=d.triggerid_up and d.triggerid_down=".$row["triggerid"];
$result1=DBselect($sql);
if(DBnum_rows($result1)>0)
{
- echo "<p><strong>".S_DEPENDS_ON."</strong>:&nbsp;<br>";
+ $description=$description."<p><strong>".S_DEPENDS_ON."</strong>:&nbsp;<br>";
for($i=0;$i<DBnum_rows($result1);$i++)
{
$depid=DBget_field($result1,$i,0);
$depdescr=expand_trigger_description($depid);
- echo "$depdescr<br>";
+ $description=$description."$depdescr<br>";
}
- echo "</p>";
+ $description=$description."</p>";
}
- echo "</TD>";
-
- echo "<TD>".explode_exp($row["expression"],1)."</TD>";
-
- if($row["priority"]==0) echo "<TD ALIGN=CENTER>".S_NOT_CLASSIFIED."</TD>";
- elseif($row["priority"]==1) echo "<TD ALIGN=CENTER>".S_INFORMATION."</TD>";
- elseif($row["priority"]==2) echo "<TD ALIGN=CENTER>".S_WARNING."</TD>";
- elseif($row["priority"]==3) echo "<TD ALIGN=CENTER BGCOLOR=#DDAAAA>".S_AVERAGE."</TD>";
- elseif($row["priority"]==4) echo "<TD ALIGN=CENTER BGCOLOR=#FF8888>".S_HIGH."</TD>";
- elseif($row["priority"]==5) echo "<TD ALIGN=CENTER BGCOLOR=RED>".S_DISASTER."</TD>";
- else echo "<TD ALIGN=CENTER><B>".$row["priority"]."</B></TD>";
+ if($row["priority"]==0) $priority=S_NOT_CLASSIFIED;
+ elseif($row["priority"]==1) $priority=S_INFORMATION;
+ elseif($row["priority"]==2) $priority=S_WARNING;
+ elseif($row["priority"]==3) $priority=array("value"=>S_AVERAGE,"class"=>"average");
+ elseif($row["priority"]==4) $priority=array("value"=>S_HIGH,"class"=>"high");
+ elseif($row["priority"]==5) $priority=array("value"=>S_DISASTER,"class"=>"disaster");
+ else $priority=$row["priority"];
- echo "<TD>";
if($row["status"] == 1)
{
- echo "<a href=\"triggers.php?register=changestatus&triggerid=".$row["triggerid"]."&status=0&hostid=".$row["hostid"]."\"><font color=\"AA0000\">".S_DISABLED."</font></a>";
+ $status="<a href=\"triggers.php?register=changestatus&triggerid=".$row["triggerid"]."&status=0&hostid=".$row["hostid"]."\"><font color=\"AA0000\">".S_DISABLED."</font></a>";
}
else if($row["status"] == 2)
{
- echo "<a href=\"triggers.php?register=changestatus&triggerid=".$row["triggerid"]."&status=1&hostid=".$row["hostid"]."\"><font color=\"AAAAAA\">".S_UNKNOWN."</font></a>";
+ $status="<a href=\"triggers.php?register=changestatus&triggerid=".$row["triggerid"]."&status=1&hostid=".$row["hostid"]."\"><font color=\"AAAAAA\">".S_UNKNOWN."</font></a>";
}
else
{
- echo "<a href=\"triggers.php?register=changestatus&triggerid=".$row["triggerid"]."&status=1&hostid=".$row["hostid"]."\"><font color=\"00AA00\">".S_ENABLED."</font></a>";
+ $status="<a href=\"triggers.php?register=changestatus&triggerid=".$row["triggerid"]."&status=1&hostid=".$row["hostid"]."\"><font color=\"00AA00\">".S_ENABLED."</font></a>";
}
- $expression=rawurlencode($row["expression"]);
- echo "</TD>";
+// $expression=rawurlencode($row["expression"]);
- echo "<TD>";
if(isset($_GET["hostid"]))
{
- echo "<A HREF=\"triggers.php?triggerid=".$row["triggerid"]."&hostid=".$row["hostid"]."#form\">".S_CHANGE."</A> ";
+ $actions="<A HREF=\"triggers.php?triggerid=".$row["triggerid"]."&hostid=".$row["hostid"]."#form\">".S_CHANGE."</A> ";
}
else
{
- echo "<A HREF=\"triggers.php?triggerid=".$row["triggerid"]."#form\">".S_CHANGE."</A> ";
+ $actions="<A HREF=\"triggers.php?triggerid=".$row["triggerid"]."#form\">".S_CHANGE."</A> ";
}
- echo "-";
+ $actions=$actions."-";
if(get_action_count_by_triggerid($row["triggerid"])>0)
{
- echo "<A HREF=\"actions.php?triggerid=".$row["triggerid"]."\"><b>A</b>ctions</A>";
+ $actions=$actions."<A HREF=\"actions.php?triggerid=".$row["triggerid"]."\"><b>A</b>ctions</A>";
}
else
{
- echo "<A HREF=\"actions.php?triggerid=".$row["triggerid"]."\">".S_ACTIONS."</A>";
+ $actions=$actions."<A HREF=\"actions.php?triggerid=".$row["triggerid"]."\">".S_ACTIONS."</A>";
}
- echo "</TD>";
- echo "</TR>";
+ table_row(array(
+ $id,
+ $description,
+ explode_exp($row["expression"],1),
+ $priority,
+ $status,
+ $actions
+ ),$col++);
}
- echo "</table>";
+ table_end();
show_table2_header_begin();
echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"enable selected\" onClick=\"return Confirm('".S_ENABLE_SELECTED_TRIGGERS_Q."');\">";
echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"disable selected\" onClick=\"return Confirm('Disable selected triggers?');\">";