2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
|
|
|
//
|
|
|
|
// ZoneMinder web frame view file, $Date$, $Revision$
|
2008-07-25 17:48:16 +08:00
|
|
|
// Copyright (C) 2001-2008 Philip Coombes
|
2008-07-14 21:54:50 +08:00
|
|
|
//
|
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU General Public License
|
|
|
|
// as published by the Free Software Foundation; either version 2
|
|
|
|
// of the License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with this program; if not, write to the Free Software
|
|
|
|
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
//
|
|
|
|
|
|
|
|
if ( !canView( 'Events' ) )
|
|
|
|
{
|
2008-09-26 17:47:20 +08:00
|
|
|
$view = "error";
|
2008-07-14 21:54:50 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2008-09-26 17:47:20 +08:00
|
|
|
$eid = validInt($_REQUEST['eid']);
|
2008-07-14 21:54:50 +08:00
|
|
|
if ( !empty($_REQUEST['fid']) )
|
2008-09-26 17:47:20 +08:00
|
|
|
$fid = validInt($_REQUEST['fid']);
|
|
|
|
|
2013-12-18 01:53:15 +08:00
|
|
|
$sql = 'SELECT E.*,M.Name AS MonitorName,M.DefaultScale FROM Events AS E INNER JOIN Monitors AS M ON E.MonitorId = M.Id WHERE E.Id = ?';
|
|
|
|
$event = dbFetchOne( $sql, NULL, array( $eid ) );
|
2008-09-26 17:47:20 +08:00
|
|
|
|
|
|
|
if ( !empty($fid) )
|
2008-07-14 21:54:50 +08:00
|
|
|
{
|
2013-12-18 01:53:15 +08:00
|
|
|
$sql = 'SELECT * FROM Frames WHERE EventId = ? AND FrameId = ?';
|
|
|
|
if ( !($frame = dbFetchOne( $sql, NULL, array( $eid, $fid ) )) )
|
2008-09-26 17:47:20 +08:00
|
|
|
$frame = array( 'FrameId'=>$fid, 'Type'=>'Normal', 'Score'=>0 );
|
2008-07-14 21:54:50 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-12-18 01:53:15 +08:00
|
|
|
$frame = dbFetchOne( 'SELECT * FROM Frames WHERE EventId = ? AND Score = ?', null, array( $eid, $event['MaxScore'] ) );
|
2008-07-14 21:54:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
$maxFid = $event['Frames'];
|
|
|
|
|
|
|
|
$firstFid = 1;
|
|
|
|
$prevFid = $frame['FrameId']-1;
|
|
|
|
$nextFid = $frame['FrameId']+1;
|
|
|
|
$lastFid = $maxFid;
|
|
|
|
|
|
|
|
$alarmFrame = $frame['Type']=='Alarm';
|
|
|
|
|
2008-09-26 17:47:20 +08:00
|
|
|
if ( isset( $_REQUEST['scale'] ) )
|
|
|
|
$scale = validInt($_REQUEST['scale']);
|
|
|
|
else
|
|
|
|
$scale = max( reScale( SCALE_BASE, $event['DefaultScale'], ZM_WEB_DEFAULT_SCALE ), SCALE_BASE );
|
2008-07-14 21:54:50 +08:00
|
|
|
|
2008-09-26 17:47:20 +08:00
|
|
|
$imageData = getImageSrc( $event, $frame, $scale, (isset($_REQUEST['show']) && $_REQUEST['show']=="capt") );
|
2008-07-14 21:54:50 +08:00
|
|
|
|
|
|
|
$imagePath = $imageData['thumbPath'];
|
|
|
|
$eventPath = $imageData['eventPath'];
|
|
|
|
$dImagePath = sprintf( "%s/%0".ZM_EVENT_IMAGE_DIGITS."d-diag-d.jpg", $eventPath, $frame['FrameId'] );
|
|
|
|
$rImagePath = sprintf( "%s/%0".ZM_EVENT_IMAGE_DIGITS."d-diag-r.jpg", $eventPath, $frame['FrameId'] );
|
|
|
|
|
|
|
|
$focusWindow = true;
|
|
|
|
|
|
|
|
xhtmlHeaders(__FILE__, $SLANG['Frame']." - ".$event['Id']." - ".$frame['FrameId'] );
|
|
|
|
?>
|
|
|
|
<body>
|
|
|
|
<div id="page">
|
|
|
|
<div id="header">
|
|
|
|
<div id="headerButtons">
|
2009-10-17 01:09:16 +08:00
|
|
|
<?php if ( ZM_RECORD_EVENT_STATS && $alarmFrame ) { echo makePopupLink( '?view=stats&eid='.$event['Id'].'&fid='.$frame['FrameId'], 'zmStats', 'stats', $SLANG['Stats'] ); } ?>
|
|
|
|
<?php if ( canEdit( 'Events' ) ) { ?><a href="?view=none&action=delete&markEid=<?= $event['Id'] ?>"><?= $SLANG['Delete'] ?></a><?php } ?>
|
2008-07-14 21:54:50 +08:00
|
|
|
<a href="#" onclick="closeWindow(); return( false );"><?= $SLANG['Close'] ?></a>
|
|
|
|
</div>
|
|
|
|
<h2><?= $SLANG['Frame'] ?> <?= $event['Id']."-".$frame['FrameId']." (".$frame['Score'].")" ?></h2>
|
|
|
|
</div>
|
|
|
|
<div id="content">
|
2010-02-23 17:12:12 +08:00
|
|
|
<p id="image"><?php if ( $imageData['hasAnalImage'] ) { ?><a href="?view=frame&eid=<?= $event['Id'] ?>&fid=<?= $frame['FrameId'] ?>&scale=<?= $scale ?>&show=<?= $imageData['isAnalImage']?"capt":"anal" ?>"><?php } ?><img src="<?= viewImagePath( $imagePath ) ?>" width="<?= reScale( $event['Width'], $event['DefaultScale'], $scale ) ?>" height="<?= reScale( $event['Height'], $event['DefaultScale'], $scale ) ?>" alt="<?= $frame['EventId']."-".$frame['FrameId'] ?>" class="<?= $imageData['imageClass'] ?>"/><?php if ( $imageData['hasAnalImage'] ) { ?></a><?php } ?></p>
|
2008-07-14 21:54:50 +08:00
|
|
|
<p id="controls">
|
|
|
|
<?php if ( $frame['FrameId'] > 1 ) { ?>
|
2009-10-17 01:09:16 +08:00
|
|
|
<a id="firstLink" href="?view=frame&eid=<?= $event['Id'] ?>&fid=<?= $firstFid ?>&scale=<?= $scale ?>"><?= $SLANG['First'] ?></a>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php } if ( $frame['FrameId'] > 1 ) { ?>
|
2009-10-17 01:09:16 +08:00
|
|
|
<a id="prevLink" href="?view=frame&eid=<?= $event['Id'] ?>&fid=<?= $prevFid ?>&scale=<?= $scale ?>"><?= $SLANG['Prev'] ?></a>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php } if ( $frame['FrameId'] < $maxFid ) { ?>
|
2009-10-17 01:09:16 +08:00
|
|
|
<a id="nextLink" href="?view=frame&eid=<?= $event['Id'] ?>&fid=<?= $nextFid ?>&scale=<?= $scale ?>"><?= $SLANG['Next'] ?></a>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php } if ( $frame['FrameId'] < $maxFid ) { ?>
|
2009-10-17 01:09:16 +08:00
|
|
|
<a id="lastLink" href="?view=frame&eid=<?= $event['Id'] ?>&fid=<?= $lastFid ?>&scale=<?= $scale ?>"><?= $SLANG['Last'] ?></a>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php } ?>
|
|
|
|
</p>
|
|
|
|
<?php if (file_exists ($dImagePath)) { ?>
|
|
|
|
<p id="diagImagePath"><?= $dImagePath ?></p>
|
2010-02-23 17:12:12 +08:00
|
|
|
<p id="diagImage"><img src=?"<?= viewImagePath( $dImagePath ) ?>" width="<?= reScale( $event['Width'], $event['DefaultScale'], $scale ) ?>" height="<?= reScale( $event['Height'], $event['DefaultScale'], $scale ) ?>" class="<?= $imageData['imageClass'] ?>"/></p>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php } if (file_exists ($rImagePath)) { ?>
|
|
|
|
<p id="refImagePath"><?= $rImagePath ?></p>
|
2010-02-23 17:12:12 +08:00
|
|
|
<p id="refImage"><img src="<?= viewImagePath( $rImagePath ) ?>" width="<?= reScale( $event['Width'], $event['DefaultScale'], $scale ) ?>" height="<?= reScale( $event['Height'], $event['DefaultScale'], $scale ) ?>" class="<?= $imageData['imageClass'] ?>"/></p>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php } ?>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</body>
|
|
|
|
</html>
|