translate('Events'), "filter" => array( "terms" => array( ) ), ), array( "title" => translate('Hour'), "filter" => array( "terms" => array( array( "attr" => "DateTime", "op" => ">=", "val" => "-1 hour" ), ) ), ), array( "title" => translate('Day'), "filter" => array( "terms" => array( array( "attr" => "DateTime", "op" => ">=", "val" => "-1 day" ), ) ), ), array( "title" => translate('Week'), "filter" => array( "terms" => array( array( "attr" => "DateTime", "op" => ">=", "val" => "-7 day" ), ) ), ), array( "title" => translate('Month'), "filter" => array( "terms" => array( array( "attr" => "DateTime", "op" => ">=", "val" => "-1 month" ), ) ), ), array( "title" => translate('Archived'), "filter" => array( "terms" => array( array( "attr" => "Archived", "op" => "=", "val" => "1" ), ) ), ), ); $displayMonitors = NULL: # Also populates displayMonitors $navbar = getNavBarHTML(); foreach( $displayMonitors as $monitor ) $monitor['zmc'] = zmcStatus( $monitor ); $monitor['zma'] = zmaStatus( $monitor ); $monitor['ZoneCount'] = dbFetchOne( 'select count(Id) as ZoneCount from Zones where MonitorId = ?', 'ZoneCount', array($monitor['Id']) ); $counts = array(); for ( $j = 0; $j < count($eventCounts); $j++ ) { $filter = addFilterTerm( $eventCounts[$j]['filter'], count($eventCounts[$j]['filter']['terms']), array( "cnj" => "and", "attr" => "MonitorId", "op" => "=", "val" => $monitor['Id'] ) ); parseFilter( $filter ); $counts[] = "count(if(1".$filter['sql'].",1,NULL)) as EventCount$j"; $monitor['eventCounts'][$j]['filter'] = $filter; } $sql = "select ".join($counts,", ")." from Events as E where MonitorId = ?"; $counts = dbFetchOne( $sql, NULL, array($monitor['Id']) ); if ( $counts ) $monitor = array_merge( $monitor, $counts ); } noCacheHeaders(); $seqUpFile = getSkinFile( 'graphics/seq-u.gif' ); $seqDownFile = getSkinFile( 'graphics/seq-d.gif' ); xhtmlHeaders( __FILE__, translate('Console') ); ?>