From 8ae5e14d692d4f36b0e557829321cbed92157a3a Mon Sep 17 00:00:00 2001 From: artem Date: Wed, 6 Feb 2008 08:53:19 +0000 Subject: - minor improvement in ORACLE functions (Artem) git-svn-id: svn://svn.zabbix.com/trunk@5324 97f52cf1-0a1b-0410-bd0e-c28be96e8082 --- frontends/php/hosts.php | 14 ++++++++------ frontends/php/include/classes/ctable.inc.php | 1 - frontends/php/include/db.inc.php | 10 +++++----- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/frontends/php/hosts.php b/frontends/php/hosts.php index 562e4477..a8b4889e 100644 --- a/frontends/php/hosts.php +++ b/frontends/php/hosts.php @@ -713,12 +713,14 @@ include_once "include/page_header.php"; $cmbGroups = new CComboBox("groupid",get_request("groupid",0),"submit()"); $cmbGroups->AddItem(0,S_ALL_SMALL); - $result=DBselect("select distinct g.groupid,g.name from groups g,hosts_groups hg,hosts h". - " where h.hostid in (".$available_hosts.") ". - " and g.groupid=hg.groupid and h.hostid=hg.hostid".$status_filter. - " order by g.name"); - while($row=DBfetch($result)) - { + $result=DBselect('SELECT DISTINCT g.groupid,g.name '. + ' FROM groups g,hosts_groups hg,hosts h '. + ' WHERE h.hostid in ('.$available_hosts.') '. + ' AND g.groupid=hg.groupid '. + ' AND h.hostid=hg.hostid'. + $status_filter. + ' ORDER BY g.name'); + while($row=DBfetch($result)){ $cmbGroups->AddItem($row["groupid"],$row["name"]); if((bccomp($row["groupid"], $_REQUEST["groupid"]) == 0)) $correct_host = 1; } diff --git a/frontends/php/include/classes/ctable.inc.php b/frontends/php/include/classes/ctable.inc.php index 4de17a2f..39013bdb 100644 --- a/frontends/php/include/classes/ctable.inc.php +++ b/frontends/php/include/classes/ctable.inc.php @@ -152,7 +152,6 @@ $this->evenRowClass); }/**/ return $item; -// return $item->ToString(); } function SetHeader($value=NULL,$class=NULL){ diff --git a/frontends/php/include/db.inc.php b/frontends/php/include/db.inc.php index e60bc250..a0bbaf4d 100644 --- a/frontends/php/include/db.inc.php +++ b/frontends/php/include/db.inc.php @@ -414,12 +414,12 @@ $result = pg_fetch_assoc($cursor); break; case "ORACLE": - if(ocifetchinto($cursor, $row, OCI_ASSOC+OCI_NUM+OCI_RETURN_NULLS)) - { + if(ocifetchinto($cursor, $row, (OCI_ASSOC+OCI_RETURN_NULLS))){ $result = array(); - $keys = (array_keys($row)); - foreach($keys as $k) $result[strtolower($k)] = $row[$k]; - } + foreach($row as $key => $value){ + $result[strtolower($key)] = $value; + } + } break; case "SQLITE3": if($cursor) -- cgit