} $monitors = dbFetchAll("select * from Monitors order by Sequence asc"); for ($i = 0; $i < count($monitors); $i++) { $monitor = $monitors[$i]; $monitor_str = ""; $monitor_str .= make_tag("id", $monitor['Id']); $monitor_str .= make_tag("name", $monitor['Name']); $monitor_str .= make_tag("method", $monitor['Function']); $monitor_str .= make_tag("enabled", $monitor['Enabled']); $monitor_str .= make_tag("width", $monitor['Width']); $monitor_str .= make_tag("height", $monitor['Height']); print make_tag("monitor", $monitor_str); } } else { if ($_REQUEST['action'] == "get_connkey") { print make_tag("connkey", generateConnKey()); } else { if ($_REQUEST['action'] == "event_stats") { if (!canView("Events")) { ajaxError('Unrecognised action or insufficient permissions'); } $eid = validInt($_REQUEST['eid']); $stats = dbFetchAll("select S.*,E.*,Z.Name as ZoneName,Z.Units,Z.Area,M.Name as MonitorName,M.Width,M.Height from Stats as S left join Events as E on S.EventId = E.Id left join Zones as Z on S.ZoneId = Z.Id left join Monitors as M on E.MonitorId = M.Id where S.EventId = '" . $eid . "' order by S.FrameId, S.ZoneId"); for ($i = 0; $i < count($stats); $i++) { $stat = $stats[$i]; $stat_str = ""; $stat_str .= make_tag("FrameId", $stat["FrameId"]); $stat_str .= make_tag("PixelDiff", $stat["PixelDiff"]); $stat_str .= make_tag("AlarmPixels", $stat["AlarmPixels"]); $stat_str .= make_tag("FilterPixels", $stat["FilterPixels"]); $stat_str .= make_tag("BlobPixels", $stat["BlobPixels"]);
if (isset($_REQUEST['replayMode'])) { $replayMode = validHtmlStr($_REQUEST['replayMode']); } if (isset($_COOKIE['replayMode']) && preg_match('#^[a-z]+$#', $_COOKIE['replayMode'])) { $replayMode = validHtmlStr($_COOKIE['replayMode']); } else { $keys = array_keys($replayModes); $replayMode = array_shift($keys); } parseSort(); parseFilter($_REQUEST['filter']); $filterQuery = $_REQUEST['filter']['query']; $panelSections = 40; $panelSectionWidth = (int) ceil(reScale($event['Width'], $scale) / $panelSections); $panelWidth = $panelSections * $panelSectionWidth - 1; $connkey = generateConnKey(); $focusWindow = true; xhtmlHeaders(__FILE__, translate('Event')); ?> <body> <div id="page"> <div id="content"> <div id="dataBar"> <table id="dataTable" class="major" cellspacing="0"> <tr> <td><span id="dataId" title="<?php echo translate('Id'); ?> "><?php echo $event['Id']; ?>
} $scaleWidth = reScale($row['Width'], $scale); $scaleHeight = reScale($row['Height'], $scale); if ($maxWidth < $scaleWidth) { $maxWidth = $scaleWidth; } if ($maxHeight < $scaleHeight) { $maxHeight = $scaleHeight; } if (ZM_OPT_CONTROL && $row['ControlId']) { $showControl = true; } $row['index'] = $index++; $row['scaleWidth'] = $scaleWidth; $row['scaleHeight'] = $scaleHeight; $row['connKey'] = generateConnKey(); $monitors[] = $row; } $focusWindow = true; $layouts = array('montage_freeform.css' => $SLANG['MtgDefault'], 'montage_2wide.css' => $SLANG['Mtg2widgrd'], 'montage_3wide.css' => $SLANG['Mtg3widgrd'], 'montage_4wide.css' => $SLANG['Mtg4widgrd'], 'montage_3wide50enlarge.css' => $SLANG['Mtg3widgrx']); if (isset($_COOKIE['zmMontageLayout'])) { $layout = $_COOKIE['zmMontageLayout']; } xhtmlHeaders(__FILE__, $SLANG['Montage']); ?> <body> <div id="page"> <div id="header"> <div id="headerButtons"> <?php if ($showControl) {
' . (!empty($monitorid) ? 'AND Id=' . $monitorid : '') . ' ' . (!empty($view_monitorids) ? 'AND Id IN (' . $view_monitorids . ')' : '') . ' ORDER BY Sequence ASC ' . (!empty($limit) ? 'LIMIT ' . $limit : ''); $monitors = dbFetchAll($sql); $index = 0; $displayMonitors = array(); for ($i = 0; $i < count($monitors); $i++) { if (!visibleMonitor($monitors[$i]['Id'])) { continue; } $tmpheight = $contentwidth * $monitors[$i]['Height'] / $monitors[$i]['Width']; if ($maxHeight < $tmpheight) { $maxHeight = $tmpheight; } $monitors[$i]['connKey'] = generateConnKey(); $monitors[$i]['index'] = $index++; $displayMonitors[$monitors[$i]['Id']] = $monitors[$i]; } //if(!empty($first_monitor) && isset($displayMonitors[$first_monitor])) { // $tmp = $displayMonitors[$first_monitor]; // unset($displayMonitors[$first_monitor]); // array_unshift($displayMonitors,$tmp); //} $order_monitors = array(); foreach ($zmViewBigScreen as $m) { $order_monitors[$m] = $displayMonitors[$m]; unset($displayMonitors[$m]); } if (!empty($order_monitors)) { $displayMonitors = $order_monitors + $displayMonitors;