'$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 E.MonitorId order by 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 ( $max_width < $row[Width] ) $max_width = $row[Width]; if ( $max_height < $row[Height] ) $max_height = $row[Height]; $sql = "select count(Id) as ZoneCount, count(if(Type='Active',1,NULL)) as ActZoneCount, count(if(Type='Inclusive',1,NULL)) as IncZoneCount, count(if(Type='Exclusive',1,NULL)) as ExcZoneCount, count(if(Type='Inactive',1,NULL)) as InactZoneCount 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++; } $sql = "select distinct Device from Monitors order by Device"; $result = mysql_query( $sql ); if ( !$result ) echo mysql_error(); $devices = array(); while( $row = mysql_fetch_assoc( $result ) ) { $ps_array = preg_split( "/\s+/", exec( "ps -edalf | grep 'zmc $row[Device]' | grep -v grep" ) ); if ( $ps_array[3] ) { $row['zmc'] = 1; } $ps_array = preg_split( "/\s+/", exec( "ps -edalf | grep 'zma $row[Device]' | grep -v grep" ) ); if ( $ps_array[3] ) { $row['zma'] = 1; } $devices[] = $row; } ?> ZM - Console
ZoneMinder Console Report Bug
Monitors Currently configured for bandwidth (change to 1, "medium"=>1, "low"=>1 ); unset( $bw_array[$bandwidth] ); $bw_keys = array_keys( $bw_array ); ?> , ) 1 ) { ?> Watch All  
Id Name Device/Channel Function Events Hour Day Week Month Archive Zones Mark
. ">/dev/video ()
   
ZM - Cycle Watch

ZM - <?php echo $monitor[Name] ?> - Watch
Stills Stream   Close
0 && $last_status == 0 ); header("Refresh: ".REFRESH_STATUS."; URL='$PHP_SELF?view=watchstatus&mid=$mid&last_status=$status'" ); 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 ?>
Status:
ZM - <?php echo $monitor ?> - Events
Last events All Archive Check All
 
Id Name Time Secs Frames Score Mark
() ()
'."\n"; } for ( $i = 1; $i <= $trms; $i++ ) { $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 ( $$conjunction_name ) { $filter_query .= "&$conjunction_name=".$$conjunction_name; $filter_sql .= " ".$$conjunction_name." "; $filter_fields .= ''."\n"; } if ( $$obracket_name ) { $filter_query .= "&$obracket_name=".$$obracket_name; $filter_sql .= str_repeat( "(", $$obracket_name ); $filter_fields .= ''."\n"; } if ( $$attr_name ) { $filter_query .= "&$attr_name=".$$attr_name; $filter_fields .= ''."\n"; switch ( $$attr_name ) { case 'DateTime': $dt_val = strtotime( $$value_name ); $filter_sql .= "E.StartTime ".$$op_name." from_unixtime( $dt_val )"; $filter_query .= "&$op_name=".urlencode($$op_name); $filter_fields .= ''."\n"; break; case 'Date': $dt_val = strtotime( $$value_name ); $filter_sql .= "to_days( E.StartTime ) ".$$op_name." to_days( from_unixtime( $dt_val ) )"; $filter_query .= "&$op_name=".urlencode($$op_name); $filter_fields .= ''."\n"; break; case 'Time': $dt_val = strtotime( $$value_name ); $filter_sql .= "extract( hour_second from E.StartTime ) ".$$op_name." extract( hour_second from from_unixtime( $dt_val ) )"; $filter_query .= "&$op_name=".urlencode($$op_name); $filter_fields .= ''."\n"; break; case 'Weekday': $dt_val = strtotime( $$value_name ); $filter_sql .= "weekday( E.StartTime ) ".$$op_name." weekday( from_unixtime( $dt_val ) )"; $filter_query .= "&$op_name=".urlencode($$op_name); $filter_fields .= ''."\n"; break; case 'Length': case 'Frames': case 'AlarmFrames': case 'AvgScore': case 'MaxScore': $filter_sql .= "E.".$$attr_name." ".$$op_name." ".$$value_name; $filter_query .= "&$op_name=".urlencode($$op_name); $filter_fields .= ''."\n"; break; case 'Archived': $filter_sql .= "E.Archived = ".$$value_name; break; } $filter_query .= "&$value_name=".urlencode($$value_name); $filter_fields .= ''."\n"; } if ( $$cbracket_name ) { $filter_query .= "&$cbracket_name=".$$cbracket_name; $filter_sql .= str_repeat( ")", $$cbracket_name ); $filter_fields .= ''."\n"; } } if ( $filter_sql ) { $sql .= " and ( $filter_sql )"; } $sql .= " order by $sort_column $sort_order"; //echo $sql; $result = mysql_query( $sql ); if ( !$result ) { die( mysql_error() ); } $n_rows = mysql_num_rows( $result ); //echo $filter_query; ?> ZM - <?php echo $monitor[Name] ?> - Events
- events   Close
 
Refresh Show Filter Window Check All
 
>
Id Name Time Length Frames Alarm Frames Avg. Score Max. Score Mark
    
