From a2f46eff39e547e40d042ce97851805b9f9efea4 Mon Sep 17 00:00:00 2001 From: hugetoad Date: Mon, 16 Apr 2001 17:45:23 +0000 Subject: Added PostgreSQL support for PHP frontend. Added database abstraction layer in frontend/php/include/db.inc. git-svn-id: svn://svn.zabbix.com/trunk@42 97f52cf1-0a1b-0410-bd0e-c28be96e8082 --- frontends/php/items.html | 49 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 25 deletions(-) (limited to 'frontends/php/items.html') diff --git a/frontends/php/items.html b/frontends/php/items.html index 0b218114..dd4c33ee 100644 --- a/frontends/php/items.html +++ b/frontends/php/items.html @@ -33,7 +33,7 @@ ?> all "; @@ -42,10 +42,10 @@ { echo "[all] "; } - while($row=mysql_fetch_row($result)) + for($i=0;$i["; @@ -69,13 +69,13 @@ { $whereonly="where h.hostid=i.hostid"; } - $result=mysql_query("select h.host,i.key_,i.itemid,i.description,h.port,i.delay,i.history,i.lastvalue,i.lastclock,i.status,i.lastdelete,i.nextcheck,h.hostid from hosts h,items i $whereonly order by h.host,i.key_,i.description",$mysql); + $result=DBselect("select h.host,i.key_,i.itemid,i.description,h.port,i.delay,i.history,i.lastvalue,i.lastclock,i.status,i.lastdelete,i.nextcheck,h.hostid from hosts h,items i $whereonly order by h.host,i.key_,i.description"); echo "
"; - while($row=mysql_fetch_row($result)) + for($i=0;$i
=$host= =$lasthost=\n"; if($lasthost!=$host) { @@ -122,19 +122,19 @@ echo ""; $col=1; } - $host=$row[0]; - $port=$row[4]; - $delay=$row[5]; - $history=$row[6]; - $shortname=$row[0].':'.$row[1]; - $key=$row[1]; - $description=$row[3]; - $lastvalue=$row[7]; - $lastclock=date("y/m/d H:i:s",$row[9]); - $itemid_=$row[2]; - $status=$row[9]; - $lastdelete=date("y/m/d H:i:s",$row[10]); - $nextcheck=date("y/m/d H:i:s",$row[11]); + $host=DBget_field($result,$i,0); + $port=DBget_field($result,$i,4); + $delay=DBget_field($result,$i,5); + $history=DBget_field($result,$i,6); + $key=DBget_field($result,$i,1); + $shortname=$host.':'.$key; + $description=DBget_field($result,$i,3); + $lastvalue=DBget_field($result,$i,7); + $lastclock=date("y/m/d H:i:s",DBget_field($result,$i,9)); + $itemid_=DBget_field($result,$i,2); + $status=DBget_field($result,$i,9); + $lastdelete=date("y/m/d H:i:s",DBget_field($result,$i,10)); + $nextcheck=date("y/m/d H:i:s",DBget_field($result,$i,11)); echo "$host"; echo "$key"; echo "$description"; @@ -169,9 +169,8 @@ ?> 0) + $result=DBselect("select count(*) from hosts"); + if(DBget_field($result,0,0)>0) { echo ""; insert_item_form($itemid); -- cgit