diff options
author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2005-11-25 10:27:05 +0000 |
---|---|---|
committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2005-11-25 10:27:05 +0000 |
commit | 8aee7a4bf11b6a36d74892f56d8937219cba0be0 (patch) | |
tree | 8cb0ef378685a801cc14e2228ca4bf7fe46238ff /frontends/php/screenedit.php | |
parent | 4eeeb02ee16f99f6b2d692f7e863ebfca66c1c63 (diff) | |
download | zabbix-8aee7a4bf11b6a36d74892f56d8937219cba0be0.tar.gz zabbix-8aee7a4bf11b6a36d74892f56d8937219cba0be0.tar.xz zabbix-8aee7a4bf11b6a36d74892f56d8937219cba0be0.zip |
Cleanup of PHP code.
git-svn-id: svn://svn.zabbix.com/trunk@2357 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/screenedit.php')
-rw-r--r-- | frontends/php/screenedit.php | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/frontends/php/screenedit.php b/frontends/php/screenedit.php index 71efdcb6..23a3da5c 100644 --- a/frontends/php/screenedit.php +++ b/frontends/php/screenedit.php @@ -171,11 +171,11 @@ $result=DBselect("select h.host,i.description,i.itemid,i.key_ from hosts h,items i where h.hostid=i.hostid and h.status=".HOST_STATUS_MONITORED." and i.status=0 order by h.host,i.description"); echo "<select name=\"resourceid\" size=1>"; echo "<OPTION VALUE='0'>(none)"; - for($i=0;$i<DBnum_rows($result);$i++) + while($row=DBfetch($result)) { - $host_=DBget_field($result,$i,0); - $description_=item_description(DBget_field($result,$i,1),DBget_field($result,$i,3)); - $itemid_=DBget_field($result,$i,2); + $host_=$row["host"]; + $description_=item_description($row["description"],$row["key_"]); + $itemid_=$row["itemid"]; echo "<OPTION VALUE='$itemid_' ".iif($resourceid==$itemid_,"selected","").">$host_: $description_"; } echo "</SELECT>"; @@ -189,11 +189,11 @@ $result=DBselect("select h.host,i.description,i.itemid,i.key_ from hosts h,items i where h.hostid=i.hostid and h.status=".HOST_STATUS_MONITORED." and i.status=0 order by h.host,i.description"); echo "<select name=\"resourceid\" size=1>"; echo "<OPTION VALUE='0'>(none)"; - for($i=0;$i<DBnum_rows($result);$i++) + while($row=DBfetch($result)) { - $host_=DBget_field($result,$i,0); - $description_=item_description(DBget_field($result,$i,1),DBget_field($result,$i,3)); - $itemid_=DBget_field($result,$i,2); + $host_=$row["host"]; + $description_=item_description($row["description"],$row["key_"]); + $itemid_=$row["itemid"]; echo "<OPTION VALUE='$itemid_' ".iif($resourceid==$itemid_,"selected","").">$host_: $description_"; } echo "</SELECT>"; @@ -207,10 +207,10 @@ $result=DBselect("select graphid,name from graphs order by name"); echo "<select name=\"resourceid\" size=1>"; echo "<OPTION VALUE='0'>(none)"; - for($i=0;$i<DBnum_rows($result);$i++) + while($row=DBfetch($result)) { - $name_=DBget_field($result,$i,1); - $graphid_=DBget_field($result,$i,0); + $name_=$row["name"]; + $graphid_=$row["graphid"]; echo "<OPTION VALUE='$graphid_' ".iif($resourceid==$graphid_,"selected","").">$name_"; } echo "</SELECT>"; @@ -224,10 +224,10 @@ $result=DBselect("select sysmapid,name from sysmaps order by name"); echo "<select name=\"resourceid\" size=1>"; echo "<OPTION VALUE='0'>(none)"; - for($i=0;$i<DBnum_rows($result);$i++) + while($row=DBfetch($result)) { - $name_=DBget_field($result,$i,1); - $sysmapid_=DBget_field($result,$i,0); + $name_=$row["name"]; + $sysmapid_=$row["sysmapid"]; echo "<OPTION VALUE='$sysmapid_' ".iif($resourceid==$sysmapid_,"selected","").">$name_"; } echo "</SELECT>"; |