$limit ) { $nEvents = $limit; } $pages = (int)ceil($nEvents/ZM_WEB_EVENTS_PER_PAGE); #Logger::Debug("Page $page Limit $limit #vents: $nEvents pages: $pages "); if ( !empty($page) ) { if ( $page < 0 ) $page = 1; else if ( $pages and ( $page > $pages ) ) $page = $pages; $limitStart = (($page-1)*ZM_WEB_EVENTS_PER_PAGE); if ( empty( $limit ) ) { $limitAmount = ZM_WEB_EVENTS_PER_PAGE; } else { $limitLeft = $limit - $limitStart; $limitAmount = ($limitLeft>ZM_WEB_EVENTS_PER_PAGE)?ZM_WEB_EVENTS_PER_PAGE:$limitLeft; } $eventsSql .= " limit $limitStart, $limitAmount"; } elseif ( !empty($limit) ) { $eventsSql .= ' limit 0, '.$limit; } $maxShortcuts = 5; $pagination = getPagination($pages, $page, $maxShortcuts, $filterQuery.$sortQuery.$limitQuery); $focusWindow = true; if ( $_POST ) { // I think this is basically so that a refresh doesn't repost ZM\Logger::Debug('Redirecting to ' . $_SERVER['REQUEST_URI']); header('Location: ?view=' . $view.htmlspecialchars_decode($filterQuery).htmlspecialchars_decode($sortQuery).$limitQuery.'&page='.$page); exit(); } $storage_areas = ZM\Storage::find(); $StorageById = array(); foreach ( $storage_areas as $S ) { $StorageById[$S->Id()] = $S; } xhtmlHeaders(__FILE__, translate('Events') ); ?>
1 ) { ?> DefaultScale(), ZM_WEB_DEFAULT_SCALE ), SCALE_BASE ); ?> Archived()) echo ' class="archived"' ?>> 1 ) { ?> DiskSpace(); ?> '; $imgSrc = $event->getThumbnailSrc(array(),'&'); $streamSrc = $event->getStreamSrc(array( 'mode'=>'jpeg', 'scale'=>$scale, 'maxfps'=>ZM_WEB_VIDEO_MAXFPS, 'replay'=>'single', 'rate'=>'400'), '&'); $imgHtml = ''. validHtmlStr('Event '.$event->Id()) .''; echo ''.$imgHtml.''; echo ''; } // end if ZM_WEB_LIST_THUMBS ?> 1 ) { ?>
'.$event->Id().($event->Archived()?'*':'') ?> '.validHtmlStr($event->Name()).($event->Archived()?'*':'') ?>
Emailed() ) echo 'Emailed '; ?>
MonitorId(), 'zmMonitor'.$event->MonitorId(), 'monitor', $event->MonitorName(), canEdit( 'Monitors' ) ) ?> Id(), 'zmEventDetail', 'eventdetail', validHtmlStr($event->Cause()), canEdit( 'Events' ), 'title="'.htmlspecialchars($event->Notes()).'"' ) ?> Notes() ) { # if notes include detection objects, then link it to objdetect.jpg if ( strpos($event->Notes(), 'detected:') !== false ) { # make a link echo makePopupLink( '?view=image&eid='.$event->Id().'&fid=objdetect', 'zmImage', array('image', reScale($event->Width(), $scale), reScale($event->Height(), $scale)), '
'.$event->Notes().'
'); } else if ( $event->Notes() != 'Forced Web: ' ) { echo '
'.$event->Notes().'
'; } } ?>
StartTime())) . ( $event->EndTime() ? ' until ' . strftime(STRF_FMT_DATETIME_SHORTER, strtotime($event->EndTime()) ) : '' ) ?> Length() ) ?> Id(), 'zmFrames', ( ZM_WEB_LIST_THUMBS ? array('frames', ZM_WEB_LIST_THUMB_WIDTH, ZM_WEB_LIST_THUMB_HEIGHT) : 'frames'), $event->Frames() ) ?> Id(), 'zmFrames', ( ZM_WEB_LIST_THUMBS ? array('frames', ZM_WEB_LIST_THUMB_WIDTH, ZM_WEB_LIST_THUMB_HEIGHT) : 'frames'), $event->AlarmFrames() ) ?> TotScore() ?> AvgScore() ?> Id().'&fid=0', 'zmImage', array('image', reScale($event->Width(), $scale), reScale($event->Height(), $scale)), $event->MaxScore() ); ?> StorageId() ) { echo isset($StorageById[$event->StorageId()]) ? $StorageById[$event->StorageId()]->Name() : 'Unknown Storage Id: '.$event->StorageId(); } else { echo 'Default'; } if ( $event->SecondaryStorageId() ) { echo '
'.(isset($StorageById[$event->SecondaryStorageId()]) ? $StorageById[$event->SecondaryStorageId()]->Name() : 'Unknown Storage Id '.$event->SecondaryStorageId()); } ?>
DiskSpace()) ?>
Totals: