Merge branch 'iconnor-updated-console' into storageareas

This commit is contained in:
Isaac Connor
2016-05-06 15:46:00 -04:00
2 changed files with 6 additions and 4 deletions

View File

@@ -152,6 +152,7 @@ function getNavBarHTML() {
# Used to determine if the Cycle button should be made available
$cycleCount = 0;
$monitors = dbFetchAll( "select * from Monitors order by Sequence asc" );
global $displayMonitors;
$displayMonitors = array();
for ( $i = 0; $i < count($monitors); $i++ ) {
if ( !visibleMonitor( $monitors[$i]['Id'] ) ) {

View File

@@ -85,7 +85,8 @@ $displayMonitors = NULL;
$navbar = getNavBarHTML();
$zoneCount = 0;
foreach( $displayMonitors as $monitor ) {
for( $i = 0; $i < count($displayMonitors); $i += 1 ) { {
$monitor = $displayMonitors[$i];
$monitor['zmc'] = zmcStatus( $monitor );
$monitor['zma'] = zmaStatus( $monitor );
$monitor['ZoneCount'] = dbFetchOne( 'select count(Id) as ZoneCount from Zones where MonitorId = ?', 'ZoneCount', array($monitor['Id']) );
@@ -98,9 +99,9 @@ foreach( $displayMonitors as $monitor ) {
}
$sql = "select ".join($counts,", ")." from Events as E where MonitorId = ?";
$counts = dbFetchOne( $sql, NULL, array($monitor['Id']) );
if ( $counts ) $monitor = array_merge( $monitor, $counts );
for ( $i = 0; $i < count($eventCounts); $i++ ) {
$eventCounts[$i]['total'] += $monitor['EventCount'.$i];
if ( $counts ) $displayMonitors[$i] = array_merge( $monitor, $counts );
for ( $i = 0; $j < count($eventCounts); $j++ ) {
$eventCounts[$j]['total'] += $monitor['EventCount'.$j];
}
$zoneCount += $monitor['ZoneCount'];
}