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?$zmSlangRunning:$zmSlangStopped; if ( $group = dbFetchOne( "select * from Groups where Name = 'Mobile'" ) ) $group_ids = array_flip(split( ',', $group['MonitorIds'] )); $db_now = strftime( STRF_FMT_DATETIME_DB ); $monitors = array(); $max_width = 0; $max_height = 0; $cycle_count = 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($group_ids) && !array_key_exists( $monitors[$i]['Id'], $group_ids ) ) { continue; } $monitors[$i]['Show'] = true; $monitors[$i]['zmc'] = zmcStatus( $monitors[$i] ); $monitors[$i]['zma'] = zmaStatus( $monitors[$i] ); //$monitors[$i]['ZoneCount'] = dbFetchOne( "select count(Id) as ZoneCount from Zones where MonitorId = '".$monitors[$i]['Id']."'", "ZoneCount" ); $counts = array(); for ( $j = 0; $j < count($event_counts); $j++ ) { $filter = addFilterTerm( $event_counts[$j]['filter'], count($event_counts[$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]['event_counts'][$j]['filter'] = $filter; } $sql = "select ".join($counts,", ")." from Events as E where MonitorId = '".$monitors[$i]['Id']."'"; $counts = dbFetchOne( $sql ); if ( $monitors[$i]['Function'] != 'None' ) { $cycle_count++; if ( $max_width < $monitors[$i]['Width'] ) $max_width = $monitors[$i]['Width']; if ( $max_height < $monitors[$i]['Height'] ) $max_height = $monitors[$i]['Height']; } $monitors[$i] = array_merge( $monitors[$i], $counts ); } noCacheHeaders(); header("Content-type: application/xhtml+xml" ); echo( ''."\n" ); ?> <?= ZM_WEB_TITLE_PREFIX ?> - <?= $zmSlangConsole ?>
/%
1 ) { ?>
".substr( $monitor['Function'], 0, 4 )."", canEdit( 'Monitors' ) ) ?>