diff options
| author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2003-06-20 10:33:47 +0000 |
|---|---|---|
| committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2003-06-20 10:33:47 +0000 |
| commit | f4959808757ef018273ffe82e6f9fa2267a39f4e (patch) | |
| tree | c1847a2a77321b831ed7cf4e00f35ea0a27154b5 /frontends/php/screens.php | |
| parent | 04ac525dbc6fad0300399c00e471a3fb04a109da (diff) | |
| download | zabbix-f4959808757ef018273ffe82e6f9fa2267a39f4e.tar.gz zabbix-f4959808757ef018273ffe82e6f9fa2267a39f4e.tar.xz zabbix-f4959808757ef018273ffe82e6f9fa2267a39f4e.zip | |
- added basic support for simple graphs in screens (Alexei)
- added table screens_graphs (Alexei)
git-svn-id: svn://svn.zabbix.com/trunk@835 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/screens.php')
| -rw-r--r-- | frontends/php/screens.php | 83 |
1 files changed, 50 insertions, 33 deletions
diff --git a/frontends/php/screens.php b/frontends/php/screens.php index 8e5a25f1..ea41fe7f 100644 --- a/frontends/php/screens.php +++ b/frontends/php/screens.php @@ -62,17 +62,17 @@ <?php if(isset($HTTP_GET_VARS["screenid"])) { - $screenid=$HTTP_GET_VARS["screenid"]; - $result=DBselect("select name,cols,rows from screens where screenid=$screenid"); - $row=DBfetch($result); - if(isset($HTTP_GET_VARS["fullscreen"])) - { - $map="<a href=\"screens.php?screenid=".$HTTP_GET_VARS["screenid"]."\">".$row["name"]."</a>"; - } - else - { - $map="<a href=\"screens.php?screenid=".$HTTP_GET_VARS["screenid"]."&fullscreen=1\">".$row["name"]."</a>"; - } + $screenid=$HTTP_GET_VARS["screenid"]; + $result=DBselect("select name,cols,rows from screens where screenid=$screenid"); + $row=DBfetch($result); + if(isset($HTTP_GET_VARS["fullscreen"])) + { + $map="<a href=\"screens.php?screenid=".$HTTP_GET_VARS["screenid"]."\">".$row["name"]."</a>"; + } + else + { + $map="<a href=\"screens.php?screenid=".$HTTP_GET_VARS["screenid"]."&fullscreen=1\">".$row["name"]."</a>"; + } show_table_header($map); echo "<TABLE BORDER=1 COLS=".$row["cols"]." align=center WIDTH=100% BGCOLOR=\"#FFFFFF\""; for($r=0;$r<$row["rows"];$r++) @@ -84,29 +84,46 @@ echo "<a name=\"form\"></a>"; echo "<form method=\"get\" action=\"screenedit.php\">"; - $iresult=DBSelect("select * from screens_items where screenid=$screenid and x=$c and y=$r"); - if($iresult) - { - $irow=DBfetch($iresult); - $screenitemid=$irow["screenitemid"]; - $graphid=$irow["graphid"]; - $width=$irow["width"]; - $height=$irow["height"]; - } - else - { - $screenitemid=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&noborder=1' border=0></a>"; - } - echo "</form>\n"; - echo "</TD>"; + { + $screenitemid=0; + $graphid=0; + $itemid=0; + $width=100; + $height=50; + } + + $sql="select * from screens_items where screenid=$screenid and x=$c and y=$r"; + $iresult=DBSelect($sql); + if(DBnum_rows($iresult)>0) + { + $irow=DBfetch($iresult); + $screenitemid=$irow["screenitemid"]; + $graphid=$irow["graphid"]; + $width=$irow["width"]; + $height=$irow["height"]; + } + $sql="select * from screens_graphs where screenid=$screenid and x=$c and y=$r"; + $iresult=DBSelect($sql); + if(DBnum_rows($iresult)>0) + { + $irow=DBfetch($iresult); + $screengraphid=$irow["screengraphid"]; + $itemid=$irow["itemid"]; + $width=$irow["width"]; + $height=$irow["height"]; + } + + if($graphid!=0) + { + echo "<a href=charts.php?graphid=$graphid><img src='chart2.php?graphid=$graphid&width=$width&height=$height&period=3600&noborder=1' border=0></a>"; + } + if($itemid!=0) + { + echo "<a href=history.php?action=showhistory&itemid=$itemid><img src='chart.php?itemid=$itemid&width=$width&height=$height&period=3600&noborder=1' border=0></a>"; + } + echo "</form>\n"; + echo "</TD>"; } echo "</TR>\n"; } |
