summaryrefslogtreecommitdiffstats
path: root/frontends/php
diff options
context:
space:
mode:
authorhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2004-11-13 11:56:12 +0000
committerhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2004-11-13 11:56:12 +0000
commite7b40fc153ce6f7be399380f45e22ee48e2ceb00 (patch)
tree5566c4f33373d2fd94c44faf78973ff03b355778 /frontends/php
parent6fe1ce1513c87a8b20c2281a342303aebc0a2414 (diff)
downloadzabbix-e7b40fc153ce6f7be399380f45e22ee48e2ceb00.tar.gz
zabbix-e7b40fc153ce6f7be399380f45e22ee48e2ceb00.tar.xz
zabbix-e7b40fc153ce6f7be399380f45e22ee48e2ceb00.zip
PHP GUI improvements.
git-svn-id: svn://svn.zabbix.com/trunk@1478 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php')
-rw-r--r--frontends/php/alerts.php22
-rw-r--r--frontends/php/charts.php25
-rw-r--r--frontends/php/hosts.php54
-rw-r--r--frontends/php/include/config.inc.php34
-rw-r--r--frontends/php/items.php39
-rw-r--r--frontends/php/latest.php43
-rw-r--r--frontends/php/latestalarms.php19
-rw-r--r--frontends/php/maps.php32
-rw-r--r--frontends/php/screens.php23
-rw-r--r--frontends/php/triggers.php48
10 files changed, 157 insertions, 182 deletions
diff --git a/frontends/php/alerts.php b/frontends/php/alerts.php
index d95bfffd..72215262 100644
--- a/frontends/php/alerts.php
+++ b/frontends/php/alerts.php
@@ -48,24 +48,22 @@
?>
<?php
- show_table3_header_begin();
- echo "&nbsp;".S_ALERT_HISTORY_BIG;
- show_table3_h_delimiter(20);
- echo "<span style=\"float:right\">";
- echo "<form name=\"form2\" method=\"get\" action=\"alerts.php\">";
+ $h1="&nbsp;".S_ALERT_HISTORY_BIG;
+
+ $h2="";
+
if(isset($_GET["start"]))
{
- echo "<input class=\"biginput\" name=\"start\" type=hidden value=".$_GET["start"]." size=8>";
- echo "<input class=\"button\" type=\"submit\" name=\"do\" value=\"<< Prev 100\">";
+ $h2=$h2."<input class=\"biginput\" name=\"start\" type=hidden value=".$_GET["start"]." size=8>";
+ $h2=$h2."<input class=\"button\" type=\"submit\" name=\"do\" value=\"<< Prev 100\">";
}
else
{
- echo "<input class=\"button\" type=\"submit\" disabled name=\"do\" value=\"<< Prev 100\">";
+ $h2=$h2."<input class=\"button\" type=\"submit\" disabled name=\"do\" value=\"<< Prev 100\">";
}
- echo "<input class=\"button\" type=\"submit\" name=\"do\" value=\"Next 100 >>\">";
- echo "</form>";
- echo "</span>";
- show_table_header_end();
+ $h2=$h2."<input class=\"button\" type=\"submit\" name=\"do\" value=\"Next 100 >>\">";
+
+ show_header2($h1,$h2,"<form name=\"form2\" method=\"get\" action=\"alerts.php\">","</form>");
?>
<FONT COLOR="#000000">
diff --git a/frontends/php/charts.php b/frontends/php/charts.php
index 7cab2310..0a4758b5 100644
--- a/frontends/php/charts.php
+++ b/frontends/php/charts.php
@@ -56,8 +56,6 @@
{
- show_table3_header_begin();
-
if(isset($_GET["graphid"])&&($_GET["graphid"]==0))
{
unset($_GET["graphid"]);
@@ -67,23 +65,21 @@
{
$result=DBselect("select name from graphs where graphid=".$_GET["graphid"]);
$graph=DBget_field($result,0,0);
- $graph=iif(isset($_GET["fullscreen"]),
+ $h1=iif(isset($_GET["fullscreen"]),
"<a href=\"charts.php?graphid=".$_GET["graphid"]."\">".$graph."</a>",
"<a href=\"charts.php?graphid=".$_GET["graphid"]."&fullscreen=1\">".$graph."</a>");
}
else
{
- $graph=S_SELECT_GRAPH_TO_DISPLAY;
+ $h1=S_SELECT_GRAPH_TO_DISPLAY;
}
- echo S_GRAPHS_BIG.nbsp(" / ").$graph;
-// Start of new code
- show_table3_h_delimiter();
- echo "<form name=\"form2\" method=\"get\" action=\"charts.php\">";
+ $h1=S_GRAPHS_BIG.nbsp(" / ").$h1;
+ $h2="";
if(isset($_GET["fullscreen"]))
{
- echo "<input name=\"fullscreen\" type=\"hidden\" value=".$_GET["fullscreen"].">";
+ $h2="<input name=\"fullscreen\" type=\"hidden\" value=".$_GET["fullscreen"].">";
}
if(isset($_GET["graphid"])&&($_GET["graphid"]==0))
@@ -91,8 +87,8 @@
unset($_GET["graphid"]);
}
- echo "<select class=\"biginput\" name=\"graphid\" onChange=\"submit()\">";
- echo "<option value=\"0\" ".iif(!isset($_GET["graphid"]),"selected","").">".S_SELECT_GRAPH_DOT_DOT_DOT;
+ $h2=$h2."<select class=\"biginput\" name=\"graphid\" onChange=\"submit()\">";
+ $h2=$h2."<option value=\"0\" ".iif(!isset($_GET["graphid"]),"selected","").">".S_SELECT_GRAPH_DOT_DOT_DOT;
$result=DBselect("select graphid,name from graphs order by name");
while($row=DBfetch($result))
@@ -101,12 +97,11 @@
{
continue;
}
- echo "<option value=\"".$row["graphid"]."\" ".iif(isset($_GET["graphid"])&&($_GET["graphid"]==$row["graphid"]),"selected","").">".$row["name"];
+ $h2=$h2."<option value=\"".$row["graphid"]."\" ".iif(isset($_GET["graphid"])&&($_GET["graphid"]==$row["graphid"]),"selected","").">".$row["name"];
}
- echo "</select>";
- echo "</form>";
+ $h2=$h2."</select>";
- show_table_header_end();
+ show_header2($h1,$h2,"<form name=\"form2\" method=\"get\" action=\"charts.php\">","</form>");
}
?>
diff --git a/frontends/php/hosts.php b/frontends/php/hosts.php
index 409ecc15..ba938012 100644
--- a/frontends/php/hosts.php
+++ b/frontends/php/hosts.php
@@ -147,47 +147,49 @@
?>
<?php
- show_table_header_begin();
- echo S_CONFIGURATION_OF_HOSTS_BIG;
- show_table_v_delimiter();
-
- if(isset($_GET["groupid"]))
- {
-// echo "all ";
- echo "<a href='hosts.php'>".S_ALL_SMALL."</a> ";
- }
- else
+ if(isset($_GET["groupid"])&&($_GET["groupid"]==0))
{
- echo "<b>[<a href='hosts.php'>".S_ALL_SMALL."</a>]</b> ";
+ unset($_GET["groupid"]);
}
+?>
- $result=DBselect("select groupid,name from groups order by name");
+<?php
+ if(!isset($_GET["hostid"]))
+{
+ $h1="&nbsp;".S_CONFIGURATION_OF_HOSTS_BIG;
+
+ $h2_form1="<form name=\"form2\" method=\"get\" action=\"latest.php\">";
+
+
+ $h2=S_GROUP."&nbsp;";
+ $h2=$h2."<select class=\"biginput\" name=\"groupid\" onChange=\"submit()\">";
+ $h2=$h2."<option value=\"0\" ".iif(!isset($_GET["groupid"])," selected","").">".S_ALL_SMALL;
+ $result=DBselect("select groupid,name from groups order by name");
while($row=DBfetch($result))
{
-// if(!check_right("Host","R",$row["hostid"]))
-// {
-// continue;
-// }
- if( isset($_GET["groupid"]) && ($_GET["groupid"] == $row["groupid"]) )
+// Check if at least one host with read permission exists for this group
+ $result2=DBselect("select h.hostid,h.host from hosts h,items i,hosts_groups hg where h.hostid=i.hostid and hg.groupid=".$row["groupid"]." and hg.hostid=h.hostid group by h.hostid,h.host order by h.host");
+ $cnt=0;
+ while($row2=DBfetch($result2))
{
- echo "<b>[";
+ if(!check_right("Host","R",$row2["hostid"]))
+ {
+ continue;
+ }
+ $cnt=1; break;
}
- echo "<a href='hosts.php?groupid=".$row["groupid"]."'>".$row["name"]."</a>";
- if(isset($_GET["groupid"]) && ($_GET["groupid"] == $row["groupid"]) )
+ if($cnt!=0)
{
- echo "]</b>";
+ $h2=$h2."<option value=\"".$row["groupid"]."\" ".iif(isset($_GET["groupid"])&&($_GET["groupid"]==$row["groupid"]),"selected","").">".$row["name"];
}
- echo " ";
}
+ $h2=$h2."</select>";
- show_table_header_end();
- echo "<br>";
+ show_header2($h1, $h2, "<form name=\"form2\" method=\"get\" action=\"hosts.php\">", "</form>");
?>
<?php
- if(!isset($_GET["hostid"]))
-{
table_begin();
table_header(array(S_ID,S_HOST,S_IP,S_PORT,S_STATUS,S_ACTIONS));
diff --git a/frontends/php/include/config.inc.php b/frontends/php/include/config.inc.php
index db51741a..eee70348 100644
--- a/frontends/php/include/config.inc.php
+++ b/frontends/php/include/config.inc.php
@@ -3718,27 +3718,31 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid";
cr();
}
+ function show_header2($h1, $h2, $h2_form1, $h2_form2)
+ {
+?>
+ <table class="menu" cellspacing=0 cellpadding=1 width="100%">
+ <tr>
+ <td class="sub_menu" height=24 align=left>
+ <?php echo $h1; ?>
+ </td>
+ <?php echo $h2_form1; ?>
+ <td class="sub_menu" height=24 align=right>
+ <?php echo $h2; ?>
+ </td>
+ <?php echo $h2_form2; ?>
+ </tr>
+ </table>
+<?php
+ }
+
function show_table3_header_begin()
{
?>
<table class="menu" cellspacing=0 cellpadding=1 width="100%">
<tr>
<?php
- echo "<td class=\"sub_menu\" height=24 colspan=9 nowrap=\"nowrap\">";
-/*
- echo "<table border=0 align=center cellspacing=0 cellpadding=0 width=100% bgcolor=000000>";
- cr();
- echo "<tr>";
- cr();
- echo "<td valign=\"top\">";
- cr();
- echo "<table width=100% border=0 cellspacing=1 cellpadding=1>";
- cr();
- echo "<tr>";
- cr();
- echo "<td colspan=1 bgcolor=#6d88ad align=left valign=\"medium\">";
- cr();
- cr();*/
+ echo "<td class=\"sub_menu\" height=24 colspan=9 nowrap=\"nowrap\">";
}
diff --git a/frontends/php/items.php b/frontends/php/items.php
index e229f446..40dcdcaa 100644
--- a/frontends/php/items.php
+++ b/frontends/php/items.php
@@ -140,27 +140,22 @@
?>
<?php
- show_table3_header_begin();
- echo S_CONFIGURATION_OF_ITEMS_BIG;;
- show_table3_h_delimiter(40);
-
-// Start of new code
- echo "<form name=\"form2\" method=\"get\" action=\"items.php\">";
+ $h1=S_CONFIGURATION_OF_ITEMS_BIG;;
if(isset($_GET["groupid"])&&($_GET["groupid"]==0))
{
unset($_GET["groupid"]);
}
- echo S_GROUP."&nbsp;";
- echo "<select class=\"biginput\" name=\"groupid\" onChange=\"submit()\">";
- echo "<option value=\"0\" ".iif(!isset($_GET["groupid"]),"selected","").">".S_ALL_SMALL;
+ $h2=S_GROUP."&nbsp;";
+ $h2=$h2."<select class=\"biginput\" name=\"groupid\" onChange=\"submit()\">";
+ $h2=$h2."<option value=\"0\" ".iif(!isset($_GET["groupid"]),"selected","").">".S_ALL_SMALL;
$result=DBselect("select groupid,name from groups order by name");
while($row=DBfetch($result))
{
// Check if at least one host with read permission exists for this group
- $result2=DBselect("select h.hostid,h.host from hosts h,hosts_groups hg where h.status in (0,2) and hg.groupid=".$row["groupid"]." and hg.hostid=h.hostid group by h.hostid,h.host order by h.host");
+ $result2=DBselect("select h.hostid,h.host from hosts h,hosts_groups hg where hg.groupid=".$row["groupid"]." and hg.hostid=h.hostid group by h.hostid,h.host order by h.host");
$cnt=0;
while($row2=DBfetch($result2))
{
@@ -172,22 +167,22 @@
}
if($cnt!=0)
{
- echo "<option value=\"".$row["groupid"]."\" ".iif(isset($_GET["groupid"])&&($_GET["groupid"]==$row["groupid"]),"selected","").">".$row["name"];
+ $h2=$h2."<option value=\"".$row["groupid"]."\" ".iif(isset($_GET["groupid"])&&($_GET["groupid"]==$row["groupid"]),"selected","").">".$row["name"];
}
}
- echo "</select>";
+ $h2=$h2."</select>";
- echo "&nbsp;".S_HOST."&nbsp;";
- echo "<select class=\"biginput\" name=\"hostid\" onChange=\"submit()\">";
- echo "<option value=\"0\" ".iif(!isset($_GET["hostid"]),"selected","").">".S_SELECT_HOST_DOT_DOT_DOT;
+ $h2=$h2."&nbsp;".S_HOST."&nbsp;";
+ $h2=$h2."<select class=\"biginput\" name=\"hostid\" onChange=\"submit()\">";
+ $h2=$h2."<option value=\"0\" ".iif(!isset($_GET["hostid"]),"selected","").">".S_SELECT_HOST_DOT_DOT_DOT;
if(isset($_GET["groupid"]))
{
- $sql="select h.hostid,h.host from hosts h,hosts_groups hg where h.status in (0,2) and hg.groupid=".$_GET["groupid"]." and hg.hostid=h.hostid group by h.hostid,h.host order by h.host";
+ $sql="select h.hostid,h.host from hosts h,hosts_groups hg where hg.groupid=".$_GET["groupid"]." and hg.hostid=h.hostid group by h.hostid,h.host order by h.host";
}
else
{
- $sql="select h.hostid,h.host from hosts h where h.status in (0,2) group by h.hostid,h.host order by h.host";
+ $sql="select h.hostid,h.host from hosts h group by h.hostid,h.host order by h.host";
}
$result=DBselect($sql);
@@ -197,14 +192,14 @@
{
continue;
}
- echo "<option value=\"".$row["hostid"]."\"".iif(isset($_GET["hostid"])&&($_GET["hostid"]==$row["hostid"]),"selected","").">".$row["host"];
+ $h2=$h2."<option value=\"".$row["hostid"]."\"".iif(isset($_GET["hostid"])&&($_GET["hostid"]==$row["hostid"]),"selected","").">".$row["host"];
}
- echo "</select>";
+ $h2=$h2."</select>";
- echo "</form>";
-// end of new code
+ show_header2($h1, $h2, "<form name=\"form2\" method=\"get\" action=\"items.php\">", "</form>");
+?>
- show_table_header_end();
+<?php
$lasthost="";
if(isset($_GET["hostid"])&&!isset($_GET["type"]))
diff --git a/frontends/php/latest.php b/frontends/php/latest.php
index 0c93af54..d1e11ec4 100644
--- a/frontends/php/latest.php
+++ b/frontends/php/latest.php
@@ -54,15 +54,11 @@
?>
<?php
- show_table3_header_begin();
- echo "&nbsp;".S_LATEST_DATA;
- show_table3_h_delimiter(60);
- echo "<span style=\"float:right\">";
- echo "<form name=\"form2\" method=\"get\" action=\"latest.php\">";
- echo S_GROUP."&nbsp;";
- echo "<select class=\"biginput\" name=\"groupid\" onChange=\"submit()\">";
- echo "<option value=\"0\" ".iif(!isset($_GET["groupid"]),"selected","").">".S_ALL_SMALL;
+ $h1="&nbsp;".S_LATEST_DATA;
+ $h2=S_GROUP."&nbsp;";
+ $h2=$h2."<select class=\"biginput\" name=\"groupid\" onChange=\"submit()\">";
+ $h2=$h2."<option value=\"0\" ".iif(!isset($_GET["groupid"]),"selected","").">".S_ALL_SMALL;
$result=DBselect("select groupid,name from groups order by name");
while($row=DBfetch($result))
{
@@ -79,14 +75,14 @@
}
if($cnt!=0)
{
- echo "<option value=\"".$row["groupid"]."\" ".iif(isset($_GET["groupid"])&&($_GET["groupid"]==$row["groupid"]),"selected","").">".$row["name"];
+ $h2=$h2."<option value=\"".$row["groupid"]."\" ".iif(isset($_GET["groupid"])&&($_GET["groupid"]==$row["groupid"]),"selected","").">".$row["name"];
}
}
- echo "</select>";
+ $h2=$h2."</select>";
- echo "&nbsp;".S_HOST."&nbsp;";
- echo "<select class=\"biginput\" name=\"hostid\" onChange=\"submit()\">";
- echo "<option value=\"0\"".iif(!isset($_GET["hostid"])||($_GET["hostid"]==0),"selected","").">".S_SELECT_HOST_DOT_DOT_DOT;
+ $h2=$h2."&nbsp;".S_HOST."&nbsp;";
+ $h2=$h2."<select class=\"biginput\" name=\"hostid\" onChange=\"submit()\">";
+ $h2=$h2."<option value=\"0\"".iif(!isset($_GET["hostid"])||($_GET["hostid"]==0),"selected","").">".S_SELECT_HOST_DOT_DOT_DOT;
if(isset($_GET["groupid"]))
{
@@ -104,11 +100,11 @@
{
continue;
}
- echo "<option value=\"".$row["hostid"]."\"".iif(isset($_GET["hostid"])&&($_GET["hostid"]==$row["hostid"]),"selected","").">".$row["host"];
+ $h2=$h2."<option value=\"".$row["hostid"]."\"".iif(isset($_GET["hostid"])&&($_GET["hostid"]==$row["hostid"]),"selected","").">".$row["host"];
}
- echo "</select>";
+ $h2=$h2."</select>";
- echo nbsp(" ");
+ $h2=$h2.nbsp(" ");
if(isset($_GET["select"])&&($_GET["select"]==""))
{
@@ -116,21 +112,20 @@
}
if(isset($_GET["select"]))
{
- echo $_GET["select"];
+ $h2=$h2.$_GET["select"];
}
if(isset($_GET["select"]))
{
- echo "<input class=\"biginput\" type=\"text\" name=\"select\" value=\"".$_GET["select"]."\">";
+ $h2=$h2."<input class=\"biginput\" type=\"text\" name=\"select\" value=\"".$_GET["select"]."\">";
}
else
{
- echo "<input class=\"biginput\" type=\"text\" name=\"select\" value=\"\">";
+ $h2=$h2."<input class=\"biginput\" type=\"text\" name=\"select\" value=\"\">";
}
- echo nbsp(" ");
- echo "<input class=\"button\" type=\"submit\" name=\"do\" value=\"select\">";
- echo "</form>";
- echo "</span>";
- show_table_header_end();
+ $h2=$h2.nbsp(" ");
+ $h2=$h2."<input class=\"button\" type=\"submit\" name=\"do\" value=\"select\">";
+
+ show_header2($h1, $h2, "<form name=\"form2\" method=\"get\" action=\"latest.php\">", "</form>");
?>
<?php
diff --git a/frontends/php/latestalarms.php b/frontends/php/latestalarms.php
index 7710fcae..6e1e7b4c 100644
--- a/frontends/php/latestalarms.php
+++ b/frontends/php/latestalarms.php
@@ -48,22 +48,21 @@
?>
<?php
- show_table3_header_begin();
- echo "&nbsp;".S_HISTORY_OF_EVENTS_BIG;
- show_table3_h_delimiter(20);
- echo "<form name=\"form2\" method=\"get\" action=\"latestalarms.php\">";
+ $h1="&nbsp;".S_HISTORY_OF_EVENTS_BIG;
+
+ $h2="";
if(isset($_GET["start"]))
{
- echo "<input class=\"biginput\" name=\"start\" type=hidden value=".$_GET["start"]." size=8>";
- echo "<input class=\"button\" type=\"submit\" name=\"do\" value=\"<< Prev 100\">";
+ $h2=$h2."<input class=\"biginput\" name=\"start\" type=hidden value=".$_GET["start"]." size=8>";
+ $h2=$h2."<input class=\"button\" type=\"submit\" name=\"do\" value=\"<< Prev 100\">";
}
else
{
- echo "<input class=\"button\" type=\"submit\" disabled name=\"do\" value=\"<< Prev 100\">";
+ $h2=$h2."<input class=\"button\" type=\"submit\" disabled name=\"do\" value=\"<< Prev 100\">";
}
- echo "<input class=\"button\" type=\"submit\" name=\"do\" value=\"Next 100 >>\">";
- echo "</form>";
- show_table_header_end();
+ $h2=$h2."<input class=\"button\" type=\"submit\" name=\"do\" value=\"Next 100 >>\">";
+ show_header2($h1,$h2,"<form name=\"form2\" method=\"get\" action=\"latestalarms.php\">","</form>");
+
?>
<FONT COLOR="#000000">
diff --git a/frontends/php/maps.php b/frontends/php/maps.php
index 040fa7b2..3312517b 100644
--- a/frontends/php/maps.php
+++ b/frontends/php/maps.php
@@ -60,24 +60,23 @@
if(isset($_GET["sysmapid"]))
{
$result=DBselect("select name from sysmaps where sysmapid=".$_GET["sysmapid"]);
- $map=DBget_field($result,0,0);
- $map=iif(isset($_GET["fullscreen"]),
- "<a href=\"maps.php?sysmapid=".$_GET["sysmapid"]."\">".$map."</a>",
- "<a href=\"maps.php?sysmapid=".$_GET["sysmapid"]."&fullscreen=1\">".$map."</a>");
+ $h1=DBget_field($result,0,0);
+ $h1=iif(isset($_GET["fullscreen"]),
+ "<a href=\"maps.php?sysmapid=".$_GET["sysmapid"]."\">".$h1."</a>",
+ "<a href=\"maps.php?sysmapid=".$_GET["sysmapid"]."&fullscreen=1\">".$h1."</a>");
}
else
{
- $map=S_SELECT_MAP_TO_DISPLAY;
+ $h1=S_SELECT_MAP_TO_DISPLAY;
}
- echo S_NETWORK_MAPS_BIG.nbsp(" / ").$map;
-// Start of new code
- show_table3_h_delimiter();
- echo "<form name=\"form2\" method=\"get\" action=\"maps.php\">";
+ $h1=S_NETWORK_MAPS_BIG.nbsp(" / ").$h1;
+
+ $h2="";
if(isset($_GET["fullscreen"]))
{
- echo "<input name=\"fullscreen\" type=\"hidden\" value=".$_GET["fullscreen"].">";
+ $h2=$h2."<input name=\"fullscreen\" type=\"hidden\" value=".$_GET["fullscreen"].">";
}
if(isset($_GET["sysmapid"])&&($_GET["sysmapid"]==0))
@@ -85,8 +84,8 @@
unset($_GET["sysmapid"]);
}
- echo "<select class=\"biginput\" name=\"sysmapid\" onChange=\"submit()\">";
- echo "<option value=\"0\" ".iif(!isset($_GET["groupid"]),"selected","").">".S_SELECT_MAP_DOT_DOT_DOT;
+ $h2=$h2."<select class=\"biginput\" name=\"sysmapid\" onChange=\"submit()\">";
+ $h2=$h2."<option value=\"0\" ".iif(!isset($_GET["groupid"]),"selected","").">".S_SELECT_MAP_DOT_DOT_DOT;
$result=DBselect("select sysmapid,name from sysmaps order by name");
while($row=DBfetch($result))
@@ -95,14 +94,11 @@
{
continue;
}
- echo "<option value=\"".$row["sysmapid"]."\" ".iif(isset($_GET["sysmapid"])&&($_GET["sysmapid"]==$row["sysmapid"]),"selected","").">".$row["name"];
+ $h2=$h2."<option value=\"".$row["sysmapid"]."\" ".iif(isset($_GET["sysmapid"])&&($_GET["sysmapid"]==$row["sysmapid"]),"selected","").">".$row["name"];
}
- echo "</select>";
- echo "</form>";
-// End of new code
+ $h2=$h2."</select>";
- show_table_header_end();
-// echo "<br>";
+ show_header2($h1,$h2,"<form name=\"form2\" method=\"get\" action=\"maps.php\">","</form>");
}
?>
diff --git a/frontends/php/screens.php b/frontends/php/screens.php
index c3e810c2..3a8e4aa8 100644
--- a/frontends/php/screens.php
+++ b/frontends/php/screens.php
@@ -39,8 +39,6 @@
?>
<?php
- show_table3_header_begin();
-
if(isset($_GET["screenid"])&&($_GET["screenid"]==0))
{
unset($_GET["screenid"]);
@@ -59,18 +57,16 @@
$map=S_SELECT_SCREEN_TO_DISPLAY;
}
- echo S_SCREENS_BIG.nbsp(" / ").$map;
-// Start of new code
- show_table3_h_delimiter();
- echo "<form name=\"form2\" method=\"get\" action=\"screens.php\">";
+ $h1=S_SCREENS_BIG.nbsp(" / ").$map;
+ $h2="";
if(isset($_GET["fullscreen"]))
{
- echo "<input name=\"fullscreen\" type=\"hidden\" value=".$_GET["fullscreen"].">";
+ $h2=$h2."<input name=\"fullscreen\" type=\"hidden\" value=".$_GET["fullscreen"].">";
}
- echo "<select class=\"biginput\" name=\"screenid\" onChange=\"submit()\">";
- echo "<option value=\"0\" ".iif(!isset($_GET["screenid"]),"selected","").">".S_SELECT_SCREEN_DOT_DOT_DOT;
+ $h2=$h2."<select class=\"biginput\" name=\"screenid\" onChange=\"submit()\">";
+ $h2=$h2."<option value=\"0\" ".iif(!isset($_GET["screenid"]),"selected","").">".S_SELECT_SCREEN_DOT_DOT_DOT;
$result=DBselect("select screenid,name from screens order by name");
while($row=DBfetch($result))
@@ -79,12 +75,11 @@
{
continue;
}
- echo "<option value=\"".$row["screenid"]."\" ".iif(isset($_GET["screenid"])&&($_GET["screenid"]==$row["screenid"]),"selected","").">".$row["name"];
+ $h2=$h2."<option value=\"".$row["screenid"]."\" ".iif(isset($_GET["screenid"])&&($_GET["screenid"]==$row["screenid"]),"selected","").">".$row["name"];
}
- echo "</select>";
- echo "</form>";
- show_table_header_end();
-// End of new code
+ $h2=$h2."</select>";
+
+ show_header2($h1,$h2,"<form name=\"form2\" method=\"get\" action=\"screens.php\">","</form>");
?>
<?php
diff --git a/frontends/php/triggers.php b/frontends/php/triggers.php
index 965b7789..edfddc60 100644
--- a/frontends/php/triggers.php
+++ b/frontends/php/triggers.php
@@ -146,29 +146,24 @@
}
?>
-<?php
- show_table_header_begin();
- echo S_CONFIGURATION_OF_TRIGGERS_BIG;
- show_table_v_delimiter();
-
-// Start of new code
- echo "<form name=\"form2\" method=\"get\" action=\"triggers.php\">";
+<?php
+ $h1=S_CONFIGURATION_OF_TRIGGERS_BIG;;
if(isset($_GET["groupid"])&&($_GET["groupid"]==0))
{
unset($_GET["groupid"]);
}
- echo S_GROUP."&nbsp;";
- echo "<select class=\"biginput\" name=\"groupid\" onChange=\"submit()\">";
- echo "<option value=\"0\" ".iif(!isset($_GET["groupid"]),"selected","").">".S_ALL_SMALL;
+ $h2=S_GROUP."&nbsp;";
+ $h2=$h2."<select class=\"biginput\" name=\"groupid\" onChange=\"submit()\">";
+ $h2=$h2."<option value=\"0\" ".iif(!isset($_GET["groupid"]),"selected","").">".S_ALL_SMALL;
$result=DBselect("select groupid,name from groups order by name");
while($row=DBfetch($result))
{
// Check if at least one host with read permission exists for this group
- $result2=DBselect("select h.hostid,h.host from hosts h,items i,hosts_groups hg where h.status in (0,2) and h.hostid=i.hostid and hg.groupid=".$row["groupid"]." and hg.hostid=h.hostid group by h.hostid,h.host order by h.host");
+ $result2=DBselect("select h.hostid,h.host from hosts h,hosts_groups hg where hg.groupid=".$row["groupid"]." and hg.hostid=h.hostid group by h.hostid,h.host order by h.host");
$cnt=0;
while($row2=DBfetch($result2))
{
@@ -180,19 +175,23 @@
}
if($cnt!=0)
{
- echo "<option value=\"".$row["groupid"]."\" ".iif(isset($_GET["groupid"])&&($_GET["groupid"]==$row["groupid"]),"selected","").">".$row["name"];
+ $h2=$h2."<option value=\"".$row["groupid"]."\" ".iif(isset($_GET["groupid"])&&($_GET["groupid"]==$row["groupid"]),"selected","").">".$row["name"];
}
}
- echo "</select>";
+ $h2=$h2."</select>";
- echo "&nbsp;".S_HOST."&nbsp;";
- echo "<select class=\"biginput\" name=\"hostid\" onChange=\"submit()\">";
- echo "<option value=\"0\" ".iif(!isset($_GET["hostid"]),"selected","").">".S_SELECT_HOST_DOT_DOT_DOT;
+ $h2=$h2."&nbsp;".S_HOST."&nbsp;";
+ $h2=$h2."<select class=\"biginput\" name=\"hostid\" onChange=\"submit()\">";
+ $h2=$h2."<option value=\"0\" ".iif(!isset($_GET["hostid"]),"selected","").">".S_SELECT_HOST_DOT_DOT_DOT;
if(isset($_GET["groupid"]))
- $sql="select h.hostid,h.host from hosts h,items i,hosts_groups hg where h.status in (0,2) and h.hostid=i.hostid and hg.groupid=".$_GET["groupid"]." and hg.hostid=h.hostid group by h.hostid,h.host order by h.host";
+ {
+ $sql="select h.hostid,h.host from hosts h,hosts_groups hg where hg.groupid=".$_GET["groupid"]." and hg.hostid=h.hostid group by h.hostid,h.host order by h.host";
+ }
else
- $sql="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";
+ {
+ $sql="select h.hostid,h.host from hosts h group by h.hostid,h.host order by h.host";
+ }
$result=DBselect($sql);
while($row=DBfetch($result))
@@ -201,14 +200,11 @@
{
continue;
}
- echo "<option value=\"".$row["hostid"]."\"".iif(isset($_GET["hostid"])&&($_GET["hostid"]==$row["hostid"]),"selected","").">".$row["host"];
+ $h2=$h2."<option value=\"".$row["hostid"]."\"".iif(isset($_GET["hostid"])&&($_GET["hostid"]==$row["hostid"]),"selected","").">".$row["host"];
}
- echo "</select>";
-
- echo "</form>";
-// end of new code
+ $h2=$h2."</select>";
- show_table_header_end();
+ show_header2($h1, $h2, "<form name=\"form2\" method=\"get\" action=\"triggers.php\">", "</form>");
?>
<?php
@@ -231,8 +227,8 @@
{
echo "</TABLE><BR>";
}
- echo "<br>";
- show_table_header("<A HREF='triggers.php?hostid=".$row["hostid"]."'>".$row["host"]."</A>");
+# 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>";