summaryrefslogtreecommitdiffstats
path: root/frontends/php/hosts.php
diff options
context:
space:
mode:
authorhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2005-11-25 10:27:05 +0000
committerhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2005-11-25 10:27:05 +0000
commit8aee7a4bf11b6a36d74892f56d8937219cba0be0 (patch)
tree8cb0ef378685a801cc14e2228ca4bf7fe46238ff /frontends/php/hosts.php
parent4eeeb02ee16f99f6b2d692f7e863ebfca66c1c63 (diff)
Cleanup of PHP code.
git-svn-id: svn://svn.zabbix.com/trunk@2357 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/hosts.php')
-rw-r--r--frontends/php/hosts.php16
1 files changed, 8 insertions, 8 deletions
diff --git a/frontends/php/hosts.php b/frontends/php/hosts.php
index 732c90c8..f5236137 100644
--- a/frontends/php/hosts.php
+++ b/frontends/php/hosts.php
@@ -387,10 +387,10 @@
// $members=array("hide"=>1,"value"=>"");
$members=array("hide"=>0,"value"=>"");
$result1=DBselect("select distinct h.host from hosts h, hosts_groups hg where h.hostid=hg.hostid and hg.groupid=".$row["groupid"]." and h.status not in (".HOST_STATUS_DELETED.") order by host");
- for($i=0;$i<DBnum_rows($result1);$i++)
+ while($row1=DBfetch($result1))
{
$members["hide"]=0;
- $members["value"]=$members["value"].DBget_field($result1,$i,0);
+ $members["value"]=$members["value"].$row1["host"];
if($i<DBnum_rows($result1)-1)
{
$members["value"]=$members["value"].", ";
@@ -660,12 +660,12 @@
if(isset($_REQUEST["register"]) && ($_REQUEST["register"] == "change"))
{
- $result=DBselect("select host,port,status,useip,ip from hosts where hostid=".$_REQUEST["hostid"]);
- $host=DBget_field($result,0,0);
- $port=DBget_field($result,0,1);
- $status=DBget_field($result,0,2);
- $useip=DBget_field($result,0,3);
- $ip=DBget_field($result,0,4);
+ $result=get_host_by_hostid($_REQUEST["hostid"]);
+ $host=$result["host"];
+ $port=$result["port"];
+ $status=$result["status"];
+ $useip=$result["useip"];
+ $ip=$result["ip"];
if($useip==0)
{