diff --git a/web/ajax/stats.php b/web/ajax/stats.php index 9226814b4..98b07b01e 100644 --- a/web/ajax/stats.php +++ b/web/ajax/stats.php @@ -9,6 +9,7 @@ $raw = isset($_REQUEST['raw']); $data = array(); if ($raw) { + $data['raw'] = array(); $sql = 'SELECT S.*,E.*,Z.Name AS ZoneName,Z.Units,Z.Area,M.Name AS MonitorName FROM Stats AS S LEFT JOIN Events AS E ON S.EventId = E.Id LEFT JOIN Zones AS Z ON S.ZoneId = Z.Id LEFT JOIN Monitors AS M ON E.MonitorId = M.Id WHERE S.EventId = ? AND S.FrameId = ? ORDER BY S.ZoneId'; diff --git a/web/includes/Object.php b/web/includes/Object.php index 1a9011586..ff5d40baa 100644 --- a/web/includes/Object.php +++ b/web/includes/Object.php @@ -11,19 +11,24 @@ class ZM_Object { $class = get_class($this); $row = NULL; - if ( $IdOrRow ) { + if ($IdOrRow) { - if ( is_integer($IdOrRow) or ctype_digit($IdOrRow) ) { + if (is_integer($IdOrRow) or ctype_digit($IdOrRow)) { $table = $class::$table; $row = dbFetchOne("SELECT * FROM `$table` WHERE `Id`=?", NULL, array($IdOrRow)); - if ( !$row ) { + if (!$row) { Error("Unable to load $class record for Id=$IdOrRow"); + return; } - } else if ( is_array($IdOrRow) ) { + } else if (is_array($IdOrRow)) { $row = $IdOrRow; } if ( $row ) { + if (!isset($row['Id'])) { + Error("No Id in " . print_r($row, true)); + return; + } foreach ($row as $k => $v) { $this->{$k} = $v; } diff --git a/web/skins/classic/views/frame.php b/web/skins/classic/views/frame.php index 9931c910a..7a281a29a 100644 --- a/web/skins/classic/views/frame.php +++ b/web/skins/classic/views/frame.php @@ -116,7 +116,10 @@ xhtmlHeaders(__FILE__, translate('Frame').' - '.$Event->Id().' - '.$Frame->Frame
', $Event->Id(), $Frame->FrameId(), $scale, ( $show=='anal'?'capt':'anal' ) ); + echo sprintf('', + $Event->Id(), $Frame->FrameId(), $scale, ( $show=='anal'?'capt':'anal' ), + ( $show=='anal'?'without':'with' ), + ); } ?> ');