zoneminder/web/skins/mobile/views/frame.php

74 lines
3.1 KiB
PHP
Raw Normal View History

<?php
//
// ZoneMinder web frame view file, $Date$, $Revision$
// Copyright (C) 2001-2008 Philip Coombes
//
// 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' ) )
{
$_REQUEST['view'] = "error";
return;
}
2014-04-30 22:01:10 +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( $_REQUEST['eid'] ) );
if ( !empty($_REQUEST['fid']) )
{
2014-04-30 22:01:10 +08:00
$frame = dbFetchOne( 'SELECT * FROM Frames WHERE EventID = ? AND FrameId = ?', NULL, array( $_REQUEST['eid'], $_REQUEST['fid'] ) );
}
else
{
2014-04-30 22:01:10 +08:00
$frame = dbFetchOne( 'SELECT * FROM Frames WHERE EventID = ? AND Score = ?', NULL, array( $_REQUEST['eid'], $event['MaxScore'] ) );
}
$maxFid = $event['Frames'];
$firstFid = 1;
$prevFid = $frame['FrameId']-1;
$nextFid = $frame['FrameId']+1;
$lastFid = $maxFid;
$scale = getDeviceScale( $event['Width'], $event['Height'], 1.1 );
$imageData = getImageSrc( $event, $frame, $scale, (isset($_REQUEST['show'])&&$_REQUEST['show']=="capt") );
2015-05-10 21:10:30 +08:00
xhtmlHeaders( __FILE__, translate('Frame').' - '.$_REQUEST['eid'].'-'.$frame['FrameId'] );
?>
<body>
<div id="page">
<div id="header">
2015-05-10 21:10:30 +08:00
<h2><?php echo translate('Frame') ?> <?php echo $_REQUEST['eid']."-".$frame['FrameId']." (".$frame['Score'].")" ?></h2>
</div>
<div id="content">
<?php if ( $imageData['hasAnalImage'] ) { ?><a href="?view=frame&amp;eid=<?php echo $_REQUEST['eid'] ?>&amp;fid=<?php echo $frame['FrameId'] ?>&amp;show=<?php echo $imageData['isAnalImage']?"capt":"anal" ?>"><?php } ?><img src="<?php echo viewImagePath( $imageData['thumbPath'] ) ?>" class="<?php echo $imageData['imageClass'] ?>"/><?php if ( $imageData['hasAnalImage'] ) { ?></a><?php } ?>
<div id="contentButtons">
<?php if ( $frame['FrameId'] > 1 ) { ?>
<a href="?view=frame&amp;eid=<?php echo $_REQUEST['eid'] ?>&amp;fid=<?php echo $firstFid ?>">&lt;&lt;</a>
<?php } if ( $frame['FrameId'] > 1 ) { ?>
<a href="?view=frame&amp;eid=<?php echo $_REQUEST['eid'] ?>&amp;fid=<?php echo $prevFid ?>">&lt;</a>
<?php } if ( $frame['FrameId'] < $maxFid ) { ?>
<a href="?view=frame&amp;eid=<?php echo $_REQUEST['eid'] ?>&amp;fid=<?php echo $nextFid ?>">&gt;</a>
<?php } if ( $frame['FrameId'] < $maxFid ) { ?>
<a href="?view=frame&amp;eid=<?php echo $_REQUEST['eid'] ?>&amp;fid=<?php echo $lastFid ?>">&gt;&gt;</a>
<?php } ?>
</div>
</div>
</div>
</body>
</html>