Merge branch 'master' into storageareas

This commit is contained in:
Isaac Connor 2017-07-13 11:07:06 -04:00
commit 37003aebcf
1 changed files with 11 additions and 3 deletions

View File

@ -32,7 +32,14 @@ $maxTimeSecs = strtotime('1950-01-01 01:01:01');
$index=0; $index=0;
$anyAlarms=false; $anyAlarms=false;
foreach( dbFetchAll( $eventsSql ) as $event ) { $result = dbQuery( $eventsSql );
if ( ! $result ) {
Fatal( "SQL-ERR");
return;
}
while( $event = $result->fetch( PDO::FETCH_ASSOC ) ) {
if ( $minTimeSecs > $event['StartTimeSecs'] ) $minTimeSecs = $event['StartTimeSecs']; if ( $minTimeSecs > $event['StartTimeSecs'] ) $minTimeSecs = $event['StartTimeSecs'];
if ( $maxTimeSecs < $event['CalcEndTimeSecs'] ) $maxTimeSecs = $event['CalcEndTimeSecs']; if ( $maxTimeSecs < $event['CalcEndTimeSecs'] ) $maxTimeSecs = $event['CalcEndTimeSecs'];
echo " echo "
@ -84,8 +91,9 @@ $fromSecs=-1;
$toSecs=-1; $toSecs=-1;
$maxScore=-1; $maxScore=-1;
if ( $anyAlarms ) { if ( $anyAlarms && $result = dbQuery( $frameSql ) ) {
foreach( dbFetchAll ($frameSql) as $frame ) {
while( $frame = $result->fetch( PDO::FETCH_ASSOC ) ) {
if ( $mId < 0 ) { if ( $mId < 0 ) {
$mId = $frame['MonitorId']; $mId = $frame['MonitorId'];
$fromSecs = $frame['TimeStampSecs']; $fromSecs = $frame['TimeStampSecs'];