summaryrefslogtreecommitdiffstats
path: root/frontends/php/include/graphs.inc.php
diff options
context:
space:
mode:
authorartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-08-19 11:35:09 +0000
committerartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-08-19 11:35:09 +0000
commit84a4272b58e6bcc5be3366adc5771851c522eae3 (patch)
treee088fd336667817dda9b8b89ddb3ea0ee6a327b8 /frontends/php/include/graphs.inc.php
parentc18881cf3bf1288bff75ecb10df386ec25a0cab9 (diff)
- [DEV-137] improvements in sqls (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@5926 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/graphs.inc.php')
-rw-r--r--frontends/php/include/graphs.inc.php18
1 files changed, 8 insertions, 10 deletions
diff --git a/frontends/php/include/graphs.inc.php b/frontends/php/include/graphs.inc.php
index b597b987..ae2c0e1d 100644
--- a/frontends/php/include/graphs.inc.php
+++ b/frontends/php/include/graphs.inc.php
@@ -382,17 +382,15 @@
* Only PHP:
* $error= true : rise Error if item doesn't exists(error generated), false: special processing (NO error generated)
*/
- function get_same_graphitems_for_host($gitems, $dest_hostid, $error=true)
- {
+ function get_same_graphitems_for_host($gitems, $dest_hostid, $error=true){
$result = array();
- foreach($gitems as $gitem)
- {
+ foreach($gitems as $gitem){
$sql = 'SELECT src.itemid '.
- ' FROM items src, items dest '.
- ' WHERE dest.itemid='.zbx_dbstr($gitem['itemid']).
- ' AND src.key_=dest.key_ '.
- ' AND src.hostid='.$dest_hostid;
+ ' FROM items src, items dest '.
+ ' WHERE dest.itemid='.$gitem['itemid'].
+ ' AND src.key_=dest.key_ '.
+ ' AND src.hostid='.$dest_hostid;
$db_item = DBfetch(DBselect($sql));
if (!$db_item && $error){
$item = get_item_by_itemid($gitem['itemid']);
@@ -430,8 +428,8 @@
{
$graphid = get_dbid("graphs","graphid");
- $result=DBexecute("insert into graphs".
- " (graphid,name,width,height,yaxistype,yaxismin,yaxismax,templateid,show_work_period,show_triggers,graphtype,show_legend,show_3d)".
+ $result=DBexecute('INSERT INTO graphs '.
+ ' (graphid,name,width,height,yaxistype,yaxismin,yaxismax,templateid,show_work_period,show_triggers,graphtype,show_legend,show_3d) '.
" values ($graphid,".zbx_dbstr($name).",$width,$height,$yaxistype,$yaxismin,".
" $yaxismax,$templateid,$showworkperiod,$showtriggers,$graphtype,$legend,$graph3d)");