diff options
| author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2003-03-23 09:21:41 +0000 |
|---|---|---|
| committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2003-03-23 09:21:41 +0000 |
| commit | daa5481f0be02ef2aafba98cb9b8cd80a3ec5387 (patch) | |
| tree | 449477321d479805a2da303d49018febe27a0277 /frontends/php/screens.php | |
| parent | c5fe18e5fcf909aee06437c7a89a2adcc2a25bd0 (diff) | |
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/screens.php')
| -rw-r--r-- | frontends/php/screens.php | 114 |
1 files changed, 114 insertions, 0 deletions
diff --git a/frontends/php/screens.php b/frontends/php/screens.php new file mode 100644 index 00000000..9628f5d0 --- /dev/null +++ b/frontends/php/screens.php @@ -0,0 +1,114 @@ +<?php + include "include/config.inc.php"; + $page["title"] = "User defined screens"; + $page["file"] = "screens.php"; + + $nomenu=0; + if(isset($HTTP_GET_VARS["fullscreen"])) + { + $nomenu=1; + } + if(isset($HTTP_GET_VARS["scid"])) + { + show_header($page["title"],60,$nomenu); + } + else + { + show_header($page["title"],0,$nomenu); + } +?> + +<?php + if(!isset($HTTP_GET_VARS["fullscreen"])) + { + show_table_header_begin(); + echo "SCREENS"; + + show_table_v_delimiter(); + + echo "<font size=2>"; + + $result=DBselect("select scid,name,cols,rows from screens order by name"); + while($row=DBfetch($result)) + { + if(!check_right("Screen","R",$row["scid"])) + { + continue; + } + if( isset($HTTP_GET_VARS["scid"]) && ($HTTP_GET_VARS["scid"] == $row["scid"]) ) + { + echo "<b>["; + } + echo "<a href='screens.php?scid=".$row["scid"]."'>".$row["name"]."</a>"; + if(isset($HTTP_GET_VARS["scid"]) && ($HTTP_GET_VARS["scid"] == $row["scid"]) ) + { + echo "]</b>"; + } + echo " "; + } + + if(DBnum_rows($result) == 0) + { + echo "No screens to display"; + } + + echo "</font>"; + show_table_header_end(); + echo "<br>"; + } + +?> + +<?php + if(isset($HTTP_GET_VARS["scid"])) + { + $scid=$HTTP_GET_VARS["scid"]; + $result=DBselect("select name,cols,rows from screens where scid=$scid"); + $row=DBfetch($result); + echo "<TABLE BORDER=1 COLS=".$row["cols"]." align=center WIDTH=100% BGCOLOR=\"#FFFFFF\""; + for($r=0;$r<$row["rows"];$r++) + { + echo "<TR>"; + for($c=0;$c<$row["cols"];$c++) + { + echo "<TD align=\"center\">\n"; + + echo "<a name=\"form\"></a>"; + echo "<form method=\"get\" action=\"screenedit.php\">"; + $iresult=DBSelect("select * from screens_items where scid=$scid and x=$c and y=$r"); + if($iresult) + { + $irow=DBfetch($iresult); + $scitemid=$irow["scitemid"]; + $graphid=$irow["graphid"]; + $width=$irow["width"]; + $height=$irow["height"]; + } + else + { + $scitemid=0; + $graphid=0; + $width=100; + $height=50; + } + + if($graphid!=0) + { + echo "<a href=charts.php?graphid=$graphid><img src='chart2.php?graphid=$graphid&width=$width&height=$height&period=3600' border=0></a>"; + } + echo "</form>\n"; + echo "</TD>"; + } + echo "</TR>\n"; + } + echo "</TABLE>"; + } + else + { + show_table_header("Please select screen to display"); + } +?> + +<?php + show_footer(); +?> |
