Monitor(); $countSql = 'SELECT COUNT(*) AS FrameCount FROM Frames AS F WHERE 1 '; $frameSql = 'SELECT *, unix_timestamp( TimeStamp ) AS UnixTimeStamp FROM Frames AS F WHERE 1 '; // override the sort_field handling in parseSort for frames if ( empty($_REQUEST['sort_field']) ) $_REQUEST['sort_field'] = 'FramesTimeStamp'; if ( !isset($_REQUEST['sort_asc']) ) $_REQUEST['sort_asc'] = true; if ( ! isset($_REQUEST['filter'])){ // generate a dummy filter from the eid for pagination $_REQUEST['filter'] = array('Query' => array( 'terms' => array( ) ) ); $_REQUEST['filter'] = addFilterTerm( $_REQUEST['filter'], 0, array( 'cnj' => 'and', 'attr' => 'FramesEventId', 'op' => '=', 'val' => $eid ) ); } parseSort(); parseFilter($_REQUEST['filter']); $filterQuery = $_REQUEST['filter']['query']; if ( $_REQUEST['filter']['sql'] ) { $countSql .= $_REQUEST['filter']['sql']; $frameSql .= $_REQUEST['filter']['sql']; } $frameSql .= " ORDER BY $sortColumn $sortOrder,Id $sortOrder"; if ( isset( $_REQUEST['scale'] ) ) { $scale = validNum($_REQUEST['scale']); } else if ( isset( $_COOKIE['zmWatchScale'.$Monitor->Id()] ) ) { $scale = validNum($_COOKIE['zmWatchScale'.$Monitor->Id()]); } else if ( isset( $_COOKIE['zmWatchScale'] ) ) { $scale = validNum($_COOKIE['zmWatchScale']); } else { $scale = max(reScale(SCALE_BASE, $Monitor->DefaultScale(), ZM_WEB_DEFAULT_SCALE), SCALE_BASE); } $page = isset($_REQUEST['page']) ? validInt($_REQUEST['page']) : 1; $limit = isset($_REQUEST['limit']) ? validInt($_REQUEST['limit']) : 0; $nFrames = dbFetchOne($countSql, 'FrameCount'); if ( !empty($limit) && ($nFrames > $limit) ) { $nFrames = $limit; } $pages = (int)ceil($nFrames/ZM_WEB_EVENTS_PER_PAGE); 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; } $frameSql .= " limit $limitStart, $limitAmount"; } elseif ( !empty($limit) ) { $frameSql .= ' limit 0, '.$limit; } $maxShortcuts = 5; $pagination = getPagination($pages, $page, $maxShortcuts, $sortQuery.'&eid='.$eid.$limitQuery.$filterQuery); $frames = dbFetchAll($frameSql); $focusWindow = true; xhtmlHeaders(__FILE__, translate('Frames').' - '.$Event->Id()); ?>
Id().'&fid='.$frame['FrameId'], 'zmImage', array( 'frame', ($scale ? $Event->Width()*$scale/100 : $Event->Width()), ($scale ? $Event->Height()*$scale/100 : $Event->Height()) ), $frame['FrameId']) ?> Id().'&fid='.$frame['FrameId'], 'zmStats', 'stats', $frame['Score']) ?> Id().'&fid='.$frame['FrameId'], 'zmImage', array('image', $Event->Width(), $Event->Height()), ''.$frame['FrameId'].'' ) ?>