diff options
author | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-02-06 08:53:19 +0000 |
---|---|---|
committer | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-02-06 08:53:19 +0000 |
commit | 8ae5e14d692d4f36b0e557829321cbed92157a3a (patch) | |
tree | e424c1f283edace6ecee2671cba37eac490e853c | |
parent | 60f1add7b5e0e72e18bb983a80432a956d77ddbf (diff) | |
download | zabbix-8ae5e14d692d4f36b0e557829321cbed92157a3a.tar.gz zabbix-8ae5e14d692d4f36b0e557829321cbed92157a3a.tar.xz zabbix-8ae5e14d692d4f36b0e557829321cbed92157a3a.zip |
- minor improvement in ORACLE functions (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@5324 97f52cf1-0a1b-0410-bd0e-c28be96e8082
-rw-r--r-- | frontends/php/hosts.php | 14 | ||||
-rw-r--r-- | frontends/php/include/classes/ctable.inc.php | 1 | ||||
-rw-r--r-- | 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) |