diff --git a/web/zm.php b/web/zm.php
index 71adaddd2..831501e0a 100644
--- a/web/zm.php
+++ b/web/zm.php
@@ -1,5 +1,4 @@
diff --git a/web/zm_html_view_console.php b/web/zm_html_view_console.php
index 719158998..3a958a106 100644
--- a/web/zm_html_view_console.php
+++ b/web/zm_html_view_console.php
@@ -1,47 +1,67 @@
'$db_now' - INTERVAL 1 HOUR && E.Archived = 0,1,NULL)) as HourEventCount, count(if(E.StartTime>'$db_now' - INTERVAL 1 DAY && E.Archived = 0,1,NULL)) as DayEventCount, count(if(E.StartTime>'$db_now' - INTERVAL 7 DAY && E.Archived = 0,1,NULL)) as WeekEventCount, count(if(E.StartTime>'$db_now' - INTERVAL 1 MONTH && E.Archived = 0,1,NULL)) as MonthEventCount from Monitors as M left join Events as E on E.MonitorId = M.Id group by M.Id order by M.Id";
- $result = mysql_query( $sql );
- if ( !$result )
- echo mysql_error();
- $monitors = array();
- $max_width = 0;
- $max_height = 0;
- $cycle_count = 0;
- while( $row = mysql_fetch_assoc( $result ) )
+if ( ZM_WEB_REFRESH_METHOD == "http" )
+ header("Refresh: ".REFRESH_MAIN."; URL=$PHP_SELF" );
+header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
+header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified
+header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
+header("Cache-Control: post-check=0, pre-check=0", false);
+header("Pragma: no-cache"); // HTTP/1.0
+
+$db_now = strftime( "%Y-%m-%d %H:%M:%S" );
+$sql = "select M.*, count(if(E.Archived=0,1,NULL)) as EventCount, count(if(E.Archived,1,NULL)) as ArchEventCount, count(if(E.StartTime>'$db_now' - INTERVAL 1 HOUR && E.Archived = 0,1,NULL)) as HourEventCount, count(if(E.StartTime>'$db_now' - INTERVAL 1 DAY && E.Archived = 0,1,NULL)) as DayEventCount, count(if(E.StartTime>'$db_now' - INTERVAL 7 DAY && E.Archived = 0,1,NULL)) as WeekEventCount, count(if(E.StartTime>'$db_now' - INTERVAL 1 MONTH && E.Archived = 0,1,NULL)) as MonthEventCount from Monitors as M left join Events as E on E.MonitorId = M.Id group by M.Id order by M.Id";
+$result = mysql_query( $sql );
+if ( !$result )
+ echo mysql_error();
+$monitors = array();
+$max_width = 0;
+$max_height = 0;
+$cycle_count = 0;
+while( $row = mysql_fetch_assoc( $result ) )
+{
+ if ( !visibleMonitor( $row['Id'] ) )
{
- if ( !visibleMonitor( $row['Id'] ) )
- {
- continue;
- }
- $row['zmc'] = zmcCheck( $row );
- $row['zma'] = zmaCheck( $row );
- $sql = "select count(Id) as ZoneCount from Zones where MonitorId = '".$row['Id']."'";
- $result2 = mysql_query( $sql );
- if ( !$result2 )
- echo mysql_error();
- $row2 = mysql_fetch_assoc( $result2 );
- $monitors[] = array_merge( $row, $row2 );
- if ( $row['Function'] != 'None' )
- {
- $cycle_count++;
- if ( $max_width < $row['Width'] ) $max_width = $row['Width'];
- if ( $max_height < $row['Height'] ) $max_height = $row['Height'];
- }
+ continue;
}
- $montage_rows = intval(ceil($cycle_count/ZM_WEB_MONTAGE_MAX_COLS));
- $montage_cols = $cycle_count>=ZM_WEB_MONTAGE_MAX_COLS?ZM_WEB_MONTAGE_MAX_COLS:$cycle_count;
+ $row['zmc'] = zmcCheck( $row );
+ $row['zma'] = zmaCheck( $row );
+ $sql = "select count(Id) as ZoneCount from Zones where MonitorId = '".$row['Id']."'";
+ $result2 = mysql_query( $sql );
+ if ( !$result2 )
+ echo mysql_error();
+ $row2 = mysql_fetch_assoc( $result2 );
+ $monitors[] = array_merge( $row, $row2 );
+ if ( $row['Function'] != 'None' )
+ {
+ $cycle_count++;
+ if ( $max_width < $row['Width'] ) $max_width = $row['Width'];
+ if ( $max_height < $row['Height'] ) $max_height = $row['Height'];
+ }
+}
+$montage_rows = intval(ceil($cycle_count/ZM_WEB_MONTAGE_MAX_COLS));
+$montage_cols = $cycle_count>=ZM_WEB_MONTAGE_MAX_COLS?ZM_WEB_MONTAGE_MAX_COLS:$cycle_count;
+
?>
@@ -78,12 +98,12 @@ function confirmDelete()
return( confirm( 'Warning, deleting a monitor also deletes all events and database entries associated with it.\nAre you sure you wish to delete?' ) );
}
window.setTimeout( "window.location.replace('= $PHP_SELF ?>')", = (REFRESH_MAIN*1000) ?> );
@@ -93,42 +113,42 @@ window.setTimeout( "window.location.replace('= $PHP_SELF ?>')", = (REFRESH_M
= date( "D jS M, g:ia" ) ?> |
ZoneMinder = $zmSlangConsole ?> - = $status ?> - v= ZM_VERSION ?> |
= $zmSlangServerLoad ?>: = $matches[1] ?> |
|
1 )
- {
+if ( canView( 'Stream' ) && $cycle_count > 1 )
+{
?>
= sprintf( $zmClangMonitorCount, count($monitors), zmVlang( $zmVlangMonitor, count($monitors) ) ) ?> (= $zmSlangMontage ?>)
= sprintf( $zmClangMonitorCount, count($monitors), zmVlang( $zmVlangMonitor, count($monitors) ) ) ?>
|
= $zmSlangLoggedInAs ?> = $user['Username'] ?>, = strtolower( $zmSlangConfiguredFor ) ?>
| = $zmSlangConfiguredFor ?>
= strtolower( $bw_array[$bandwidth] ) ?> = strtolower( $zmSlangBandwidth ) ?> |
= makeLink( "javascript: newWindow( '$PHP_SELF?view=options', 'zmOptions', ".$jws['options']['w'].", ".$jws['options']['h']." );", $zmSlangOptions, canView( 'System' ) ) ?> |
@@ -152,57 +172,57 @@ window.setTimeout( "window.location.replace('= $PHP_SELF ?>')", = (REFRESH_M
= $zmSlangMark ?> |
| = makeLink( "javascript: newWindow( '$PHP_SELF?view=monitor&mid=".$monitor['Id']."', 'zmMonitor', ".$jws['monitor']['w'].", ".$jws['monitor']['h']." );", $monitor['Id'].'.', canView( 'Monitors' ) ) ?> |
= makeLink( "javascript: newWindow( '$PHP_SELF?view=watch&mid=".$monitor['Id']."', 'zmWatch".$monitor['Name']."', ".($monitor['Width']+$jws['watch']['w']).", ".($monitor['Height']+$jws['watch']['h'])." );", $monitor['Name'], canView( 'Stream' ) ) ?> |
= makeLink( "javascript: newWindow( '$PHP_SELF?view=function&mid=".$monitor['Id']."', 'zmFunction', ".$jws['function']['w'].", ".$jws['function']['h']." );", "".$monitor['Function']."", canEdit( 'Monitors' ) ) ?> |
@@ -221,7 +241,7 @@ window.setTimeout( "window.location.replace('= $PHP_SELF ?>')", = (REFRESH_M
disabled> |
|
diff --git a/web/zm_html_view_cycle.php b/web/zm_html_view_cycle.php
index fdec9fa94..6d0e541f0 100644
--- a/web/zm_html_view_cycle.php
+++ b/web/zm_html_view_cycle.php
@@ -1,45 +1,65 @@
@@ -55,12 +75,12 @@ function closeWindow()
top.window.close();
}
window.setTimeout( "window.location.replace( '= "$PHP_SELF?view=cycle&mid=$next_mid&mode=$mode" ?>' )", = REFRESH_CYCLE*1000 ?> );
@@ -78,28 +98,28 @@ window.setTimeout( "window.location.replace( '= "$PHP_SELF?view=cycle&mid=$nex
| = $zmSlangClose ?> |
 |
- |
-
- |
+ |
+ |
+
diff --git a/web/zm_html_view_error.php b/web/zm_html_view_error.php
index 8314fbb8a..0fb90d49b 100644
--- a/web/zm_html_view_error.php
+++ b/web/zm_html_view_error.php
@@ -1,3 +1,24 @@
+
ZM - = $zmSlangError ?>
diff --git a/web/zm_html_view_event.php b/web/zm_html_view_event.php
index 5f1a8513e..657276a2f 100644
--- a/web/zm_html_view_event.php
+++ b/web/zm_html_view_event.php
@@ -1,40 +1,60 @@
'$eid' and MonitorId = '$mid' order by Id asc limit 0,1" );
- if ( !$result )
- die( mysql_error() );
- $next_event = mysql_fetch_assoc( $result );
+$result = mysql_query( "select * from Events where Id < '$eid' and MonitorId = '$mid' order by Id desc limit 0,1" );
+if ( !$result )
+ die( mysql_error() );
+$prev_event = mysql_fetch_assoc( $result );
- if ( !isset( $rate ) )
- $rate = 1;
- if ( !isset( $scale ) )
- $scale = 1;
+$result = mysql_query( "select * from Events where Id > '$eid' and MonitorId = '$mid' order by Id asc limit 0,1" );
+if ( !$result )
+ die( mysql_error() );
+$next_event = mysql_fetch_assoc( $result );
- $frames_per_page = EVENT_FRAMES_PER_LINE * EVENT_FRAME_LINES;
+if ( !isset( $rate ) )
+ $rate = 1;
+if ( !isset( $scale ) )
+ $scale = 1;
+
+$frames_per_page = EVENT_FRAMES_PER_LINE * EVENT_FRAME_LINES;
+
+$paged = $event['Frames'] > $frames_per_page;
- $paged = $event['Frames'] > $frames_per_page;
?>
@@ -42,22 +62,22 @@
@@ -239,93 +259,93 @@ location.replace( '= $PHP_SELF ?>?view=events&mid== $mid ?>&page== $page ?
| = $monitor['Name'] ?> - = sprintf( $zmClangEventCount, $n_events, zmVlang( $zmVlangEvent, $n_events ) ) ?> |
|
|
$pages )
- $page = $pages;
+ if ( $page < 0 )
+ $page = 1;
+ if ( $page > $pages )
+ $page = $pages;
- if ( $page > 1 )
+ if ( $page > 1 )
+ {
+ $new_pages = array();
+ $pages_used = array();
+ $lo_exp = max(2,log($page-1)/log($max_shortcuts));
+ for ( $i = 0; $i < $max_shortcuts; $i++ )
{
- $new_pages = array();
- $pages_used = array();
- $lo_exp = max(2,log($page-1)/log($max_shortcuts));
- for ( $i = 0; $i < $max_shortcuts; $i++ )
- {
- $new_page = round($page-pow($lo_exp,$i));
- if ( isset($pages_used[$new_page]) )
- continue;
- if ( $new_page <= 1 )
- break;
- $pages_used[$new_page] = true;
- array_unshift( $new_pages, $new_page );
- }
- if ( !isset($pages_used[1]) )
- array_unshift( $new_pages, 1 );
+ $new_page = round($page-pow($lo_exp,$i));
+ if ( isset($pages_used[$new_page]) )
+ continue;
+ if ( $new_page <= 1 )
+ break;
+ $pages_used[$new_page] = true;
+ array_unshift( $new_pages, $new_page );
+ }
+ if ( !isset($pages_used[1]) )
+ array_unshift( $new_pages, 1 );
- foreach ( $new_pages as $new_page )
- {
+ foreach ( $new_pages as $new_page )
+ {
?>
= $new_page ?>
- = $page ?> -
$pages )
- break;
- $pages_used[$new_page] = true;
- array_push( $new_pages, $new_page );
- }
- if ( !isset($pages_used[$pages]) )
- array_push( $new_pages, $pages );
+ $new_page = round($page+pow($hi_exp,$i));
+ if ( isset($pages_used[$new_page]) )
+ continue;
+ if ( $new_page > $pages )
+ break;
+ $pages_used[$new_page] = true;
+ array_push( $new_pages, $new_page );
+ }
+ if ( !isset($pages_used[$pages]) )
+ array_push( $new_pages, $pages );
- foreach ( $new_pages as $new_page )
- {
+ foreach ( $new_pages as $new_page )
+ {
?>
= $new_page ?>
|
= $zmSlangViewAll ?> |
|
= $zmSlangViewPaged ?> |
= $zmSlangClose ?> |
@@ -338,14 +358,14 @@ location.replace( '= $PHP_SELF ?>?view=events&mid== $mid ?>&page== $page ?
| |
|
@@ -392,5 +412,5 @@ location.replace( '= $PHP_SELF ?>?view=events&mid== $mid ?>&page== $page ?
diff --git a/web/zm_html_view_filter.php b/web/zm_html_view_filter.php
index 54fc94d8d..ee13fbbfe 100644
--- a/web/zm_html_view_filter.php
+++ b/web/zm_html_view_filter.php
@@ -1,76 +1,96 @@
'= $zmSlangChooseFilter ?>' );
- $result = mysql_query( "select * from Filters where MonitorId = '$mid' order by Name" );
- if ( !$result )
- die( mysql_error() );
- while ( $row = mysql_fetch_assoc( $result ) )
- {
- $filter_names[$row['Name']] = $row['Name'];
- if ( isset($filter_name) && $filter_name == $row['Name'] )
- {
- $filter_data = $row;
- }
- }
+if ( !canView( 'Events' ) )
+{
+$view = "error";
+return;
+}
+$result = mysql_query( "select * from Monitors where Id = '$mid'" );
+if ( !$result )
+die( mysql_error() );
+$monitor = mysql_fetch_assoc( $result );
- if ( isset($filter_data) )
- {
- foreach( split( '&', $filter_data['Query'] ) as $filter_parm )
- {
- list( $key, $value ) = split( '=', $filter_parm, 2 );
- if ( $key )
- {
- $$key = $value;
- }
- }
- }
+$select_name = "filter_name";
+$filter_names = array( ''=>'= $zmSlangChooseFilter ?>' );
+$result = mysql_query( "select * from Filters where MonitorId = '$mid' order by Name" );
+if ( !$result )
+die( mysql_error() );
+while ( $row = mysql_fetch_assoc( $result ) )
+{
+$filter_names[$row['Name']] = $row['Name'];
+if ( isset($filter_name) && $filter_name == $row['Name'] )
+{
+ $filter_data = $row;
+}
+}
- $conjunction_types = array(
- 'and' => $zmSlangConjAnd,
- 'or' => $zmSlangConjOr
- );
- $obracket_types = array( '' => '' );
- $cbracket_types = array( '' => '' );
- for ( $i = 1; $i <= ceil(($trms-1)/2); $i++ )
+if ( isset($filter_data) )
+{
+foreach( split( '&', $filter_data['Query'] ) as $filter_parm )
+{
+ list( $key, $value ) = split( '=', $filter_parm, 2 );
+ if ( $key )
{
- $obracket_types[$i] = str_repeat( "(", $i );
- $cbracket_types[$i] = str_repeat( ")", $i );
+ $$key = $value;
}
- $attr_types = array(
- 'DateTime' => $zmSlangAttrDateTime,
- 'Date' => $zmSlangAttrDate,
- 'Time' => $zmSlangAttrTime,
- 'Weekday' => $zmSlangAttrWeekday,
- 'Length' => $zmSlangAttrDuration,
- 'Frames' => $zmSlangAttrFrames,
- 'AlarmFrames' => $zmSlangAttrAlarmFrames,
- 'TotScore' => $zmSlangAttrTotalScore,
- 'AvgScore' => $zmSlangAttrAvgScore,
- 'MaxScore' => $zmSlangAttrMaxScore,
- 'Archived' => $zmSlangAttrArchiveStatus,
- );
- $op_types = array(
- '=' => $zmSlangOpEq,
- '!=' => $zmSlangOpNe,
- '>=' => $zmSlangOpGtEq,
- '>' => $zmSlangOpGt,
- '<' => $zmSlangOpLt,
- '<=' => $zmSlangOpLtEq,
- );
- $archive_types = array(
- '0' => $zmSlangArchUnarchived,
- '1' => $zmSlangArchArchived
- );
+}
+}
+
+$conjunction_types = array(
+'and' => $zmSlangConjAnd,
+'or' => $zmSlangConjOr
+);
+$obracket_types = array( '' => '' );
+$cbracket_types = array( '' => '' );
+for ( $i = 1; $i <= ceil(($trms-1)/2); $i++ )
+{
+$obracket_types[$i] = str_repeat( "(", $i );
+$cbracket_types[$i] = str_repeat( ")", $i );
+}
+$attr_types = array(
+'DateTime' => $zmSlangAttrDateTime,
+'Date' => $zmSlangAttrDate,
+'Time' => $zmSlangAttrTime,
+'Weekday' => $zmSlangAttrWeekday,
+'Length' => $zmSlangAttrDuration,
+'Frames' => $zmSlangAttrFrames,
+'AlarmFrames' => $zmSlangAttrAlarmFrames,
+'TotScore' => $zmSlangAttrTotalScore,
+'AvgScore' => $zmSlangAttrAvgScore,
+'MaxScore' => $zmSlangAttrMaxScore,
+'Archived' => $zmSlangAttrArchiveStatus,
+);
+$op_types = array(
+'=' => $zmSlangOpEq,
+'!=' => $zmSlangOpNe,
+'>=' => $zmSlangOpGtEq,
+'>' => $zmSlangOpGt,
+'<' => $zmSlangOpLt,
+'<=' => $zmSlangOpLtEq,
+);
+$archive_types = array(
+'0' => $zmSlangArchUnarchived,
+'1' => $zmSlangArchArchived
+);
+
?>
@@ -79,89 +99,89 @@
@@ -198,29 +218,29 @@ window.focus();
| |
= buildSelect( $conjunction_name, $conjunction_types ); ?> |
2 ) { echo buildSelect( $obracket_name, $obracket_types ); } else { ?> |
= buildSelect( $attr_name, $attr_types, "$value_name.value = ''; submitToFilter( document.filter_form );" ); ?> |
@@ -237,7 +257,7 @@ window.focus();
2 ) { echo buildSelect( $cbracket_name, $cbracket_types ); } else { ?> |
|
diff --git a/web/zm_html_view_filtersave.php b/web/zm_html_view_filtersave.php
index fbf38ae8b..f1f580cd9 100644
--- a/web/zm_html_view_filtersave.php
+++ b/web/zm_html_view_filtersave.php
@@ -1,13 +1,33 @@
@@ -32,20 +52,20 @@ window.focus();
1 )
{
- $conjunction_name = "cnj$i";
- $obracket_name = "obr$i";
- $cbracket_name = "cbr$i";
- $attr_name = "attr$i";
- $op_name = "op$i";
- $value_name = "val$i";
- if ( $i > 1 )
- {
?>
@@ -53,23 +73,23 @@ window.focus();
| = $zmSlangSaveAs ?>: = buildSelect( $select_name, $filter_names, "submitToFilter( document.filter_form );" ); ?> = $zmSlangOrEnterNewName ?>: |
diff --git a/web/zm_html_view_frame.php b/web/zm_html_view_frame.php
index c3808d10a..b0dd18db3 100644
--- a/web/zm_html_view_frame.php
+++ b/web/zm_html_view_frame.php
@@ -1,48 +1,68 @@
diff --git a/web/zm_html_view_frames.php b/web/zm_html_view_frames.php
index 7d8368db3..f07362e35 100644
--- a/web/zm_html_view_frames.php
+++ b/web/zm_html_view_frames.php
@@ -1,16 +1,35 @@
@@ -42,10 +61,10 @@ function closeWindow()
= $zmSlangScore ?> |
| = $frame['FrameId'] ?> |
@@ -53,31 +72,31 @@ function closeWindow()
= date( "H:i:s", $frame['UnixTimeStamp'] ) ?> |
= number_format( $frame['Delta'], 2 ) ?> |
= $frame['Score'] ?> |
= $frame['Score'] ?> |
= $zmSlangNoFramesRecorded ?>
|
diff --git a/web/zm_html_view_function.php b/web/zm_html_view_function.php
index 98bf33dd5..44829c33c 100644
--- a/web/zm_html_view_function.php
+++ b/web/zm_html_view_function.php
@@ -1,13 +1,33 @@
@@ -15,12 +35,12 @@
@@ -71,12 +91,12 @@ window.setTimeout( "window.location.reload(true)", = $refresh*1000 ?> );
diff --git a/web/zm_html_view_none.php b/web/zm_html_view_none.php
index 48db0ea27..03bf4a950 100644
--- a/web/zm_html_view_none.php
+++ b/web/zm_html_view_none.php
@@ -1,14 +1,35 @@
+
diff --git a/web/zm_html_view_optionhelp.php b/web/zm_html_view_optionhelp.php
index 6e0fcbeb9..c9acb7efd 100644
--- a/web/zm_html_view_optionhelp.php
+++ b/web/zm_html_view_optionhelp.php
@@ -1,4 +1,22 @@
@@ -31,12 +51,12 @@
$value )
+foreach ( $tabs as $name=>$value )
+{
+ if ( $tab == $name )
{
- if ( $tab == $name )
- {
?>
| = $value ?> |
= $value ?> |
|
diff --git a/web/zm_html_view_postlogin.php b/web/zm_html_view_postlogin.php
index 080c56341..bfacdad31 100644
--- a/web/zm_html_view_postlogin.php
+++ b/web/zm_html_view_postlogin.php
@@ -1,3 +1,24 @@
+
ZM - = $zmSlangLoggingIn ?>
diff --git a/web/zm_html_view_restarting.php b/web/zm_html_view_restarting.php
index 1ba693fa2..2a58aceae 100644
--- a/web/zm_html_view_restarting.php
+++ b/web/zm_html_view_restarting.php
@@ -1,3 +1,24 @@
+
ZM - Restarting
diff --git a/web/zm_html_view_settings.php b/web/zm_html_view_settings.php
index 0ecb49152..33f607247 100644
--- a/web/zm_html_view_settings.php
+++ b/web/zm_html_view_settings.php
@@ -1,17 +1,37 @@
@@ -19,12 +39,12 @@
@@ -109,15 +128,15 @@ window.setTimeout( "window.location.replace( '= "$PHP_SELF?view=watchevents&mi
|
diff --git a/web/zm_html_view_watchfeed.php b/web/zm_html_view_watchfeed.php
index 58280b36b..06f7ec194 100644
--- a/web/zm_html_view_watchfeed.php
+++ b/web/zm_html_view_watchfeed.php
@@ -1,39 +1,59 @@
@@ -49,12 +69,12 @@ function closeWindow()
top.window.close();
}
window.setTimeout( "window.location.reload(true)", = REFRESH_IMAGE*1000 ?> );
@@ -87,28 +107,28 @@ window.setTimeout( "window.location.reload(true)", = REFRESH_IMAGE*1000 ?> );
= $zmSlangClose ?> |
 |
- |
-
- |
+ |
+ |
+
diff --git a/web/zm_html_view_watchstatus.php b/web/zm_html_view_watchstatus.php
index 971e643bb..e31ebb510 100644
--- a/web/zm_html_view_watchstatus.php
+++ b/web/zm_html_view_watchstatus.php
@@ -1,75 +1,95 @@
0 && $last_status == 0 );
- $old_alarm = ( $status == 0 && $last_status > 0 );
+if ( !canView( 'Stream' ) )
+{
+ $view = "error";
+ return;
+}
+$zmu_command = ZMU_COMMAND." -m $mid -s -f";
+if ( canEdit( 'Monitors' ) && isset($force) )
+{
+ $zmu_command .= ($force?" -a":" -c");
+}
+
+$zmu_output = exec( escapeshellcmd( $zmu_command ) );
+list( $status, $fps ) = split( ' ', $zmu_output );
+$status_string = $zmSlangUnknown;
+$fps_string = "--.--";
+$class = "text";
+if ( $status == 0 )
+{
+ $status_string = $zmSlangIdle;
+}
+elseif ( $status == 1 )
+{
+ $status_string = $zmSlangAlarm;
+ $class = "redtext";
+}
+elseif ( $status == 2 )
+{
+ $status_string = $zmSlangAlert;
+ $class = "ambtext";
+}
+elseif ( $status == 3 )
+{
+ $status_string = $zmSlangRecord;
+}
+$fps_string = sprintf( "%.2f", $fps );
+$new_alarm = ( $status > 0 && $last_status == 0 );
+$old_alarm = ( $status == 0 && $last_status > 0 );
+
+$refresh = (isset($force)||$forced||$status)?1:REFRESH_STATUS;
+$url = "$PHP_SELF?view=watchstatus&mid=$mid&last_status=$status".(($force||$forced)?"&forced=1":"");
+if ( ZM_WEB_REFRESH_METHOD == "http" )
+ header("Refresh: $refresh; URL=$url" );
+header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
+header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified
+header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
+header("Cache-Control: post-check=0, pre-check=0", false);
+header("Pragma: no-cache"); // HTTP/1.0
- $refresh = (isset($force)||$forced||$status)?1:REFRESH_STATUS;
- $url = "$PHP_SELF?view=watchstatus&mid=$mid&last_status=$status".(($force||$forced)?"&forced=1":"");
- if ( ZM_WEB_REFRESH_METHOD == "http" )
- header("Refresh: $refresh; URL=$url" );
- header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
- header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified
- header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
- header("Cache-Control: post-check=0, pre-check=0", false);
- header("Pragma: no-cache"); // HTTP/1.0
?>
@@ -79,34 +99,34 @@ window.setTimeout( "window.location.replace( '= $url ?>' )", = $refresh*1000
|
= $zmSlangStatus ?>: = $status_string ?> - = $fps_string ?> fps |
= $zmSlangCancelForcedAlarm ?> |
= $zmSlangForceAlarm ?> |
|
diff --git a/web/zm_html_view_zone.php b/web/zm_html_view_zone.php
index f988b927b..05b1999f4 100644
--- a/web/zm_html_view_zone.php
+++ b/web/zm_html_view_zone.php
@@ -1,30 +1,50 @@
0 )
+{
+ $result = mysql_query( "select * from Zones where MonitorId = '$mid' and Id = '$zid'" );
if ( !$result )
die( mysql_error() );
- $monitor = mysql_fetch_assoc( $result );
+ $zone = mysql_fetch_assoc( $result );
+}
+else
+{
+ $zone = array();
+ $zone['Name'] = $zmSlangNew;
+ $zone['LoX'] = 0;
+ $zone['LoY'] = 0;
+ $zone['HiX'] = $monitor['Width']-1;
+ $zone['HiY'] = $monitor['Height']-1;
+}
- if ( $zid > 0 )
- {
- $result = mysql_query( "select * from Zones where MonitorId = '$mid' and Id = '$zid'" );
- if ( !$result )
- die( mysql_error() );
- $zone = mysql_fetch_assoc( $result );
- }
- else
- {
- $zone = array();
- $zone['Name'] = $zmSlangNew;
- $zone['LoX'] = 0;
- $zone['LoY'] = 0;
- $zone['HiX'] = $monitor['Width']-1;
- $zone['HiY'] = $monitor['Height']-1;
- }
?>
@@ -32,12 +52,12 @@