'$db_now' - INTERVAL 1 HOUR && E.Archived = 0,1,NULL)) as HourEventCount, count(if((to_days(E.StartTime)=to_days('$db_now')) && E.Archived = 0,1,NULL)) as TodayEventCount from Monitors as M left join Events as E on E.MonitorId = M.Id group by M.Id order by M.Id"; $result = mysql_query( $sql ); if ( !$result ) echo mysql_error(); $monitors = array(); $max_width = 0; $max_height = 0; $cycle_count = 0; while( $row = mysql_fetch_assoc( $result ) ) { if ( !visibleMonitor( $row['Id'] ) ) { continue; } if ( $group && $group['MonitorIds'] && !in_array( $row['Id'], split( ',', $group['MonitorIds'] ) ) ) { continue; } $row['zmc'] = zmcStatus( $row ); $row['zma'] = zmaStatus( $row ); $sql = "select count(Id) as ZoneCount from Zones where MonitorId = '".$row['Id']."'"; $result2 = mysql_query( $sql ); if ( !$result2 ) echo mysql_error(); $row2 = mysql_fetch_assoc( $result2 ); mysql_free_result( $result2 ); $monitors[] = array_merge( $row, $row2 ); if ( $row['Function'] != 'None' ) { $cycle_count++; if ( $max_width < $row['Width'] ) $max_width = $row['Width']; if ( $max_height < $row['Height'] ) $max_height = $row['Height']; } } mysql_free_result( $result ); ?>
= preg_match( '/%/', DATE_FMT_CONSOLE_SHORT )?strftime( DATE_FMT_CONSOLE_SHORT ):date( DATE_FMT_CONSOLE_SHORT ) ?> | = makeLink( "$PHP_SELF?view=state", $status, canEdit( 'System' ) ) ?> | = getLoad() ?>/= getDiskPercent() ?>% |
= makeLink( "$PHP_SELF?view=watch&mid=".$monitor['Id'], substr( $monitor['Name'], 0, 8 ), $running && ($monitor['Function'] != 'None') && canView( 'Stream' ) ) ?> | = makeLink( "$PHP_SELF?view=function&mid=".$monitor['Id'], "".substr( $monitor['Function'], 0, 4 )."", canEdit( 'Monitors' ) ) ?> | = makeLink( "$PHP_SELF?view=events&page=1&filter=1&trms=3&attr1=MonitorId&op1=%3d&val1=".$monitor['Id']."&cnj2=and&attr2=Archived&op2=%3d&val2=0&cnj3=and&attr3=DateTime&op3=%3e%3d&val3=-1%20hour", $monitor['HourEventCount'], canView( 'Events' ) ) ?> | = makeLink( "$PHP_SELF?view=events&page=1&filter=1&trms=3&attr1=MonitorId&op1=%3d&val1=".$monitor['Id']."&cnj2=and&attr2=Archived&op2=%3d&val2=0&cnj3=and&attr3=Date&op3=%3e%3d&val3=today", $monitor['TodayEventCount'], canView( 'Events' ) ) ?> |
= makeLink( "$PHP_SELF?view=montage", count($monitors), ( $running && canView( 'Stream' ) && $cycle_count > 1 ) ) ?> | = makeLink( "$PHP_SELF?view=events&page=1&filter=1&trms=2&attr1=Archived&op1=%3d&val1=0&cnj2=and&attr2=DateTime&op2=%3e%3d&val2=-1%20hour", $hour_event_count, canView( 'Events' ) ) ?> | = makeLink( "$PHP_SELF?view=events&page=1&filter=1&trms=2&attr1=Archived&op1=%3d&val1=0&cnj2=and&attr2=Date&op2=%3e%3d&val2=today", $today_event_count, canView( 'Events' ) ) ?> |