'Choose Filter' ); $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 ( $filter_name == $row[Name] ) { $filter_data = $row; } } if ( $filter_data ) { //$filter_query = unserialize( $filter_data[Query] ); //if ( is_array($filter_query) ) //{ //while( list( $key, $value ) = each( $filter_query ) ) //{ //$$key = $value; //} //} foreach( split( '&', $filter_data[Query] ) as $filter_parm ) { list( $key, $value ) = split( '=', $filter_parm, 2 ); if ( $key ) { $$key = $value; } } } $conjunction_types = array( 'and'=>'and', 'or'=>'or' ); $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'=>'Date/Time', 'Date'=>'Date', 'Time'=>'Time', 'Weekday'=>'Weekday', 'Length'=>'Length', 'Frames'=>'Frames', 'AlarmFrames'=>'Alarm Frames', 'AvgScore'=>'Avg. Score', 'MaxScore'=>'Max. Score', 'Archived'=>'Archive Status' ); $op_types = array( '='=>'equal to', '!='=>'not equal to', '>='=>'greater than or equal to', '>'=>'greater than', '<'=>'less than', '<='=>'less than or equal to' ); $archive_types = array( '0'=>'Unarchived Only', '1'=>'Archived Only' ); ?> ZM - <?php echo $monitor[Name] ?> - Event Filter
Use  filter expressions Use filter:  1 ) { buildSelect( $select_name, $filter_names, "submitToFilter( filter_form );" ); } else { ?> Save Delete   Close
 
  2 ) { buildSelect( $obracket_name, $obracket_types ); } else { ?> 
is equal to
2 ) { buildSelect( $cbracket_name, $cbracket_types ); } else { ?> 
 
  
ZM - <?php echo $monitor[Name] ?> - Save Filter
1 ) { ?>
Save as:  or enter new name:  Enter new filter name: 
 
Automatically upload all matching events:  >
Automatically delete all matching events:  >
 
 
ZM - Image <?php echo $eid."-".$fid ?> 1 ) { ?> 1 ) { ?>
Image Delete Close
First   Prev   Next   Last  
ZM - Event - <?php echo $event[Name] ?>
Learn Pref: 
Refresh Delete Unarchive Archive Stills Stream   Video   Close
$thumb_image"; else $command = NETPBM_DIR."/jpegtopnm -dct fast $capt_image | ".NETPBM_DIR."/pnmscalefixed $fraction | ".NETPBM_DIR."/ppmtojpeg --dct=fast > $thumb_image"; #exec( escapeshellcmd( $command ) ); exec( $command ); } } ?>
<?php echo $frame_id ?>/<?php echo $row[Score] ?>
ZM - <?php echo $monitor[Name] ?> - Zones " href="javascript: newWindow( '?view=zone&mid=&zid=', 'zmZone', , );">
  Zones Close
Id Name Type Units Dimensions Mark
. ,-,
 
0 ) { $result = mysql_query( "select * from Monitors where Id = '$mid'" ); if ( !$result ) die( mysql_error() ); $monitor = mysql_fetch_assoc( $result ); } else { $monitor = array(); $monitor[Name] = "New"; } ?> ZM - Monitor <?php echo $monitor[Name] ?>
Monitor
ParameterValue
Name
Function
Device Number (/dev/video?)
Device Channel
Device Format (1=PAL,2=NTSC etc)
Device Width (pixels)
Device Height (pixels)
Device Colour Depth
Timestamp Label Format
Timestamp Label X
Timestamp Label Y
Image Buffer Size (frames)
Warmup Frames
Pre Event Image Buffer
Post Event Image Buffer
FPS Report Interval
Reference Image Blend %ge
 
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] = "New"; $zone[LoX] = 0; $zone[LoY] = 0; $zone[HiX] = $monitor[Width]-1; $zone[HiY] = $monitor[Height]-1; } ?> ZM - <?php echo $monitor[Name] ?> - Zone <?php echo $zone[Name] ?>
Monitor - Zone
ParameterValue
Name
Type
Units
Minimum X (left)
Minimum Y (top)
Maximum X (right)
Maximum Y (bottom)
Alarm Colour (RGB)R: G: B:
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
 
$event_dir/mpeg.log" ); } //chdir( $event_dir ); //header("Content-type: video/mpeg"); //header("Content-Disposition: inline; filename=$video_name"); header("Location: $video_file" ); break; } case "device" : { $ps_array = preg_split( "/\s+/", exec( "ps -edalf | grep 'zmc $did' | grep -v grep" ) ); if ( $ps_array[3] ) { $zmc = 1; } $ps_array = preg_split( "/\s+/", exec( "ps -edalf | grep 'zma $did' | grep -v grep" ) ); if ( $ps_array[3] ) { $zma = 1; } ?> ZM - Device - /dev/video<?php echo $did ?>
Device Daemon Status
DaemonActive
Capture class="form">
Analysis class="form">
 
ZM - Function - <?php echo $monitor[Name] ?>
Monitor '' Function