From f2366a4a960adeff4dfcc7b046aae3633bfd4bca Mon Sep 17 00:00:00 2001 From: stan Date: Mon, 23 Sep 2002 12:28:43 +0000 Subject: [PATCH] Added zone modification form. git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@35 e3e1d417-86f3-4887-817a-d78f3d33393f --- web/zm.php | 147 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 142 insertions(+), 5 deletions(-) diff --git a/web/zm.php b/web/zm.php index 930397de5..96d78417e 100644 --- a/web/zm.php +++ b/web/zm.php @@ -163,6 +163,50 @@ if ( $action ) startDaemon( "zma", $did ); } } + elseif ( $action == "zone" && isset( $mid ) && isset( $zid ) ) + { + $result = mysql_query( "select * from Monitors where Id = '$mid'" ); + if ( !$result ) + die( mysql_error() ); + $monitor = mysql_fetch_assoc( $result ); + + $result = mysql_query( "select * from Zones where MonitorId = '$mid' and Id = '$zid'" ); + if ( !$result ) + die( mysql_error() ); + $zone = mysql_fetch_assoc( $result ); + + $changes = array(); + if ( $new_name != $zone[Name] ) $changes[] = "Name = '$new_name'"; + if ( $new_type != $zone['Type'] ) $changes[] = "Type = '$new_type'"; + if ( $new_units != $zone[Units] ) $changes[] = "Units = '$new_units'"; + if ( $new_lo_x != $zone[LoX] ) $changes[] = "LoX = '$new_lo_x'"; + if ( $new_lo_y != $zone[LoY] ) $changes[] = "LoY = '$new_lo_y'"; + if ( $new_hi_x != $zone[HiX] ) $changes[] = "HiX = '$new_hi_x'"; + if ( $new_hi_y != $zone[HiY] ) $changes[] = "HiY = '$new_hi_y'"; + if ( $new_alarm_rgb != $zone[AlarmRGB] ) $changes[] = "AlarmRGB = '$new_alarm_rgb'"; + if ( $new_alarm_threshold != $zone[AlarmThreshold] ) $changes[] = "AlarmThreshold = '$new_alarm_threshold'"; + if ( $new_min_alarm_pixels != $zone[MinAlarmPixels] ) $changes[] = "MinAlarmPixels = '$new_min_alarm_pixels'"; + if ( $new_max_alarm_pixels != $zone[MaxAlarmPixels] ) $changes[] = "MaxAlarmPixels = '$new_max_alarm_pixels'"; + if ( $new_filter_x != $zone[FilterX] ) $changes[] = "FilterX = '$new_filter_x'"; + if ( $new_filter_y != $zone[FilterY] ) $changes[] = "FilterY = '$new_filter_y'"; + if ( $new_min_filter_pixels != $zone[MinFilterPixels] ) $changes[] = "MinFilterPixels = '$new_min_filter_pixels'"; + if ( $new_max_filter_pixels != $zone[MaxFilterPixels] ) $changes[] = "MaxFilterPixels = '$new_max_filter_pixels'"; + if ( $new_min_blob_pixels != $zone[MinBlobPixels] ) $changes[] = "MinBlobPixels = '$new_min_blob_pixels'"; + if ( $new_max_blob_pixels != $zone[MaxBlobPixels] ) $changes[] = "MaxBlobPixels = '$new_max_blob_pixels'"; + if ( $new_min_blobs != $zone[MinBlobs] ) $changes[] = "MinBlobs = '$new_min_blobs'"; + if ( $new_max_blobs != $zone[MaxBlobs] ) $changes[] = "MaxBlobs = '$new_max_blobs'"; + + if ( count( $changes ) ) + { + $sql = "update Zones set ".implode( ", ", $changes )." where MonitorId = '$mid' and Id = '$zid'"; + #echo "$sql"; + $result = mysql_query( $sql ); + if ( !$result ) + die( mysql_error() ); + startDaemon( "zma", $monitor[Device] ); + $refresh_parent = true; + } + } } if ( !$view ) @@ -868,6 +912,9 @@ elseif( $view == "zones" ) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Monitor - Zone
ParameterValue
Name
Type
Units
Low X (left)
Low Y (top)
High X (right)
High Y (bottom)
Alarm Colour (RGB)
Alarm Threshold (0>=?<=255)
Minimum Alarmed Area
Maximum Alarmed Area
Filter Width (pixels)
Filter Height (pixels)
Minimum Filtered Area
Maximum Filtered Area
Minimum Blob Area
Maximum Blob Area
Minimum Blobs
Maximum Blobs
 
+ + + - DaemonActive @@ -1101,7 +1238,7 @@ function closeWindow() { foreach ( getEnumValues( 'Monitors', 'Function' ) as $opt_function ) { ?> - +