// 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; } $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'])); $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); } xhtmlHeaders(__FILE__, translate('Event') . ' - ' . $_REQUEST['eid']); ?> <body> <div id="page"> <div id="content"> <table id="contentTable" class="major"> <tr> <th scope="row"><?php echo translate('Name');
} if ($maxWidth < $row['Width']) { $maxWidth = $row['Width']; } if ($maxHeight < $row['Height']) { $maxHeight = $row['Height']; } $monitors[] = $row; } //$monitor = $monitors[$monIdx]; $nextMid = $monIdx == count($monitors) - 1 ? $monitors[0]['Id'] : $monitors[$monIdx + 1]['Id']; $prevMid = $monIdx == 0 ? $monitors[count($monitors) - 1]['Id'] : $monitors[$monIdx - 1]['Id']; if (isset($_REQUEST['scale'])) { $scale = validInt($_REQUEST['scale']); } else { $scale = getDeviceScale($monitor['Width'], $monitor['Height']); } $imageSrc = getStreamSrc(array("mode=single", "monitor=" . $monitor['Id'], "scale=" . $scale), '&'); if (ZM_WEB_STREAM_METHOD == 'mpeg' && ZM_MPEG_LIVE_FORMAT) { $streamMode = "mpeg"; $streamSrc = getStreamSrc(array("mode=" . $streamMode, "monitor=" . $monitor['Id'], "scale=" . $scale, "bitrate=" . ZM_WEB_VIDEO_BITRATE, "maxfps=" . ZM_WEB_VIDEO_MAXFPS, "format=" . ZM_MPEG_LIVE_FORMAT)); } elseif (canStream()) { $streamMode = "jpeg"; $streamSrc = getStreamSrc(array("mode=" . $streamMode, "monitor=" . $monitor['Id'], "scale=" . $scale, "maxfps=" . ZM_WEB_VIDEO_MAXFPS)); } else { $streamMode = "single"; $streamSrc = getStreamSrc(array("mode=" . $streamMode, "monitor=" . $monitor['Id'], "scale=" . $scale)); } xhtmlHeaders(__FILE__, $monitor['Name'] . ' - ' . translate('Watch')); ?> <body>
<div id="header"> <div id="headerButtons"> <a href="?view=<?php echo $_REQUEST['view']; ?> "><?php echo translate('Refresh'); ?> </a> </div> </div> <div id="content"> <div id="monitorImages"> <?php foreach ($monitors as $monitor) { $scale = getDeviceScale($monitor['Width'], $monitor['Height'], $imagesPerLine * 1.1); $imagePath = getStreamSrc(array("mode=single", "monitor=" . $monitor['Id'], "scale=" . $scale), '&'); ?> <a href="?view=watch&mid=<?php echo $monitor['Id']; ?> "><img src="<?php echo viewImagePath($imagePath); ?> " alt="<?php echo $monitor['Name']; ?> "/></a> <?php } ?>
$maxShortcuts = 3; $paged = $event['Frames'] > $framesPerPage; if ($paged && !empty($_REQUEST['page'])) { $loFrameId = ($_REQUEST['page'] - 1) * $framesPerPage + 1; $hiFrameId = min($_REQUEST['page'] * $framesPerPage, $event['Frames']); } else { $loFrameId = 1; $hiFrameId = $event['Frames']; } $sql = 'SELECT * FROM Frames WHERE EventID = ?'; if ($paged && !empty($_REQUEST['page'])) { $sql .= " and FrameId between {$loFrameId} and {$hiFrameId}"; } $sql .= " order by FrameId"; $frames = dbFetchAll($sql, NULL, array($_REQUEST['eid'])); $scale = getDeviceScale($event['Width'], $event['Height'], $framesPerLine + 0.3); $pages = (int) ceil($event['Frames'] / $framesPerPage); if (!empty($_REQUEST['fid'])) { $_REQUEST['page'] = $_REQUEST['fid'] / $framesPerPage + 1; } $pagination = getPagination($pages, $_REQUEST['page'], $maxShortcuts, '&eid=' . $_REQUEST['eid'] . $filterQuery . $sortQuery, '&'); xhtmlHeaders(__FILE__, translate('Event') . ' - ' . $event['Name']); ?> <body> <div id="page"> <div id="header"> <?php if (canEdit('Events')) { ?> <div id="headerButtons"> <a href="?view=events&action=delete&mark_eid=<?php