From ebf0f2f1ec305037dd5a4bd23ec07133debaec8d Mon Sep 17 00:00:00 2001 From: stan Date: Thu, 8 Jan 2004 11:45:57 +0000 Subject: [PATCH] Added headers and corrected formatting. git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@734 e3e1d417-86f3-4887-817a-d78f3d33393f --- web/zm.php | 6 +- web/zm_actions.php | 1 - web/zm_db.php | 3 +- web/zm_funcs.php | 3 +- web/zm_html.php | 1 - web/zm_html_view_bandwidth.php | 22 +- web/zm_html_view_console.php | 220 +++++++------- web/zm_html_view_cycle.php | 122 ++++---- web/zm_html_view_error.php | 21 ++ web/zm_html_view_event.php | 296 ++++++++++--------- web/zm_html_view_events.php | 456 +++++++++++++++-------------- web/zm_html_view_filter.php | 286 +++++++++--------- web/zm_html_view_filtersave.php | 80 +++-- web/zm_html_view_frame.php | 96 +++--- web/zm_html_view_frames.php | 69 +++-- web/zm_html_view_function.php | 50 +++- web/zm_html_view_login.php | 21 ++ web/zm_html_view_logout.php | 21 ++ web/zm_html_view_monitor.php | 322 ++++++++++---------- web/zm_html_view_montage.php | 94 +++--- web/zm_html_view_montagefeed.php | 104 ++++--- web/zm_html_view_montagestatus.php | 120 ++++---- web/zm_html_view_none.php | 27 +- web/zm_html_view_optionhelp.php | 18 ++ web/zm_html_view_options.php | 185 ++++++------ web/zm_html_view_postlogin.php | 21 ++ web/zm_html_view_restarting.php | 21 ++ web/zm_html_view_settings.php | 50 +++- web/zm_html_view_state.php | 64 ++-- web/zm_html_view_stats.php | 58 ++-- web/zm_html_view_user.php | 70 +++-- web/zm_html_view_video.php | 90 +++--- web/zm_html_view_watch.php | 38 ++- web/zm_html_view_watchevents.php | 145 +++++---- web/zm_html_view_watchfeed.php | 114 +++++--- web/zm_html_view_watchstatus.php | 152 +++++----- web/zm_html_view_zone.php | 84 ++++-- web/zm_html_view_zones.php | 82 ++++-- web/zm_lang.php | 18 ++ web/zm_lang_en_gb.php | 57 ++-- web/zm_lang_en_us.php | 57 ++-- web/zm_wml.php | 1 - web/zm_wml_view_console.php | 110 ++++--- web/zm_wml_view_feed.php | 54 ++-- 44 files changed, 2340 insertions(+), 1590 deletions(-) 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('')", ); @@ -93,42 +113,42 @@ window.setTimeout( "window.location.replace('')", ZoneMinder - - v : 1 ) - { +if ( canView( 'Stream' ) && $cycle_count > 1 ) +{ ?>  () ,   @@ -152,57 +172,57 @@ window.setTimeout( "window.location.replace('')", ".$monitor['Function']."", canEdit( 'Monitors' ) ) ?> @@ -221,7 +241,7 @@ window.setTimeout( "window.location.replace('')", 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( '' )", ); @@ -78,28 +98,28 @@ window.setTimeout( "window.location.replace( ' - - - + + + 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( '?view=events&mid=&page= -     $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 ) + { ?>    - $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 ) + { ?>     @@ -338,14 +358,14 @@ location.replace( '?view=events&mid=&page=  @@ -360,13 +380,13 @@ location.replace( '?view=events&mid=&page=Mark > @@ -381,7 +401,7 @@ location.replace( '?view=events&mid=&page= disabled>
@@ -392,5 +412,5 @@ location.replace( '?view=events&mid=&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 @@ '' ); - $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( ''=>'' ); +$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(); @@ -237,7 +257,7 @@ window.focus();
  2 ) { echo buildSelect( $obracket_name, $obracket_types ); } else { ?>  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();
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() @@ -53,31 +72,31 @@ function closeWindow()
 



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)", ); 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 ) - { ?>
 
@@ -153,11 +172,11 @@ function validateForm( form ) @@ -172,15 +191,15 @@ function validateForm( form ) @@ -192,75 +211,75 @@ function validateForm( form ) $value ) - { + foreach ( $config_cat as $name=>$value ) + { ?>
disabled>
 
disabled 
(?) checked> checked  
 
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( ' @@ -137,8 +156,8 @@ window.setTimeout( "window.location.replace( ' @@ -150,7 +169,7 @@ window.setTimeout( "window.location.replace( ' disabled>
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)", ); @@ -87,28 +107,28 @@ window.setTimeout( "window.location.reload(true)", ); - - - + + + 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( '' )",    -  fps   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 @@