summaryrefslogtreecommitdiffstats
path: root/frontends/php/include/graphs.inc.php
diff options
context:
space:
mode:
authoralex <alex@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2006-09-14 11:06:27 +0000
committeralex <alex@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2006-09-14 11:06:27 +0000
commit8755f9643aba3cffc5320321618fbe8e7b78b73b (patch)
tree61f79790fee2222b1d3c5c3cd3faf09c9de8f168 /frontends/php/include/graphs.inc.php
parent220a18752f8fefdd0af90ccd17cc045c2e6ae1a6 (diff)
downloadzabbix-8755f9643aba3cffc5320321618fbe8e7b78b73b.tar.gz
zabbix-8755f9643aba3cffc5320321618fbe8e7b78b73b.tar.xz
zabbix-8755f9643aba3cffc5320321618fbe8e7b78b73b.zip
Initial integration of distributed monitoring.
Changes 3196:HEAD of branches/distributed git-svn-id: svn://svn.zabbix.com/trunk@3306 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/graphs.inc.php')
-rw-r--r--frontends/php/include/graphs.inc.php16
1 files changed, 8 insertions, 8 deletions
diff --git a/frontends/php/include/graphs.inc.php b/frontends/php/include/graphs.inc.php
index df0ed17e..32803367 100644
--- a/frontends/php/include/graphs.inc.php
+++ b/frontends/php/include/graphs.inc.php
@@ -105,12 +105,13 @@
return 0;
}
+ $graphid=get_dbid("graphs","graphid");
+
$result=DBexecute("insert into graphs".
- " (name,width,height,yaxistype,yaxismin,yaxismax,templateid,show_work_period,show_triggers,graphtype,templateid)".
- " values (".zbx_dbstr($name).",$width,$height,$yaxistype,$yaxismin,".
+ " (graphid,name,width,height,yaxistype,yaxismin,yaxismax,templateid,show_work_period,show_triggers,graphtype,templateid)".
+ " values ($graphid,".zbx_dbstr($name).",$width,$height,$yaxistype,$yaxismin,".
" $yaxismax,$templateid,$showworkperiod,$showtriggers,$graphtype,$templateid)");
- $graphid = DBinsert_id($result,"graphs","graphid");
- if($graphid)
+ if($result)
{
info("Graph '$name' added");
}
@@ -208,11 +209,10 @@
function add_item_to_graph($graphid,$itemid,$color,$drawtype,$sortorder,$yaxisside,$calc_fnc,$type,$periods_cnt)
{
+ $gitemid=get_dbid("graphs_items","gitemid");
$result = DBexecute("insert into graphs_items".
- " (graphid,itemid,color,drawtype,sortorder,yaxisside,calc_fnc,type,periods_cnt)".
- " values ($graphid,$itemid,".zbx_dbstr($color).",$drawtype,$sortorder,$yaxisside,$calc_fnc,$type,$periods_cnt)");
-
- $gitemid = DBinsert_id($result,"graphs_items","gitemid");
+ " (gitemid,graphid,itemid,color,drawtype,sortorder,yaxisside,calc_fnc,type,periods_cnt)".
+ " values ($gitemid,$graphid,$itemid,".zbx_dbstr($color).",$drawtype,$sortorder,$yaxisside,$calc_fnc,$type,$periods_cnt)");
$item = get_item_by_itemid($itemid);
$graph = get_graph_by_graphid($graphid);