".substr( $monitor['Function'], 0, 4 )."", canEdit( 'Monitors' ) ) ?> | ||||
1 ) { ?> |
array( "terms" => array( array( "attr" => "Archived", "op" => "=", "val" => "0" ), array( "cnj" => "and", "attr" => "DateTime", "op" => ">=", "val" => "-1 hour" ), ) ), ), // Today array( "filter" => array( "terms" => array( array( "attr" => "Archived", "op" => "=", "val" => "0" ), array( "cnj" => "and", "attr" => "DateTime", "op" => ">=", "val" => "today" ), ) ), ), ); $running = daemonCheck(); $status = $running?$SLANG['Running']:$SLANG['Stopped']; if ( $group = dbFetchOne( "select * from Groups where Name = 'Mobile'" ) ) $groupIds = array_flip(explode( ',', $group['MonitorIds'] )); $maxWidth = 0; $maxHeight = 0; $cycleCount = 0; $monitors = dbFetchAll( "select * from Monitors order by Sequence asc" ); for ( $i = 0; $i < count($monitors); $i++ ) { if ( !visibleMonitor( $monitors[$i]['Id'] ) ) { continue; } if ( $group && !empty($groupIds) && !array_key_exists( $monitors[$i]['Id'], $groupIds ) ) { continue; } $monitors[$i]['Show'] = true; $monitors[$i]['zmc'] = zmcStatus( $monitors[$i] ); $monitors[$i]['zma'] = zmaStatus( $monitors[$i] ); $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" => $monitors[$i]['Id'] ) ); parseFilter( $filter, false, '&' ); $counts[] = "count(if(1".$filter['sql'].",1,NULL)) as EventCount$j"; $monitors[$i]['eventCounts'][$j]['filter'] = $filter; } $sql = "select ".join($counts,", ")." from Events as E where MonitorId = '".$monitors[$i]['Id']."'"; $counts = dbFetchOne( $sql ); if ( $monitors[$i]['Function'] != 'None' ) { $cycleCount++; if ( $maxWidth < $monitors[$i]['Width'] ) $maxWidth = $monitors[$i]['Width']; if ( $maxHeight < $monitors[$i]['Height'] ) $maxHeight = $monitors[$i]['Height']; } $monitors[$i] = array_merge( $monitors[$i], $counts ); } xhtmlHeaders( __FILE__, $SLANG['Console'] ); ?>