summaryrefslogtreecommitdiffstats
path: root/frontends/php/screenconf.php
diff options
context:
space:
mode:
authorhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2003-03-23 09:21:41 +0000
committerhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2003-03-23 09:21:41 +0000
commitdaa5481f0be02ef2aafba98cb9b8cd80a3ec5387 (patch)
tree449477321d479805a2da303d49018febe27a0277 /frontends/php/screenconf.php
parentc5fe18e5fcf909aee06437c7a89a2adcc2a25bd0 (diff)
downloadzabbix-daa5481f0be02ef2aafba98cb9b8cd80a3ec5387.tar.gz
zabbix-daa5481f0be02ef2aafba98cb9b8cd80a3ec5387.tar.xz
zabbix-daa5481f0be02ef2aafba98cb9b8cd80a3ec5387.zip
Support for screen builder. Thanks to Arturs Aboltins. (Alexei)
git-svn-id: svn://svn.zabbix.com/trunk@714 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/screenconf.php')
-rw-r--r--frontends/php/screenconf.php130
1 files changed, 130 insertions, 0 deletions
diff --git a/frontends/php/screenconf.php b/frontends/php/screenconf.php
new file mode 100644
index 00000000..0817181e
--- /dev/null
+++ b/frontends/php/screenconf.php
@@ -0,0 +1,130 @@
+<?php
+ include "include/config.inc.php";
+ $page["title"] = "Screens";
+ $page["file"] = "screenconf.php";
+ show_header($page["title"],0,0);
+?>
+
+<?php
+ show_table_header("CONFIGURATION OF SCREENS");
+ echo "<br>";
+?>
+
+<?php
+ if(!check_right("Screen","U",0))
+ {
+// show_table_header("<font color=\"AA0000\">No permissions !</font>");
+// show_footer();
+// exit;
+ }
+?>
+
+<?php
+ if(isset($HTTP_GET_VARS["register"]))
+ {
+ if($HTTP_GET_VARS["register"]=="add")
+ {
+ $result=add_screen($HTTP_GET_VARS["name"],$HTTP_GET_VARS["cols"],$HTTP_GET_VARS["rows"]);
+ show_messages($result,"Screen added","Cannot add screen");
+ }
+ if($HTTP_GET_VARS["register"]=="update")
+ {
+ $result=update_screen($HTTP_GET_VARS["scid"],$HTTP_GET_VARS["name"],$HTTP_GET_VARS["cols"],$HTTP_GET_VARS["rows"]);
+ show_messages($result,"Screen updated","Cannot update screen");
+ }
+ if($HTTP_GET_VARS["register"]=="delete")
+ {
+ $result=delete_screen($HTTP_GET_VARS["scid"]);
+ show_messages($result,"Screen deleted","Cannot delete screen");
+ unset($HTTP_GET_VARS["scid"]);
+ }
+ }
+?>
+
+<?php
+ show_table_header("SCREENS");
+ echo "<TABLE BORDER=0 COLS=4 WIDTH=100% BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>";
+ echo "<TD WIDTH=5% NOSAVE><B>Id</B></TD>";
+ echo "<TD WIDTH=10% NOSAVE><B>Name</B></TD>";
+ echo "<TD WIDTH=10% NOSAVE><B>Columns</B></TD>";
+ echo "<TD WIDTH=10% NOSAVE><B>Rows</B></TD>";
+ echo "<TD WIDTH=10% NOSAVE><B>Actions</B></TD>";
+ echo "</TR>";
+
+ $result=DBselect("select scid,name,cols,rows from screens order by name");
+ $col=0;
+ while($row=DBfetch($result))
+ {
+ if(!check_right("Screen","R",$row["scid"]))
+ {
+ continue;
+ }
+ if($col++%2==0) { echo "<TR BGCOLOR=#EEEEEE>"; }
+ else { echo "<TR BGCOLOR=#DDDDDD>"; }
+
+ echo "<TD>".$row["scid"]."</TD>";
+ echo "<TD><a href=\"screenedit.php?scid=".$row["scid"]."\">".$row["name"]."</a></TD>";
+ echo "<TD>".$row["cols"]."</TD>";
+ echo "<TD>".$row["rows"]."</TD>";
+ echo "<TD><A HREF=\"screenconf.php?scid=".$row["scid"]."#form\">Change</A> - ";
+ echo "<A HREF=\"screenconf.php?register=delete&scid=".$row["scid"]."\">Delete</A></TD>";
+ echo "</TR>";
+ }
+ echo "</TABLE>";
+?>
+
+<?php
+ echo "<a name=\"form\"></a>";
+
+ if(isset($HTTP_GET_VARS["scid"]))
+ {
+ $result=DBselect("select scid,name,cols,rows from screens g where scid=".$HTTP_GET_VARS["scid"]);
+ $row=DBfetch($result);
+ $name=$row["name"];
+ $cols=$row["cols"];
+ $rows=$row["rows"];
+ }
+ else
+ {
+ $name="";
+ $cols=1;
+ $rows=1;
+ }
+
+ echo "<br>";
+ show_table2_header_begin();
+ echo "New screen";
+
+ show_table2_v_delimiter();
+ echo "<form method=\"get\" action=\"screenconf.php\">";
+ if(isset($HTTP_GET_VARS["scid"]))
+ {
+ echo "<input class=\"biginput\" name=\"scid\" type=\"hidden\" value=".$HTTP_GET_VARS["scid"].">";
+ }
+ echo "Name";
+ show_table2_h_delimiter();
+ echo "<input class=\"biginput\" name=\"name\" value=\"$name\" size=32>";
+
+ show_table2_v_delimiter();
+ echo "Columns";
+ show_table2_h_delimiter();
+ echo "<input class=\"biginput\" name=\"cols\" size=5 value=\"$cols\">";
+
+ show_table2_v_delimiter();
+ echo "Rows";
+ show_table2_h_delimiter();
+ echo "<input class=\"biginput\" name=\"rows\" size=5 value=\"$rows\">";
+
+ show_table2_v_delimiter2();
+ echo "<input type=\"submit\" name=\"register\" value=\"add\">";
+ if(isset($HTTP_GET_VARS["scid"]))
+ {
+ echo "<input type=\"submit\" name=\"register\" value=\"update\">";
+ }
+
+ show_table2_header_end();
+?>
+
+<?php
+ show_footer();
+?>