Merge branch 'master' into merge_work_on_zms

This commit is contained in:
Isaac Connor 2022-01-07 16:22:51 -05:00
commit a679455a0b
4 changed files with 17 additions and 8 deletions

View File

@ -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';

View File

@ -18,12 +18,17 @@ class ZM_Object {
$row = dbFetchOne("SELECT * FROM `$table` WHERE `Id`=?", NULL, array($IdOrRow));
if (!$row) {
Error("Unable to load $class record for Id=$IdOrRow");
return;
}
} 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;
}

View File

@ -116,7 +116,10 @@ xhtmlHeaders(__FILE__, translate('Frame').' - '.$Event->Id().' - '.$Frame->Frame
<p id="image">
<?php
if ( $imageData['hasAnalImage'] ) {
echo sprintf('<a href="?view=frame&amp;eid=%d&amp;fid=%d&scale=%d&amp;show=%s">', $Event->Id(), $Frame->FrameId(), $scale, ( $show=='anal'?'capt':'anal' ) );
echo sprintf('<a href="?view=frame&amp;eid=%d&amp;fid=%d&scale=%d&amp;show=%s" title="Click to display frame %s analysis">',
$Event->Id(), $Frame->FrameId(), $scale, ( $show=='anal'?'capt':'anal' ),
( $show=='anal'?'without':'with' ),
);
}
?>
<img id="frameImg"

View File

@ -40,8 +40,8 @@ function changeScale() {
}
function getFrameStatsCookie() {
var cookie = 'zmFrameStats';
var stats = getCookie(cookie);
const cookie = 'zmFrameStats';
let stats = getCookie(cookie);
if (!stats) {
stats = 'on';
@ -53,7 +53,7 @@ function getFrameStatsCookie() {
function getStat(params) {
$j.getJSON(thisUrl + '?view=request&request=stats&raw=true', params)
.done(function(data) {
var stats = data.raw;
const stats = data.raw;
$j('#frameStatsTable').empty().append('<tbody>');