From 5e59c850e90340775b56e146e898d55c903e2ce2 Mon Sep 17 00:00:00 2001 From: hugetoad Date: Thu, 11 Sep 2003 04:43:17 +0000 Subject: - fix for counting of triggers in map.php. (Alexei) git-svn-id: svn://svn.zabbix.com/trunk@977 97f52cf1-0a1b-0410-bd0e-c28be96e8082 --- frontends/php/map.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'frontends/php/map.php') diff --git a/frontends/php/map.php b/frontends/php/map.php index 23d1c61b..cd50c42a 100644 --- a/frontends/php/map.php +++ b/frontends/php/map.php @@ -161,11 +161,11 @@ } else { - $result1=DBselect("select count(*) from items i,functions f,triggers t,hosts h where h.hostid=i.hostid and i.hostid=$hostid and i.itemid=f.itemid and f.triggerid=t.triggerid and t.value=1 and t.status=0 and h.status in (0,2) and i.status=0"); + $result1=DBselect("select count(distinct t.triggerid) from items i,functions f,triggers t,hosts h where h.hostid=i.hostid and i.hostid=$hostid and i.itemid=f.itemid and f.triggerid=t.triggerid and t.value=1 and t.status=0 and h.status in (0,2) and i.status=0"); $count=DBget_field($result1,0,0); if($count==1) { - $result1=DBselect("select t.description,t.triggerid, t.priority from items i,functions f,triggers t,hosts h where h.hostid=i.hostid and i.hostid=$hostid and i.itemid=f.itemid and f.triggerid=t.triggerid and t.value=1 and t.status=0 and h.status in (0,2) and i.status=0"); + $result1=DBselect("select distinct t.description,t.triggerid, t.priority from items i,functions f,triggers t,hosts h where h.hostid=i.hostid and i.hostid=$hostid and i.itemid=f.itemid and f.triggerid=t.triggerid and t.value=1 and t.status=0 and h.status in (0,2) and i.status=0"); $label=DBget_field($result1,0,0); if (DBget_field($result1,0,2) > 3) $color=$red; -- cgit