summaryrefslogtreecommitdiffstats
path: root/frontends/php/include/services.inc.php
diff options
context:
space:
mode:
authorartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-03-27 17:00:36 +0000
committerartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-03-27 17:00:36 +0000
commit5d1e6e58ae6245c3c2034ed7e35f95d45a73055a (patch)
tree03ff74a4dd1aa3082fcbf6fe20b8631529ff0dab /frontends/php/include/services.inc.php
parent287db0bc8db438e082be402b6f3de174b23e2b31 (diff)
- improvements in Class tree (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@5555 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/services.inc.php')
-rw-r--r--frontends/php/include/services.inc.php29
1 files changed, 16 insertions, 13 deletions
diff --git a/frontends/php/include/services.inc.php b/frontends/php/include/services.inc.php
index 44f67ffb..c00cf1f1 100644
--- a/frontends/php/include/services.inc.php
+++ b/frontends/php/include/services.inc.php
@@ -416,20 +416,25 @@
$data[$period_start]['alarm'] = get_last_service_value($serviceid,$period_start);
- $service_alarms = DBselect("SELECT clock,value FROM service_alarms".
- " WHERE serviceid=".$serviceid." and clock>=".$period_start." and clock<=".$period_end." order by clock");
+ $service_alarms = DBselect('SELECT clock,value '.
+ ' FROM service_alarms '.
+ ' WHERE serviceid='.$serviceid.
+ ' AND clock>='.$period_start.
+ ' AND clock<='.$period_end.
+ ' ORDER BY clock');
/* add alarms */
- while($db_alarm_row = DBfetch($service_alarms))
- {
+ while($db_alarm_row = DBfetch($service_alarms)){
$data[$db_alarm_row['clock']]['alarm'] = $db_alarm_row['value'];
}
/* add periodical downtimes */
- $service_times = DBselect('SELECT ts_from,ts_to FROM services_times WHERE type='.SERVICE_TIME_TYPE_UPTIME.
- ' and serviceid='.$serviceid);
- if($db_time_row = DBfetch($service_times))
- {
+ $service_times = DBselect('SELECT ts_from,ts_to '.
+ ' FROM services_times '.
+ ' WHERE type='.SERVICE_TIME_TYPE_UPTIME.
+ ' AND serviceid='.$serviceid);
+
+ if($db_time_row = DBfetch($service_times)){
/* if exist any uptime - unmarked time is downtime */
$unmarked_period_type = 'dt';
do{
@@ -440,8 +445,7 @@
}while($db_time_row = DBfetch($service_times));
}
- else
- {
+ else{
/* if missed any uptime - unmarked time is uptime */
$unmarked_period_type = 'ut';
}
@@ -449,8 +453,7 @@
/* add periodical downtimes */
$service_times = DBselect('SELECT ts_from,ts_to FROM services_times WHERE type='.SERVICE_TIME_TYPE_DOWNTIME.
' and serviceid='.$serviceid);
- while($db_time_row = DBfetch($service_times))
- {
+ while($db_time_row = DBfetch($service_times)){
expand_periodical_service_times($data,
$period_start, $period_end,
$db_time_row['ts_from'], $db_time_row['ts_to'],
@@ -678,7 +681,7 @@ $dt = 0;
}
}
} else {
- $rows['caption'] = '<font style="color: #888888;">'.$rows['caption'].'</font>';
+ $rows['caption'] = new CSpan($rows['caption'],'unknown');
$temp[$rows['serviceid'].','.$linkid]=$rows;
}
return ;