fix spacing

This commit is contained in:
Isaac Connor 2018-04-20 14:21:41 -04:00
parent 970830aee3
commit 07e7ab1547
1 changed files with 81 additions and 81 deletions

View File

@ -109,83 +109,83 @@ $statusData = array(
'MaxScore' => true, 'MaxScore' => true,
), ),
), ),
'event' => array( 'event' => array(
'permission' => 'Events', 'permission' => 'Events',
'table' => 'Events', 'table' => 'Events',
'limit' => 1, 'limit' => 1,
'selector' => 'Events.Id', 'selector' => 'Events.Id',
'elements' => array( 'elements' => array(
'Id' => array( 'sql' => 'Events.Id' ), 'Id' => array( 'sql' => 'Events.Id' ),
'MonitorId' => true, 'MonitorId' => true,
'MonitorName' => array('sql' => '(SELECT Monitors.Name FROM Monitors WHERE Monitors.Id = Events.MonitorId)'), 'MonitorName' => array('sql' => '(SELECT Monitors.Name FROM Monitors WHERE Monitors.Id = Events.MonitorId)'),
'Name' => true, 'Name' => true,
'Cause' => true, 'Cause' => true,
'StartTime' => true, 'StartTime' => true,
'StartTimeShort' => array( 'sql' => "date_format( StartTime, '".MYSQL_FMT_DATETIME_SHORT."' )" ), 'StartTimeShort' => array( 'sql' => "date_format( StartTime, '".MYSQL_FMT_DATETIME_SHORT."' )" ),
'EndTime' => true, 'EndTime' => true,
'Width' => true, 'Width' => true,
'Height' => true, 'Height' => true,
'Length' => true, 'Length' => true,
'Frames' => true, 'Frames' => true,
'DefaultVideo' => true, 'DefaultVideo' => true,
'AlarmFrames' => true, 'AlarmFrames' => true,
'TotScore' => true, 'TotScore' => true,
'AvgScore' => true, 'AvgScore' => true,
'MaxScore' => true, 'MaxScore' => true,
'Archived' => true, 'Archived' => true,
'Videoed' => true, 'Videoed' => true,
'Uploaded' => true, 'Uploaded' => true,
'Emailed' => true, 'Emailed' => true,
'Messaged' => true, 'Messaged' => true,
'Executed' => true, 'Executed' => true,
'Notes' => true, 'Notes' => true,
'MinFrameId' => array( 'sql' => '(SELECT min(Frames.FrameId) FROM Frames WHERE EventId=Events.Id)' ), 'MinFrameId' => array( 'sql' => '(SELECT min(Frames.FrameId) FROM Frames WHERE EventId=Events.Id)' ),
'MaxFrameId' => array( 'sql' => '(SELECT max(Frames.FrameId) FROM Frames WHERE Events.Id = Frames.EventId)' ), 'MaxFrameId' => array( 'sql' => '(SELECT max(Frames.FrameId) FROM Frames WHERE Events.Id = Frames.EventId)' ),
'MinFrameDelta' => array( 'sql' => '(SELECT min(Frames.Delta) FROM Frames WHERE Events.Id = Frames.EventId)' ), 'MinFrameDelta' => array( 'sql' => '(SELECT min(Frames.Delta) FROM Frames WHERE Events.Id = Frames.EventId)' ),
'MaxFrameDelta' => array( 'sql' => '(SELECT max(Frames.Delta) FROM Frames WHERE Events.Id = Frames.EventId)' ), 'MaxFrameDelta' => array( 'sql' => '(SELECT max(Frames.Delta) FROM Frames WHERE Events.Id = Frames.EventId)' ),
), ),
), ),
'frames' => array( 'frames' => array(
'permission' => 'Events', 'permission' => 'Events',
'table' => 'Frames', 'table' => 'Frames',
'selector' => 'EventId', 'selector' => 'EventId',
'elements' => array( 'elements' => array(
'EventId' => true, 'EventId' => true,
'FrameId' => true, 'FrameId' => true,
'Type' => true, 'Type' => true,
'Delta' => true, 'Delta' => true,
), ),
), ),
'frame' => array( 'frame' => array(
'permission' => 'Events', 'permission' => 'Events',
'table' => 'Frames', 'table' => 'Frames',
'limit' => 1, 'limit' => 1,
'selector' => array( array( 'table' => 'Events', 'join' => 'Events.Id = Frames.EventId', 'selector'=>'Events.Id' ), 'Frames.FrameId' ), 'selector' => array( array( 'table' => 'Events', 'join' => 'Events.Id = Frames.EventId', 'selector'=>'Events.Id' ), 'Frames.FrameId' ),
'elements' => array( 'elements' => array(
//'Id' => array( 'sql' => 'Frames.FrameId' ), //'Id' => array( 'sql' => 'Frames.FrameId' ),
'FrameId' => true, 'FrameId' => true,
'EventId' => true, 'EventId' => true,
'Type' => true, 'Type' => true,
'TimeStamp' => true, 'TimeStamp' => true,
'TimeStampShort' => array( 'sql' => "date_format( StartTime, '".MYSQL_FMT_DATETIME_SHORT."' )" ), 'TimeStampShort' => array( 'sql' => "date_format( StartTime, '".MYSQL_FMT_DATETIME_SHORT."' )" ),
'Delta' => true, 'Delta' => true,
'Score' => true, 'Score' => true,
//'Image' => array( 'postFunc' => 'getFrameImage' ), //'Image' => array( 'postFunc' => 'getFrameImage' ),
), ),
), ),
'frameimage' => array( 'frameimage' => array(
'permission' => 'Events', 'permission' => 'Events',
'func' => 'getFrameImage()' 'func' => 'getFrameImage()'
), ),
'nearframe' => array( 'nearframe' => array(
'permission' => 'Events', 'permission' => 'Events',
'func' => 'getNearFrame()' 'func' => 'getNearFrame()'
), ),
'nearevents' => array( 'nearevents' => array(
'permission' => 'Events', 'permission' => 'Events',
'func' => 'getNearEvents()' 'func' => 'getNearEvents()'
) )
); );
function collectData() { function collectData() {
global $statusData; global $statusData;
@ -302,8 +302,8 @@ function collectData() {
} }
} }
} }
#print_r( $data ); #Logger::Debug(print_r($data, true));
return( $data ); return $data;
} }
$data = collectData(); $data = collectData();
@ -345,8 +345,8 @@ function getFrameImage() {
$eventId = $_REQUEST['id'][0]; $eventId = $_REQUEST['id'][0];
$frameId = $_REQUEST['id'][1]; $frameId = $_REQUEST['id'][1];
$sql = 'select * from Frames where EventId = ? and FrameId = ?'; $sql = 'SELECT * FROM Frames WHERE EventId = ? AND FrameId = ?';
if ( !($frame = dbFetchOne( $sql, NULL, array( $eventId, $frameId ) )) ) { if ( !($frame = dbFetchOne( $sql, NULL, array($eventId, $frameId ) )) ) {
$frame = array(); $frame = array();
$frame['EventId'] = $eventId; $frame['EventId'] = $eventId;
$frame['FrameId'] = $frameId; $frame['FrameId'] = $frameId;