function addEventToZip($eid, $mid, $zip) { $query = "SELECT Id, MonitorId, StartTime, Frames FROM Events WHERE Id={$eid}"; $results = dbFetchAll($query); $scale = max(reScale(SCALE_BASE, '100', ZM_WEB_DEFAULT_SCALE), SCALE_BASE); foreach ($results as $result) { for ($counter = 1; $counter <= $result['Frames']; $counter++) { $event['Id'] = $result['Id']; $event['StartTime'] = $result['StartTime']; $event['MonitorId'] = $result['MonitorId']; $imageData = getImageSrc($event, $counter, $scale, isset($_REQUEST['show']) && $_REQUEST['show'] == "capt"); $imagePath = $imageData['thumbPath']; $eventPath = $imageData['eventPath']; $dImagePath = sprintf("%s/%0" . ZM_EVENT_IMAGE_DIGITS . "d-diag-d.jpg", $eventPath, $counter); $rImagePath = sprintf("%s/%0" . ZM_EVENT_IMAGE_DIGITS . "d-diag-r.jpg", $eventPath, $counter); $frames[] = viewImagePath($imagePath); } $zip->addDirectory("events/" . $event['MonitorId']); $zip->addDirectory("events/" . $event['MonitorId'] . "/" . $event['Id']); } $i = 0; $filesString = ""; foreach ($frames as $frame) { $i++; $filesName = sprintf("%0" . ZM_EVENT_IMAGE_DIGITS . "d-capture.jpg", $i); $filesString .= "\nframes.push(\"events/" . $mid . "/" . $eid . "/" . $filesName . "\");"; $zip->addLargeFile($frame, "events/" . $mid . "/" . $eid . "/" . $filesName); } return $filesString; }
?> </td> <td class="colAvgScore"><?php echo $event['AvgScore']; ?> </td> <td class="colMaxScore"><?php echo makePopupLink('?view=frame&eid=' . $event['Id'] . '&fid=0', 'zmImage', array('image', reScale($event['Width'], $scale), reScale($event['Height'], $scale)), $event['MaxScore']); ?> </td> <?php if (ZM_WEB_LIST_THUMBS) { if ($thumbData = createListThumbnail($event)) { ?> <td class="colThumbnail"><?php echo makePopupLink('?view=frame&eid=' . $event['Id'] . '&fid=' . $thumbData['FrameId'], 'zmImage', array('image', reScale($event['Width'], $scale), reScale($event['Height'], $scale)), '<img src="' . viewImagePath($thumbData['Path']) . '" width="' . $thumbData['Width'] . '" height="' . $thumbData['Height'] . '" alt="' . $thumbData['FrameId'] . '/' . $event['MaxScore'] . '"/>'); ?> </td> <?php } else { ?> <td class="colThumbnail"> </td> <?php } } ?> <td class="colMark"><input type="checkbox" name="markEids[]" value="<?php echo $event['Id']; ?> " onclick="configureButton( this, 'markEids' );"<?php if (!canEdit('Events')) {
echo reScale($event['Height'], $event['DefaultScale'], $scale); ?> " class="<?php echo $imageData['imageClass']; ?> "/></p> <?php } if (file_exists($rImagePath)) { ?> <p id="refImagePath"><?php echo $rImagePath; ?> </p> <p id="refImage"><img src="<?php echo viewImagePath($rImagePath); ?> " width="<?php echo reScale($event['Width'], $event['DefaultScale'], $scale); ?> " height="<?php echo reScale($event['Height'], $event['DefaultScale'], $scale); ?> " class="<?php echo $imageData['imageClass']; ?> "/></p> <?php } ?> </div>
<div id="eventImages"> <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> </div> <div id="contenButtons"> <a href="?view=event&eid=<?php echo $_REQUEST['eid']; ?> &page=1"><?php echo translate('Frames'); ?> </a> <a href="?view=video&eid=<?php
?> "; var skinPath = "<?php echo ZM_SKIN_PATH; ?> "; var canEditSystem = <?php echo canEdit('System') ? 'true' : 'false'; ?> ; var canViewSystem = <?php echo canView('System') ? 'true' : 'false'; ?> ; var refreshParent = <?php echo !empty($refreshParent) ? 'true' : 'false'; ?> ; var focusWindow = <?php echo !empty($focusWindow) ? 'true' : 'false'; ?> ; var imagePrefix = "<?php echo viewImagePath("", '&'); ?> ";
?> </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 } ?> </div> <div id="contentButtons"><a href="?view=console"><?php echo translate('Console'); ?> </a></div> </div> </div>
<?php } ?> <div id="eventFrames"> <?php foreach ($frames as $frame) { $imageData = getImageSrc($event, $frame, $scale); ?> <a href="?view=frame&eid=<?php echo $_REQUEST['eid']; ?> &fid=<?php echo $frame['FrameId']; ?> "><img src="<?php echo viewImagePath($imageData['thumbPath']); ?> " class="<?php echo $imageData['imageClass']; ?> " alt="<?php echo $frame['Type']; ?> /<?php echo $frame['Type'] == 'Alarm' ? $frame['Score'] : 0; ?> "/></a> <?php } ?> </div>
echo $offset + $events_per_page; ?> </p></div> <?php while ($event = mysql_fetch_array($result)) { $thumbData = createListThumbnail($event); ?> <div class="thumb" id="<?php echo $event['Id']; ?> "> <a class="event" href="?view=event&eid=<?php echo $event['Id']; ?> "><img src="<?php echo viewImagePath($thumbData['Path']); ?> " alt="<?php echo $event['Id']; ?> Thumbnail" width="<?php echo $thumb_width; ?> " /></a> <p>Date: <?php echo $event['Date']; ?> </p> <p>Time: <?php echo $event['Time']; ?>
<?php $query = "SELECT Id, MonitorId, StartTime, Frames FROM Events WHERE Id={$_REQUEST['eid']}"; $results = dbFetchAll($query); $scale = max(reScale(SCALE_BASE, '100', ZM_WEB_DEFAULT_SCALE), SCALE_BASE); foreach ($results as $result) { for ($counter = 1; $counter <= $result['Frames']; $counter++) { $event['Id'] = $result['Id']; $event['StartTime'] = $result['StartTime']; $event['MonitorId'] = $result['MonitorId']; $imageData = getImageSrc($event, $counter, $scale, isset($_REQUEST['show']) && $_REQUEST['show'] == "capt"); $imagePath = $imageData['thumbPath']; $eventPath = $imageData['eventPath']; $dImagePath = sprintf("%s/%0" . ZM_EVENT_IMAGE_DIGITS . "d-diag-d.jpg", $eventPath, $counter); $rImagePath = sprintf("%s/%0" . ZM_EVENT_IMAGE_DIGITS . "d-diag-r.jpg", $eventPath, $counter); $frames[] = viewImagePath($imagePath); } } echo "var unprocessed = '" . implode(',', $frames) . "';"; echo "var frames = unprocessed.split(',');"; ?> function displayFrame(src) { jQuery("img").attr('src', src); } function playbackFrames(imgarray) { var x = 0; setInterval(function() { if(x < frames.length) { displayFrame(imgarray[x]);