summaryrefslogtreecommitdiffstats
path: root/frontends
diff options
context:
space:
mode:
authorhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2001-12-31 13:47:57 +0000
committerhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2001-12-31 13:47:57 +0000
commit917670d0342a6e939e295636cda76beae6931d0d (patch)
tree415163e489f325bbf0db38a8e5da72a937192975 /frontends
parenta680e05e150133e5c42f9ae1d548ae375847c477 (diff)
downloadzabbix-917670d0342a6e939e295636cda76beae6931d0d.tar.gz
zabbix-917670d0342a6e939e295636cda76beae6931d0d.tar.xz
zabbix-917670d0342a6e939e295636cda76beae6931d0d.zip
- added column "soft" to services_links (Alexei)
- added function DBfetch to frontends/php/include/db.inc (Alexei) - srv_status.html accessible without password (Alexei) git-svn-id: svn://svn.zabbix.com/trunk@272 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends')
-rw-r--r--frontends/php/actions.html14
-rw-r--r--frontends/php/alarms.html27
-rw-r--r--frontends/php/alerts.html30
-rw-r--r--frontends/php/chart2.html2
-rw-r--r--frontends/php/charts.html18
-rw-r--r--frontends/php/graph.html31
-rw-r--r--frontends/php/graphs.html34
-rw-r--r--frontends/php/hosts.html34
-rw-r--r--frontends/php/include/config.inc1
-rw-r--r--frontends/php/include/db.inc16
-rw-r--r--frontends/php/items.html11
-rw-r--r--frontends/php/latest.html10
-rw-r--r--frontends/php/latestalarms.html25
-rw-r--r--frontends/php/queue.html27
-rw-r--r--frontends/php/services.html13
-rw-r--r--frontends/php/tr_status.html10
16 files changed, 123 insertions, 180 deletions
diff --git a/frontends/php/actions.html b/frontends/php/actions.html
index 5f42b1b7..4b8011a9 100644
--- a/frontends/php/actions.html
+++ b/frontends/php/actions.html
@@ -53,7 +53,7 @@
echo "<TD><b>Actions</b></TD>";
echo "</TR>";
$col=0;
- for($i=0;$i<DBnum_rows($result);$i++)
+ while($row=DBfetch($result))
{
$actid=DBget_field($result,$i,0);
$good="OFF";
@@ -132,14 +132,12 @@
$sql="select i.description, h.host, i.key_ from hosts h, items i,functions f where f.triggerid=$triggerid and h.hostid=i.hostid and f.itemid=i.itemid order by i.description";
$result=DBselect($sql);
$message="<INSERT YOUR MESSAGE HERE>\n\n------Latest data------\n\n";
- for($i=0;$i<DBnum_rows($result);$i++)
+ while($row=DBfetch($result))
+// for($i=0;$i<DBnum_rows($result);$i++)
{
- $description=DBget_field($result,$i,0);
- $host=DBget_field($result,$i,1);
- $key=DBget_field($result,$i,2);
- $message=$message."$description: \{$host:$key.last(0)} (latest value)\n";
- $message=$message."$description: \{$host:$key.max(300)} (maximum value for last 5 min)\n";
- $message=$message."$description: \{$host:$key.min(300)} (minimum value for last 5 min)\n\n";
+ $message=$message.$row["description"].": \{".$row["host"].":".$row["key_"].".last(0)} (latest value)\n";
+ $message=$message.$row["description"].": \{".$row["host"].":".$row["key_"].".max(300)} (maximum value for last 5 min)\n";
+ $message=$message.$row["description"].": \{".$row["host"].":".$row["key_"].".min(300)} (minimum value for last 5 min)\n\n";
}
$message=$message."---------End--------\n";
}
diff --git a/frontends/php/alarms.html b/frontends/php/alarms.html
index 97686f25..f5a65901 100644
--- a/frontends/php/alarms.html
+++ b/frontends/php/alarms.html
@@ -54,7 +54,7 @@
<FONT COLOR="#000000">
<?
- $sql="select clock,istrue from alarms where triggerid=$triggerid order by clock desc $limit";
+ $sql="select clock,istrue as status from alarms where triggerid=$triggerid order by clock desc $limit";
$result=DBselect($sql);
echo "<CENTER>";
@@ -70,37 +70,36 @@
$falsesum=0;
$dissum=0;
$clock=mktime();
- for($i=0;$i<DBnum_rows($result);$i++)
+ while($row=DBfetch($result))
{
$lclock=$clock;
- $clock=DBget_field($result,$i,0);
- $leng=$lclock-$clock;
- $status=DBget_field($result,$i,1);
- if($status==0) { echo "<TR BGCOLOR=#EEFFEE>"; }
- elseif($status==2) { echo "<TR BGCOLOR=#DDDDDD>"; }
- elseif($status==3) { echo "<TR BGCOLOR=#EEEEEE>"; }
- else { echo "<TR BGCOLOR=#FFDDDD>"; }
+ $leng=$lclock-$row["clock"];
- echo "<TD>",date("Y.M.d H:i:s",$clock),"</TD>";
- if($status==1)
+ if($row["status"]==0) { echo "<TR BGCOLOR=#EEFFEE>"; }
+ elseif($row["status"]==2) { echo "<TR BGCOLOR=#DDDDDD>"; }
+ elseif($row["status"]==3) { echo "<TR BGCOLOR=#EEEEEE>"; }
+ else { echo "<TR BGCOLOR=#FFDDDD>"; }
+
+ echo "<TD>",date("Y.M.d H:i:s",$row["clock"]),"</TD>";
+ if($row["status"]==1)
{
$istrue="TRUE";
$truesum=$truesum+$leng;
$sum=$truesum;
}
- elseif($status==0)
+ elseif($row["status"]==0)
{
$istrue="FALSE";
$falsesum=$falsesum+$leng;
$sum=$falsesum;
}
- elseif($status==2)
+ elseif($row["status"]==2)
{
$istrue="DISABLED";
$dissum=$dissum+$leng;
$sum=$dissum;
}
- elseif($status==3)
+ elseif($row["status"]==3)
{
$istrue="MODIFIED";
$dissum=$dissum+$leng;
diff --git a/frontends/php/alerts.html b/frontends/php/alerts.html
index d7a80c78..2ea4cc9d 100644
--- a/frontends/php/alerts.html
+++ b/frontends/php/alerts.html
@@ -45,34 +45,20 @@
echo "<TD><FONT SIZE=+1>Message</FONT></TD>";
echo "</TR>";
$col=0;
- for($i=0;$i<DBnum_rows($result);$i++)
+ while($row=DBfetch($result))
{
- if($col==1)
- {
- echo "<tr bgcolor=#DDDDDD>";
- $col=0;
- }
- else
- {
- echo "<tr bgcolor=#EEEEEE>";
- $col=1;
- }
- $clock=DBget_field($result,$i,1);
- $type=DBget_field($result,$i,2);
- if($type=="EMAIL")
+ if($col++%2==0) { echo "<tr bgcolor=#DDDDDD>"; }
+ else { echo "<tr bgcolor=#EEEEEE>"; }
+ if($row["type"]=="EMAIL")
{
$type="E-mail";
}
- $sendto=DBget_field($result,$i,3);
- $subject=DBget_field($result,$i,4);
- $message=DBget_field($result,$i,5);
- $triggerid=DBget_field($result,$i,6);
- echo "<TD><a href=\"alarms.html?triggerid=$triggerid\">".date("Y.M.d H:i:s",$clock)."</a></TD>";
+ echo "<TD><a href=\"alarms.html?triggerid=".$row["triggerid"]."\">".date("Y.M.d H:i:s",$row["clock"])."</a></TD>";
echo "<TD>$type</TD>";
- echo "<TD>$sendto</TD>";
- echo "<TD>$subject</TD>";
- echo "<TD>$message</TD>";
+ echo "<TD>".$row["sendto"]."</TD>";
+ echo "<TD>".$row["subject"]."</TD>";
+ echo "<TD>".$row["message"]."</TD>";
echo "</TR>";
}
echo "</TABLE>";
diff --git a/frontends/php/chart2.html b/frontends/php/chart2.html
index 07f85468..f0482068 100644
--- a/frontends/php/chart2.html
+++ b/frontends/php/chart2.html
@@ -124,7 +124,7 @@
// $result2=DBselect("select itemid from graphs_items where graphid=$graphid");
for($item=0;$item<DBnum_rows($result2);$item++)
{
- if(($minX!=$maxX)&&($minY!=$maxY))
+ if(isset($minX)&&isset($minY)&&($minX!=$maxX)&&($minY!=$maxY))
{
for($i=0;$i<$len[$item]-1;$i++)
{
diff --git a/frontends/php/charts.html b/frontends/php/charts.html
index c08582de..2f4f8d4d 100644
--- a/frontends/php/charts.html
+++ b/frontends/php/charts.html
@@ -28,19 +28,15 @@
echo "<font size=2>";
- $lasthost="";
$result=DBselect("select graphid,name from graphs order by name");
-
- for($i=0;$i<DBnum_rows($result);$i++)
+ while($row=DBfetch($result))
{
- $graphid_=DBget_field($result,$i,0);
- $name=DBget_field($result,$i,1);
- if( isset($graphid) && ($graphid == $graphid_) )
+ if( isset($graphid) && ($graphid == $row["graphid"]) )
{
echo "<b>[";
}
- echo "<a href='charts.html?graphid=$graphid_'>$name</a>";
- if(isset($graphid) && ($graphid == $graphid_) )
+ echo "<a href='charts.html?graphid=".$row["graphid"]."'>".$row["name"]."</a>";
+ if(isset($graphid) && ($graphid == $row["graphid"]) )
{
echo "]</b>";
}
@@ -63,14 +59,14 @@
if(isset($graphid))
{
$result=DBselect("select name from graphs where graphid=$graphid");
- $map=DBget_field($result,0,0);
+ $row=DBfetch($result);
if(isset($fullscreen))
{
- $map="<a href=\"charts.html?graphid=$graphid\">".$map."</a>";
+ $map="<a href=\"charts.html?graphid=$graphid\">".$row["name"]."</a>";
}
else
{
- $map="<a href=\"charts.html?graphid=$graphid&fullscreen=1\">".$map."</a>";
+ $map="<a href=\"charts.html?graphid=$graphid&fullscreen=1\">".$row["name"]."</a>";
}
}
else
diff --git a/frontends/php/graph.html b/frontends/php/graph.html
index 97ba4ce5..aa311c34 100644
--- a/frontends/php/graph.html
+++ b/frontends/php/graph.html
@@ -29,8 +29,8 @@
<?
$result=DBselect("select name from graphs where graphid=$graphid");
- $map=DBget_field($result,0,0);
- show_table_header($map);
+ $row=DBfetch($result);
+ show_table_header($row["name"]);
echo "<TABLE BORDER=0 COLS=4 WIDTH=\"100%\" BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>";
echo "<TR BGCOLOR=#DDDDDD>";
echo "<TD ALIGN=CENTER>";
@@ -51,28 +51,15 @@
$result=DBselect($sql);
echo "<CENTER>";
$col=0;
- for($i=0;$i<DBnum_rows($result);$i++)
+ while($row=DBfetch($result))
{
- if($col==1)
- {
- echo "<TR BGCOLOR=#EEEEEE>";
- $col=0;
- } else
- {
- echo "<TR BGCOLOR=#DDDDDD>";
- $col=1;
- }
-
- $itemid_=DBget_field($result,$i,0);
- $host_=DBget_field($result,$i,1);
- $description_=DBget_field($result,$i,2);
- $gitemid_=DBget_field($result,$i,3);
- $color_=DBget_field($result,$i,4);
+ if($col++%2==0) { echo "<TR BGCOLOR=#EEEEEE>"; }
+ else { echo "<TR BGCOLOR=#DDDDDD>"; }
- echo "<TD>$host_</TD>";
- echo "<TD><a href=\"chart.html?itemid=$itemid_&period=3600&from=0\">$description_</a></TD>";
- echo "<TD>$color_</TD>";
- echo "<TD><A HREF=\"graph.html?register=delete&graphid=$graphid&gitemid=$gitemid_\">Delete</A></TD>";
+ echo "<TD>".$row["host"]."</TD>";
+ echo "<TD><a href=\"chart.html?itemid=".$row["itemid"]."&period=3600&from=0\">".$row["description"]."</a></TD>";
+ echo "<TD>".$row["color"]."</TD>";
+ echo "<TD><A HREF=\"graph.html?register=delete&graphid=$graphid&gitemid=".$row["gitemid"]."\">Delete</A></TD>";
echo "</TR>";
}
echo "</TABLE>";
diff --git a/frontends/php/graphs.html b/frontends/php/graphs.html
index 5aba4104..a35c6eb6 100644
--- a/frontends/php/graphs.html
+++ b/frontends/php/graphs.html
@@ -44,29 +44,18 @@
$result=DBselect("select g.graphid,g.name,g.width,g.height from graphs g order by g.name");
echo "<CENTER>";
$col=0;
- for($i=0;$i<DBnum_rows($result);$i++)
+ while($row=DBfetch($result))
{
- if($col==1)
- {
- echo "<TR BGCOLOR=#EEEEEE>";
- $col=0;
- } else
- {
- echo "<TR BGCOLOR=#DDDDDD>";
- $col=1;
- }
+ if($col++%2==0) { echo "<TR BGCOLOR=#EEEEEE>"; }
+ else { echo "<TR BGCOLOR=#DDDDDD>"; }
- $graphid_=DBget_field($result,$i,0);
- $name_=DBget_field($result,$i,1);
- $width_=DBget_field($result,$i,2);
- $height_=DBget_field($result,$i,3);
- echo "<TD><a href=\"graph.html?graphid=$graphid_\">$name_</a></TD>";
- echo "<TD>$width_</TD>";
- echo "<TD>$height_</TD>";
- echo "<TD><A HREF=\"graphs.html?graphid=$graphid_#form\">Change</A> - <A HREF=\"graphs.html?register=delete&graphid=$graphid_\">Delete</A></TD>";
+ echo "<TD><a href=\"graph.html?graphid=".$row["graphid"]."\">".$row["name"]."</a></TD>";
+ echo "<TD>".$row["width"]."</TD>";
+ echo "<TD>".$row["height"]."</TD>";
+ echo "<TD><A HREF=\"graphs.html?graphid=".$row["graphid"]."#form\">Change</A> - ";
+ echo "<A HREF=\"graphs.html?register=delete&graphid=".$row["graphid"]."\">Delete</A></TD>";
echo "</TR>";
}
-
echo "</TABLE>";
?>
@@ -76,9 +65,10 @@
if(isset($graphid))
{
$result=DBselect("select g.graphid,g.name,g.width,g.height from graphs g where graphid=$graphid");
- $name=DBget_field($result,0,1);
- $width=DBget_field($result,0,2);
- $height=DBget_field($result,0,3);
+ $row=DBfetch($result);
+ $name=$row["name"];
+ $width=$row["width"];
+ $height=$row["height"];
}
else
{
diff --git a/frontends/php/hosts.html b/frontends/php/hosts.html
index 87ab8dcf..a8a86b7a 100644
--- a/frontends/php/hosts.html
+++ b/frontends/php/hosts.html
@@ -49,35 +49,25 @@
$result=DBselect("select h.hostid,h.host,h.port,h.status from hosts h order by h.host");
echo "<CENTER>";
$col=0;
- for($i=0;$i<DBnum_rows($result);$i++)
+ while($row=DBfetch($result))
+// for($i=0;$i<DBnum_rows($result);$i++)
{
- if($col==1)
- {
- echo "<TR BGCOLOR=#EEEEEE>";
- $col=0;
- } else
- {
- echo "<TR BGCOLOR=#DDDDDD>";
- $col=1;
- }
+ if($col++%2==0) { echo "<TR BGCOLOR=#EEEEEE>"; }
+ else { echo "<TR BGCOLOR=#DDDDDD>"; }
- $hostid_=DBget_field($result,$i,0);
- $host_=DBget_field($result,$i,1);
- $port_=DBget_field($result,$i,2);
- $status_=DBget_field($result,$i,3);
- echo "<TD><a href=\"items.html?hostid=$hostid_\">$host_</a></TD>";
- echo "<TD>$port_</TD>";
+ echo "<TD><a href=\"items.html?hostid=".$row["hostid"]."\">".$row["host"]."</a></TD>";
+ echo "<TD>".$row["port"]."</TD>";
echo "<TD>";
- if($status_ == 0)
- echo "<a href=\"hosts.html?hostid=$hostid_&register=changestatus&status=1\">Monitored</a>";
- else if($status_ == 1)
- echo "<a href=\"hosts.html?hostid=$hostid_&register=changestatus&status=0\">Not monitored</a>";
- else if($status_ == 2)
+ if($row["status"] == 0)
+ echo "<a href=\"hosts.html?hostid=".$row["hostid"]."&register=changestatus&status=1\">Monitored</a>";
+ else if($row["status"] == 1)
+ echo "<a href=\"hosts.html?hostid=".$row["hostid"]."&register=changestatus&status=0\">Not monitored</a>";
+ else if($row["status"] == 2)
echo "Unreachable";
else
echo "Unknown";
echo "</TD>";
- echo "<TD><A HREF=\"hosts.html?register=change&hostid=$hostid_#form\">Change</A></TD>";
+ echo "<TD><A HREF=\"hosts.html?register=change&hostid=".$row["hostid"]."#form\">Change</A></TD>";
echo "</TR>";
}
echo "</TABLE>";
diff --git a/frontends/php/include/config.inc b/frontends/php/include/config.inc
index c2c777a1..656bd7e8 100644
--- a/frontends/php/include/config.inc
+++ b/frontends/php/include/config.inc
@@ -293,6 +293,7 @@
($page["file"]=="charts.html")||
($page["file"]=="chart.html")||
($page["file"]=="about.html")||
+ ($page["file"]=="srv_status.html")||
($page["file"]=="index.html"))
{
$sql="select password_required from config";
diff --git a/frontends/php/include/db.inc b/frontends/php/include/db.inc
index 59eafbdf..2de3acce 100644
--- a/frontends/php/include/db.inc
+++ b/frontends/php/include/db.inc
@@ -61,6 +61,22 @@
}
}
+ function DBfetch($result)
+ {
+ global $DB_TYPE;
+
+ if($DB_TYPE == "MYSQL")
+ {
+ $row=mysql_fetch_array($result);
+ return $row;
+ }
+ if($DB_TYPE == "POSTGRESQL")
+ {
+ $row=pg_fetch_array($result);
+ return $row;
+ }
+ }
+
function DBget_field($result,$rownum,$fieldnum)
{
global $DB_TYPE;
diff --git a/frontends/php/items.html b/frontends/php/items.html
index fee11e72..58848672 100644
--- a/frontends/php/items.html
+++ b/frontends/php/items.html
@@ -44,16 +44,15 @@
<?
$result=DBselect("select hostid,host from hosts order by host");
- for($i=0;$i<DBnum_rows($result);$i++)
+ while($row=DBfetch($result))
+// for($i=0;$i<DBnum_rows($result);$i++)
{
- $hid=DBget_field($result,$i,0);
- $host=DBget_field($result,$i,1);
- if(isset($hostid) && ($hostid == $hid))
+ if(isset($hostid) && ($hostid == $row["hostid"]))
{
echo "<b>[";
}
- echo "<A HREF=\"items.html?hostid=$hid\">$host</A>";
- if(isset($hostid) && ($hostid == $hid))
+ echo "<A HREF=\"items.html?hostid=".$row["hostid"]."\">".$row["host"]."</A>";
+ if(isset($hostid) && ($hostid == $row["hostid"]))
{
echo "]</b>";
}
diff --git a/frontends/php/latest.html b/frontends/php/latest.html
index 10a32b43..086bf8af 100644
--- a/frontends/php/latest.html
+++ b/frontends/php/latest.html
@@ -15,16 +15,14 @@
$result=DBselect("select h.hostid,h.host from hosts h,items i where h.status in (0,2) and h.hostid=i.hostid group by h.hostid,h.host order by h.host");
- for($i=0;$i<DBnum_rows($result);$i++)
+ while($row=DBfetch($result))
{
- $hostid_=DBget_field($result,$i,0);
- $host=DBget_field($result,$i,1);
- if( isset($hostid) && ($hostid == $hostid_) )
+ if( isset($hostid) && ($hostid == $row["hostid"]) )
{
echo "<b>[";
}
- echo "<a href='latest.html?hostid=$hostid_'>$host</a>";
- if(isset($hostid) && ($hostid == $hostid_) )
+ echo "<a href='latest.html?hostid=".$row["hostid"]."'>".$row["host"]."</a>";
+ if(isset($hostid) && ($hostid == $row["hostid"]) )
{
echo "]</b>";
}
diff --git a/frontends/php/latestalarms.html b/frontends/php/latestalarms.html
index d6473ece..3343c65b 100644
--- a/frontends/php/latestalarms.html
+++ b/frontends/php/latestalarms.html
@@ -51,27 +51,14 @@
echo "<TD width=\"10%\"><b>Status</b></TD>";
echo "</TR>";
$col=0;
- for($i=0;$i<DBnum_rows($result);$i++)
+ while($row=DBfetch($result))
{
- $description=DBget_field($result,$i,0);
- $clock=DBget_field($result,$i,1);
- $istrue=DBget_field($result,$i,2);
- $triggerid_=DBget_field($result,$i,3);
+ if($col++%2==0) { echo "<tr bgcolor=#DDDDDD>"; }
+ else { echo "<tr bgcolor=#EEEEEE>"; }
- if($col==1)
- {
- echo "<tr bgcolor=#DDDDDD>";
- $col=0;
- }
- else
- {
- echo "<tr bgcolor=#EEEEEE>";
- $col=1;
- }
-
- echo "<TD>",date("Y.M.d H:i:s",$clock),"</TD>";
- echo "<TD><a href=\"alarms.html?triggerid=$triggerid_\">$description</a></TD>";
- if($istrue==0)
+ echo "<TD>",date("Y.M.d H:i:s",$row["clock"]),"</TD>";
+ echo "<TD><a href=\"alarms.html?triggerid=".$row["triggerid"]."\">".$row["description"]."</a></TD>";
+ if($row["istrue"] == 0)
{
echo "<TD><font color=\"00AA00\">OFF</font></TD>";
}
diff --git a/frontends/php/queue.html b/frontends/php/queue.html
index 78960857..dc45ff53 100644
--- a/frontends/php/queue.html
+++ b/frontends/php/queue.html
@@ -21,29 +21,14 @@
echo "<tr><td><b>Next time to check</b></td><td><b>Host</b></td><td><b>Description</b></td></tr>";
echo "\n";
$col=0;
- for($i=0;$i<DBnum_rows($result);$i++)
+ while($row=DBfetch($result))
{
- $itemid=DBget_field($result,$i,0);
- $time=DBget_field($result,$i,1);
- $description=DBget_field($result,$i,2);
- $host=DBget_field($result,$i,3);
-
- $time=date("m.d.Y H:i:s",$time);
-
- if($col==1)
- {
- echo "<tr bgcolor=#EEEEEE>";
- $col=0;
- } else
- {
- echo "<tr bgcolor=#DDDDDD>";
- $col=1;
- }
- echo "\n";
- echo "<td>$time</td><td>$host</td><td>$description</td>";
- echo "\n";
+ if($col++%2==0) { echo "<tr bgcolor=#EEEEEE>"; }
+ else { echo "<tr bgcolor=#DDDDDD>"; }
+ echo "<td>".date("m.d.Y H:i:s",$row["nextcheck"])."</td>";
+ echo "<td>".$row["host"]."</td>";
+ echo "<td>".$row["description"]."</td>";
echo "</tr>";
- echo "\n";
}
echo "</table>";
?>
diff --git a/frontends/php/services.html b/frontends/php/services.html
index afde6132..fb9146d2 100644
--- a/frontends/php/services.html
+++ b/frontends/php/services.html
@@ -167,6 +167,19 @@
echo "<OPTION VALUE='$serviceupid_'>$name_";
}
echo "</SELECT>";
+
+ show_table2_v_delimiter();
+ echo "Soft link ?";
+ show_table2_h_delimiter();
+ if(isset($softlink)&&($triggerid!=""))
+ {
+ echo "<INPUT TYPE=\"CHECKBOX\" NAME=\"softlink\" VALUE=\"true\">";
+ }
+ else
+ {
+ echo "<INPUT TYPE=\"CHECKBOX\" NAME=\"softlink\">";
+ }
+
show_table2_v_delimiter2();
echo "<input type=\"submit\" name=\"register\" value=\"add link\">";
diff --git a/frontends/php/tr_status.html b/frontends/php/tr_status.html
index 7b42a64f..fd97017b 100644
--- a/frontends/php/tr_status.html
+++ b/frontends/php/tr_status.html
@@ -77,17 +77,15 @@
{
echo "<b>[<A HREF=\"tr_status.html?onlytrue=$onlytrue&noactions=$noactions&compact=$compact\">all</A>]</b> ";
}
- for($i=0;$i<DBnum_rows($result);$i++)
+ while($row=DBfetch($result))
{
- $hid=DBget_field($result,$i,0);
- $host=DBget_field($result,$i,1);
- if(isset($hostid) && ($hid == $hostid))
+ if(isset($hostid) && ($row["hostid"] == $hostid))
{
- echo "<b>[<A HREF=\"tr_status.html?hostid=$hid&onlytrue=$onlytrue&noactions=$noactions&compact=$compact\">$host</A>]</b> ";
+ echo "<b>[<A HREF=\"tr_status.html?hostid=".$row["hostid"]."&onlytrue=$onlytrue&noactions=$noactions&compact=$compact\">".$row["host"]."</A>]</b> ";
}
else
{
- echo "<A HREF=\"tr_status.html?hostid=$hid&onlytrue=$onlytrue&noactions=$noactions&compact=$compact\">$host</A> ";
+ echo "<A HREF=\"tr_status.html?hostid=".$row["hostid"]."&onlytrue=$onlytrue&noactions=$noactions&compact=$compact\">".$row["host"]."</A> ";
}
}