function make_event_details($eventid) { $event = get_tr_event_by_eventid($eventid); $table = new CTableInfo(); $table->AddRow(array(S_EVENT, expand_trigger_description($event['triggerid']))); $table->AddRow(array(S_TIME, date('Y.M.d H:i:s', $event['clock']))); $duration = zbx_date2age($event['clock']); if ($next_event = get_next_event($event, 1)) { $duration = zbx_date2age($event['clock'], $next_event['clock']); } if ($event["value"] == TRIGGER_VALUE_FALSE) { $value = new CCol(S_OK_BIG, "off"); } elseif ($event["value"] == TRIGGER_VALUE_TRUE) { $value = new CCol(S_PROBLEM_BIG, "on"); } else { $value = new CCol(S_UNKNOWN_BIG, "unknown"); } $ack = '-'; if ($event["value"] == 1 && $event["acknowledged"] == 1) { $db_acks = get_acknowledges_by_eventid($event["eventid"]); $rows = 0; while ($a = DBfetch($db_acks)) { $rows++; } $ack = array(new CLink(new CSpan(S_YES, 'off'), 'acknow.php?eventid=' . $event['eventid'], 'action'), SPACE . '(' . $rows . ')'); } $table->AddRow(array(S_STATUS, $value)); $table->AddRow(array(S_DURATION, $duration)); $table->AddRow(array(S_ACKNOWLEDGED, $ack)); return $table; }
function make_event_details($eventid) { $config = select_config(); $event = get_tr_event_by_eventid($eventid); $table = new CTableInfo(); $table->AddRow(array(S_EVENT, expand_trigger_description($event['triggerid']))); $table->AddRow(array(S_TIME, zbx_date2str(S_EVENTS_EVENT_DETAILS_DATE_FORMAT, $event['clock']))); $duration = zbx_date2age($event['clock']); if ($next_event = get_next_event($event)) { $duration = zbx_date2age($event['clock'], $next_event['clock']); } if ($event['value'] == TRIGGER_VALUE_FALSE) { $value = new CCol(S_OK_BIG, 'off'); } elseif ($event['value'] == TRIGGER_VALUE_TRUE) { $value = new CCol(S_PROBLEM_BIG, 'on'); } else { $value = new CCol(S_UNKNOWN_BIG, 'unknown'); } $table->addRow(array(S_STATUS, $value)); $table->addRow(array(S_DURATION, $duration)); if ($config['event_ack_enable']) { global $page; $backurl = urlencode(urlencode($page['file'] . '?eventid=' . $eventid . '&triggerid=' . $event['triggerid'])); if ($event['acknowledged'] == 1) { $rows = 0; $db_acks = get_acknowledges_by_eventid($event["eventid"]); while ($a = DBfetch($db_acks)) { $rows++; } $ack = array(new CLink(S_YES, 'acknow.php?eventid=' . $event['eventid'] . '&backurl=' . $backurl, 'off'), ' (' . $rows . ')'); } else { $ack = array(new CLink(S_NO, 'acknow.php?eventid=' . $event['eventid'] . '&backurl=' . $backurl, 'on')); } $table->addRow(array(S_ACKNOWLEDGED, $ack)); } return $table; }