2004-12-29 02:20:11 +08:00
< ? php
//
// ZoneMinder web frame view file, $Date$, $Revision$
2006-01-17 19:32:47 +08:00
// Copyright (C) 2003, 2004, 2005, 2006 Philip Coombes
2004-12-29 02:20:11 +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' ) )
{
$view = " error " ;
return ;
}
2005-11-22 18:37:17 +08:00
$sql = " select E.*,M.Name as MonitorName,M.Width,M.Height,M.DefaultScale from Events as E inner join Monitors as M on E.MonitorId = M.Id where E.Id = ' $eid ' " ;
2007-09-06 20:59:19 +08:00
$event = dbFetchOne ( $sql );
2004-12-29 02:20:11 +08:00
if ( $fid )
{
2007-09-06 20:59:19 +08:00
$frame = dbFetchOne ( " select * from Frames where EventID = ' $eid ' and FrameId = ' $fid ' " );
2004-12-29 02:20:11 +08:00
}
else
{
2007-09-06 20:59:19 +08:00
$frame = dbFetchOne ( " select * from Frames where EventID = ' $eid ' and Score = ' " . $event [ 'MaxScore' ] . " ' " );
2004-12-29 02:20:11 +08:00
$fid = $frame [ 'FrameId' ];
}
$max_fid = $event [ 'Frames' ];
$first_fid = 1 ;
$prev_fid = $fid - 1 ;
$next_fid = $fid + 1 ;
$last_fid = $max_fid ;
2006-11-09 19:48:56 +08:00
$scale = getDeviceScale ( $event [ 'Width' ], $event [ 'Height' ] );
2004-12-29 02:20:11 +08:00
2006-01-18 01:07:13 +08:00
$image_data = getImageSrc ( $event , $frame , $scale , ( isset ( $show ) && $show == " capt " ) );
2004-12-29 02:20:11 +08:00
2006-01-18 01:07:13 +08:00
$image_path = $image_data [ 'thumbPath' ];
$event_path = $image_data [ 'eventPath' ];
2004-12-29 02:20:11 +08:00
?>
2006-11-09 01:53:57 +08:00
< html xmlns = " http://www.w3.org/1999/xhtml " >
2004-12-29 02:20:11 +08:00
< head >
2005-05-06 20:24:57 +08:00
< title >< ? = ZM_WEB_TITLE_PREFIX ?> - <?= $zmSlangFrame ?> <?= $eid."-".$fid ?></title>
2006-03-24 02:11:53 +08:00
< link rel = " stylesheet " href = " zm_xhtml_styles.css " type = " text/css " />
2004-12-29 02:20:11 +08:00
</ head >
< body >
< table >
< tr >
2006-11-09 01:53:57 +08:00
< td class = " head " >< ? = $zmSlangFrame ?> <?= $eid."-".$fid." (".$frame['Score'].")" ?></td>
2004-12-29 02:20:11 +08:00
</ tr >
</ table >
< table >
2006-11-09 01:53:57 +08:00
< tr >< td >< ? php if ( $has_anal_image ) { ?> <a href="<?= $PHP_SELF ?>?view=frame&eid=<?= $eid ?>&fid=<?= $fid ?>&show=<?= $image_path==$anal_image?"capt":"anal" ?>"><?php } ?><img src="<?= $thumb_image_path ?>" width="<?= reScale( $event['Width'], $scale ) ?>" height="<?= reScale( $event['Height'], $scale ) ?>" class="<?= $img_class ?>"/><?php if ( $has_anal_image ) { ?></a><?php } ?></td></tr>
< tr >< td >< ? php if ( $image_data [ 'hasAnalImage' ] ) { ?> <a href="<?= $PHP_SELF ?>?view=frame&eid=<?= $eid ?>&fid=<?= $fid ?>&show=<?= $image_data['isAnalImage']?"capt":"anal" ?>"><?php } ?><img src="<?= $image_path ?>" width="<?= reScale( $event['Width'], $scale ) ?>" height="<?= reScale( $event['Height'], $scale ) ?>" class="<?= $image_data['imageClass'] ?>"/><?php if ( $image_data['hasAnalImage'] ) { ?></a><?php } ?></td></tr>
2004-12-29 02:20:11 +08:00
</ table >
< table >
< tr >
< ? php if ( $fid > 1 ) { ?>
2006-11-09 01:53:57 +08:00
< td align = " center " >< a href = " <?= $PHP_SELF ?>?view=frame&eid=<?= $eid ?>&fid=<?= $first_fid ?> " >& lt ; & lt ; </ a ></ td >
2004-12-29 02:20:11 +08:00
< ? php } else { ?>
2006-11-09 01:53:57 +08:00
< td align = " center " >& nbsp ; </ td >
2004-12-29 02:20:11 +08:00
< ? php } if ( $fid > 1 ) { ?>
2006-11-09 01:53:57 +08:00
< td align = " center " >< a href = " <?= $PHP_SELF ?>?view=frame&eid=<?= $eid ?>&fid=<?= $prev_fid ?> " >& lt ; </ a ></ td >
2004-12-29 02:20:11 +08:00
< ? php } else { ?>
2006-11-09 01:53:57 +08:00
< td align = " center " >& nbsp ; </ td >
2004-12-29 02:20:11 +08:00
< ? php } if ( $fid < $max_fid ) { ?>
2006-11-09 01:53:57 +08:00
< td align = " center " >< a href = " <?= $PHP_SELF ?>?view=frame&eid=<?= $eid ?>&fid=<?= $next_fid ?> " >& gt ; </ a ></ td >
2004-12-29 02:20:11 +08:00
< ? php } else { ?>
2006-11-09 01:53:57 +08:00
< td align = " center " >& nbsp ; </ td >
2004-12-29 02:20:11 +08:00
< ? php } if ( $fid < $max_fid ) { ?>
2006-11-09 01:53:57 +08:00
< td align = " center " >< a href = " <?= $PHP_SELF ?>?view=frame&eid=<?= $eid ?>&fid=<?= $last_fid ?> " >& gt ; & gt ; </ a ></ td >
2004-12-29 02:20:11 +08:00
< ? php } else { ?>
2006-11-09 01:53:57 +08:00
< td align = " center " >& nbsp ; </ td >
2004-12-29 02:20:11 +08:00
< ? php } ?>
</ tr >
</ table >
</ body >
</ html >