2008-07-14 21:54:50 +08:00
< ? php
//
// ZoneMinder web event details 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' ) )
{
$_REQUEST [ 'view' ] = " error " ;
return ;
}
2014-04-30 22:01:10 +08:00
$event = dbFetchOne ( 'select E.*,M.Name as MonitorName from Events as E, Monitors as M where E.Id = ? and E.MonitorId = M.Id' , NULL , array ( $_REQUEST [ 'eid' ]) );
$frame = dbFetchOne ( 'select * from Frames where EventID = ? and Score = ?' , NULL , array ( $_REQUEST [ 'eid' ], $event [ 'MaxScore' ]) );
2008-07-14 21:54:50 +08:00
$scale = getDeviceScale ( $event [ 'Width' ], $event [ 'Height' ], 2.2 );
$image1 = getImageSrc ( $event , 1 , $scale );
if ( $frame [ 'Type' ] == 'Alarm' )
$image2 = getImageSrc ( $event , $frame [ 'FrameId' ], $scale );
else
$image2 = getImageSrc ( $event , intval ( $event [ 'Frames' ] / 2 ), $scale );
2015-05-10 21:10:30 +08:00
xhtmlHeaders ( __FILE__ , translate ( 'Event' ) . ' - ' . $_REQUEST [ 'eid' ] );
2008-07-14 21:54:50 +08:00
?>
< body >
< div id = " page " >
< div id = " content " >
< table id = " contentTable " class = " major " >
< tr >
2015-05-10 21:10:30 +08:00
< th scope = " row " >< ? php echo translate ( 'Name' ) ?> </th>
< td >< ? php echo htmlentities ( $event [ 'Name' ]) ?> <?php echo $event['Archived']?("(".translate('Archived').")"):"" ?></td>
2008-07-14 21:54:50 +08:00
</ tr >
< tr >
2015-05-10 21:10:30 +08:00
< th scope = " row " >< ? php echo translate ( 'Time' ) ?> </th>
2014-12-05 07:44:23 +08:00
< td >< ? php echo htmlentities ( strftime ( " %b %d, %H:%M " , strtotime ( $event [ 'StartTime' ]))) ?> </td>
2008-07-14 21:54:50 +08:00
</ tr >
< tr >
2015-05-10 21:10:30 +08:00
< th scope = " row " >< ? php echo translate ( 'Duration' ) ?> </th>
2014-12-05 07:44:23 +08:00
< td >< ? php echo htmlentities ( $event [ 'Length' ]) ?> s</td>
2008-07-14 21:54:50 +08:00
</ tr >
< tr >
2015-05-10 21:10:30 +08:00
< th scope = " row " >< ? php echo translate ( 'Cause' ) ?> </th>
2014-12-05 07:44:23 +08:00
< td >< ? php echo htmlentities ( $event [ 'Cause' ]) ?> </td>
2008-07-14 21:54:50 +08:00
</ tr >
< ? php if ( ! empty ( $event [ 'Notes' ]) ) { ?>
< tr >
2015-05-10 21:10:30 +08:00
< th scope = " row " >< ? php echo translate ( 'Notes' ) ?> </th>
2014-12-05 07:44:23 +08:00
< td >< ? php echo htmlentities ( $event [ 'Notes' ]) ?> </td>
2008-07-14 21:54:50 +08:00
</ tr >
< ? php } ?>
< tr >
2015-05-10 21:10:30 +08:00
< th scope = " row " >< ? php echo translate ( 'Frames' ) ?> </th>
2014-12-05 07:44:23 +08:00
< td >< ? php echo $event [ 'Frames' ] ?> (<?php echo $event['AlarmFrames'] ?>)</td>
2008-07-14 21:54:50 +08:00
</ tr >
< tr >
2015-05-10 21:10:30 +08:00
< th scope = " row " >< ? php echo translate ( 'Score' ) ?> </th>
2014-12-05 07:44:23 +08:00
< td >< ? php echo $event [ 'TotScore' ] ?> /<?php echo $event['AvgScore'] ?>/<?php echo $event['MaxScore'] ?></td>
2008-07-14 21:54:50 +08:00
</ tr >
</ table >
< div id = " eventImages " >
2014-12-05 07:44:23 +08:00
< a href = " ?view=frame&eid=<?php echo $_REQUEST['eid'] ?>&fid=1 " >< img src = " <?php echo viewImagePath( $image1['thumbPath'] ) ?> " alt = " 1 " /></ a >
< a href = " ?view=frame&eid=<?php echo $_REQUEST['eid'] ?>&fid=<?php echo $frame['FrameId'] ?> " >< img src = " <?php echo viewImagePath( $image2['thumbPath'] ) ?> " alt = " <?php echo $frame['FrameId'] ?> " /></ a >
2008-07-14 21:54:50 +08:00
</ div >
< div id = " contenButtons " >
2015-05-10 21:10:30 +08:00
< a href = " ?view=event&eid=<?php echo $_REQUEST['eid'] ?>&page=1 " >< ? php echo translate ( 'Frames' ) ?> </a>
< a href = " ?view=video&eid=<?php echo $_REQUEST['eid'] ?> " >< ? php echo translate ( 'Video' ) ?> </a>
2008-07-14 21:54:50 +08:00
</ div >
</ div >
</ div >
</ body >
</ html >