diff options
| author | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-12-07 13:31:08 +0000 |
|---|---|---|
| committer | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-12-07 13:31:08 +0000 |
| commit | 28dbc3a637659c5ddf6f765d211bdf306ff16694 (patch) | |
| tree | 7637492e5ae51067cf3fec432a93fa4478994b79 /frontends/php/include/reports.inc.php | |
| parent | c3fe2c6239d8e04709e97ac288fb97b24b563fcd (diff) | |
| download | zabbix-28dbc3a637659c5ddf6f765d211bdf306ff16694.tar.gz zabbix-28dbc3a637659c5ddf6f765d211bdf306ff16694.tar.xz zabbix-28dbc3a637659c5ddf6f765d211bdf306ff16694.zip | |
- [DEV-59] sql improvement (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@5146 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/reports.inc.php')
| -rw-r--r-- | frontends/php/include/reports.inc.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/frontends/php/include/reports.inc.php b/frontends/php/include/reports.inc.php index 8c5872d2..418cf451 100644 --- a/frontends/php/include/reports.inc.php +++ b/frontends/php/include/reports.inc.php @@ -34,12 +34,12 @@ function show_report2_header($config,$available_hosts){ $cmbGroup = new CComboBox('groupid',$_REQUEST['groupid'],'submit()'); $cmbGroup->AddItem(0,S_ALL_SMALL); - $status_filter = ' AND h.status='.HOST_STATUS_MONITORED.' AND i.status='.ITEM_STATUS_ACTIVE; + $status_filter = ' AND h.status='.HOST_STATUS_MONITORED; if($config==1) $status_filter = ' AND h.status='.HOST_STATUS_TEMPLATE; $sql = 'SELECT DISTINCT g.groupid,g.name '. - ' FROM groups g,hosts_groups hg,hosts h, items i'. + ' 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. @@ -84,6 +84,7 @@ function show_report2_header($config,$available_hosts){ $sql_cond. ' GROUP BY h.hostid,h.host '. ' ORDER BY h.host'; + if(0 == $config){ $cmbHosts->AddItem(0,S_ALL_SMALL); } @@ -135,6 +136,7 @@ function show_report2_header($config,$available_hosts){ ' AND i.status='.ITEM_STATUS_ACTIVE. ' ORDER BY t.description'; } + $result=DBselect($sql); while($row=DBfetch($result)){ |
