diff options
| author | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-04-10 09:34:21 +0000 |
|---|---|---|
| committer | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-04-10 09:34:21 +0000 |
| commit | fcc91decd3db84a94505ac2147be987867dcfb41 (patch) | |
| tree | ec0ba6b36bf92051aca7b5fbcc4e2d4e9a792c9b /frontends/php/exp_imp.php | |
| parent | d53a7572a565383d4680361388063acb0a864aaa (diff) | |
| download | zabbix-fcc91decd3db84a94505ac2147be987867dcfb41.tar.gz zabbix-fcc91decd3db84a94505ac2147be987867dcfb41.tar.xz zabbix-fcc91decd3db84a94505ac2147be987867dcfb41.zip | |
- merged rev. 5602:5604 of branches/1.4 (Artem) [fixed empty cells for IE]
- fixes permissions SQL for different DBs (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@5605 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/exp_imp.php')
| -rw-r--r-- | frontends/php/exp_imp.php | 42 |
1 files changed, 19 insertions, 23 deletions
diff --git a/frontends/php/exp_imp.php b/frontends/php/exp_imp.php index dd766d58..b0f05aae 100644 --- a/frontends/php/exp_imp.php +++ b/frontends/php/exp_imp.php @@ -262,8 +262,7 @@ include_once "include/page_header.php"; $table->ShowEnd(); } - else - { + else{ /* table HOSTS */ $form = new CForm(null,'post'); $form->SetName('hosts'); @@ -272,17 +271,18 @@ 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". - " 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 '. + ' order by g.name'); + while($row=DBfetch($result)){ $cmbGroups->AddItem($row["groupid"],$row["name"]); if((bccomp($row["groupid"] , $_REQUEST["groupid"])==0)) $correct_host = 1; } - if(!isset($correct_host)) - { + + if(!isset($correct_host)){ unset($_REQUEST["groupid"]); $cmbGroups->SetValue(0); } @@ -329,8 +329,8 @@ include_once "include/page_header.php"; $result=DBselect($sql); - while($row=DBfetch($result)) - { + while($row=DBfetch($result)){ + $host=new CCol(array( new CCheckBox('hosts['.$row['hostid'].']', isset($hosts[$row['hostid']]) || !isset($update), @@ -358,15 +358,13 @@ include_once "include/page_header.php"; /* calculate items */ $item_cnt = DBfetch(DBselect('select count(itemid) as cnt from items where hostid='.$row['hostid'])); - if($item_cnt['cnt'] > 0) - { + if($item_cnt['cnt'] > 0){ $item_cnt = array(new CCheckBox('items['.$row['hostid'].']', isset($items[$row['hostid']]) || !isset($update), NULL,true), $item_cnt['cnt']); } - else - { + else{ $item_cnt = '-'; } @@ -407,21 +405,19 @@ include_once "include/page_header.php"; /* $screens = 0; */ - if($row["status"] == HOST_STATUS_TEMPLATE) - { + if($row["status"] == HOST_STATUS_TEMPLATE){ $ip = $dns = $port = '-'; } - else - { - $ip = $row["ip"]; - $dns = $row["dns"]; + else{ + $ip = (empty($row["ip"]))?'-':$row["ip"]; + $dns = (empty($row["dns"]))?'-':$row["dns"]; if($row["useip"]==1) $ip = bold($ip); else $dns = bold($dns); - $port = $row["port"]; + $port = (empty($row["port"]))?'-':$row["port"]; } $table->AddRow(array( |
