Added headers and corrected formatting.

git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@734 e3e1d417-86f3-4887-817a-d78f3d33393f
This commit is contained in:
stan 2004-01-08 11:45:57 +00:00
parent 84b6ba550c
commit ebf0f2f1ec
44 changed files with 2340 additions and 1590 deletions

View File

@ -1,5 +1,4 @@
<?php
//
// ZoneMinder main web interface file, $Date$, $Revision$
// Copyright (C) 2003 Philip Coombes
@ -19,12 +18,11 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
import_request_variables( "GPC" );
// Use these for debugging, though not both at once!
//phpinfo( INFO_VARIABLES );
error_reporting( E_ALL );
//error_reporting( E_ALL );
if ( !isset($PHP_SELF) )
{

View File

@ -1,5 +1,4 @@
<?php
//
// ZoneMinder web action file, $Date$, $Revision$
// Copyright (C) 2003 Philip Coombes

View File

@ -1,7 +1,6 @@
<?php
//
// ZoneMinder database interface file, $Date$, $Revision$
// ZoneMinder web database interface file, $Date$, $Revision$
// Copyright (C) 2003 Philip Coombes
//
// This program is free software; you can redistribute it and/or

View File

@ -1,7 +1,6 @@
<?php
//
// ZoneMinder function library file, $Date$, $Revision$
// ZoneMinder web function library, $Date$, $Revision$
// Copyright (C) 2003 Philip Coombes
//
// This program is free software; you can redistribute it and/or

View File

@ -1,5 +1,4 @@
<?php
//
// ZoneMinder HTML interface file, $Date$, $Revision$
// Copyright (C) 2003 Philip Coombes

View File

@ -1,5 +1,25 @@
<?php
$new_bandwidth = $bandwidth;
//
// ZoneMinder web bandwidth view file, $Date$, $Revision$
// Copyright (C) 2003 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
$new_bandwidth = $bandwidth;
?>
<html>
<head>

View File

@ -1,47 +1,67 @@
<?php
$running = daemonCheck();
$status = $running?$zmSlangRunning:$zmSlangStopped;
//
// ZoneMinder web console file, $Date$, $Revision$
// Copyright (C) 2003 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
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
$running = daemonCheck();
$status = $running?$zmSlangRunning:$zmSlangStopped;
$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 ( 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;
?>
<html>
<head>
@ -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?' ) );
}
<?php
if ( ZM_WEB_REFRESH_METHOD == "javascript" )
{
if ( ZM_WEB_REFRESH_METHOD == "javascript" )
{
?>
window.setTimeout( "window.location.replace('<?= $PHP_SELF ?>')", <?= (REFRESH_MAIN*1000) ?> );
<?php
}
}
?>
</script>
</head>
@ -93,42 +113,42 @@ window.setTimeout( "window.location.replace('<?= $PHP_SELF ?>')", <?= (REFRESH_M
<td class="smallhead" align="left"><?= date( "D jS M, g:ia" ) ?></td>
<td class="bighead" align="center"><strong>ZoneMinder <?= $zmSlangConsole ?> - <?php if ( canEdit( 'System' ) ) { ?><a href="javascript: newWindow( '<?= $PHP_SELF ?>?view=state', 'zmState', <?= $jws['state']['w'] ?>, <?= $jws['state']['h'] ?> );"><?= $status ?></a> - <?php } ?>v<?= ZM_VERSION ?></strong></td>
<?php
$uptime = shell_exec( 'uptime' );
$load = '';
preg_match( '/load average: ([\d.]+)/', $uptime, $matches );
$uptime = shell_exec( 'uptime' );
$load = '';
preg_match( '/load average: ([\d.]+)/', $uptime, $matches );
?>
<td class="smallhead" align="right"><?= $zmSlangServerLoad ?>: <?= $matches[1] ?></td>
</tr>
<tr>
<td class="smallhead" align="left">
<?php
if ( canView( 'Stream' ) && $cycle_count > 1 )
{
if ( canView( 'Stream' ) && $cycle_count > 1 )
{
?>
<a href="javascript: newWindow( '<?= $PHP_SELF ?>?view=cycle', 'zmCycle', <?= $max_width+$jws['cycle']['w'] ?>, <?= $max_height+$jws['cycle']['h'] ?> );"><?= sprintf( $zmClangMonitorCount, count($monitors), zmVlang( $zmVlangMonitor, count($monitors) ) ) ?></a>&nbsp;(<a href="javascript: newWindow( '<?= $PHP_SELF ?>?view=montage', 'zmMontage', <?= ($montage_cols*$max_width)+$jws['montage']['w'] ?>, <?= ($montage_rows*(40+$max_height))+$jws['montage']['h'] ?> );"><?= $zmSlangMontage ?></a>)
<?php
}
else
{
}
else
{
?>
<?= sprintf( $zmClangMonitorCount, count($monitors), zmVlang( $zmVlangMonitor, count($monitors) ) ) ?>
<?php
}
}
?>
</td>
<?php
if ( ZM_OPT_USE_AUTH )
{
if ( ZM_OPT_USE_AUTH )
{
?>
<td class="smallhead" align="center"><?= $zmSlangLoggedInAs ?> <a href="javascript: newWindow( '<?= $PHP_SELF ?>?view=logout', 'zmLogout', <?= $jws['logout']['w'] ?>, <?= $jws['logout']['h'] ?>);"><?= $user['Username'] ?></a>, <?= strtolower( $zmSlangConfiguredFor ) ?>
<?php
}
else
{
}
else
{
?>
<td class="smallhead" align="center"><?= $zmSlangConfiguredFor ?>
<?php
}
}
?>
&nbsp;<a href="javascript: newWindow( '<?= $PHP_SELF ?>?view=bandwidth', 'zmBandwidth', <?= $jws['bandwidth']['w'] ?>, <?= $jws['bandwidth']['h'] ?>);"><?= strtolower( $bw_array[$bandwidth] ) ?></a> <?= strtolower( $zmSlangBandwidth ) ?></td>
<td class="smallhead" align="right"><?= makeLink( "javascript: newWindow( '$PHP_SELF?view=options', 'zmOptions', ".$jws['options']['w'].", ".$jws['options']['h']." );", $zmSlangOptions, canView( 'System' ) ) ?></td>
@ -152,57 +172,57 @@ window.setTimeout( "window.location.replace('<?= $PHP_SELF ?>')", <?= (REFRESH_M
<td align="center" class="smallhead"><?= $zmSlangMark ?></td>
</tr>
<?php
$event_count = 0;
$hour_event_count = 0;
$day_event_count = 0;
$week_event_count = 0;
$month_event_count = 0;
$arch_event_count = 0;
$zone_count = 0;
foreach( $monitors as $monitor )
{
$event_count += $monitor['EventCount'];
$hour_event_count += $monitor['HourEventCount'];
$day_event_count += $monitor['DayEventCount'];
$week_event_count += $monitor['WeekEventCount'];
$month_event_count += $monitor['MonthEventCount'];
$arch_event_count += $monitor['ArchEventCount'];
$zone_count += $monitor['ZoneCount'];
$event_count = 0;
$hour_event_count = 0;
$day_event_count = 0;
$week_event_count = 0;
$month_event_count = 0;
$arch_event_count = 0;
$zone_count = 0;
foreach( $monitors as $monitor )
{
$event_count += $monitor['EventCount'];
$hour_event_count += $monitor['HourEventCount'];
$day_event_count += $monitor['DayEventCount'];
$week_event_count += $monitor['WeekEventCount'];
$month_event_count += $monitor['MonthEventCount'];
$arch_event_count += $monitor['ArchEventCount'];
$zone_count += $monitor['ZoneCount'];
?>
<tr>
<td align="center" class="text"><?= makeLink( "javascript: newWindow( '$PHP_SELF?view=monitor&mid=".$monitor['Id']."', 'zmMonitor', ".$jws['monitor']['w'].", ".$jws['monitor']['h']." );", $monitor['Id'].'.', canView( 'Monitors' ) ) ?></td>
<?php
if ( !$monitor['zmc'] )
if ( !$monitor['zmc'] )
{
$dclass = "redtext";
}
else
{
if ( !$monitor['zma'] )
{
$dclass = "redtext";
$dclass = "ambtext";
}
else
{
if ( !$monitor['zma'] )
{
$dclass = "ambtext";
}
else
{
$dclass = "gretext";
}
}
if ( $monitor['Function'] == 'None' )
{
$fclass = "redtext";
}
elseif ( $monitor['Function'] == 'Monitor' )
{
$fclass = "ambtext";
}
else
{
$fclass = "gretext";
}
if ( $monitor['RunMode'] == 'Triggered' )
{
$fclass .= "em";
$dclass = "gretext";
}
}
if ( $monitor['Function'] == 'None' )
{
$fclass = "redtext";
}
elseif ( $monitor['Function'] == 'Monitor' )
{
$fclass = "ambtext";
}
else
{
$fclass = "gretext";
}
if ( $monitor['RunMode'] == 'Triggered' )
{
$fclass .= "em";
}
?>
<td align="left" class="text"><?= 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' ) ) ?></td>
<td align="left" class="text"><?= makeLink( "javascript: newWindow( '$PHP_SELF?view=function&mid=".$monitor['Id']."', 'zmFunction', ".$jws['function']['w'].", ".$jws['function']['h']." );", "<span class=\"$fclass\">".$monitor['Function']."</span>", canEdit( 'Monitors' ) ) ?></td>
@ -221,7 +241,7 @@ window.setTimeout( "window.location.replace('<?= $PHP_SELF ?>')", <?= (REFRESH_M
<td align="center" class="text"><input type="checkbox" name="mark_mids[]" value="<?= $monitor['Id'] ?>" onClick="configureButton( document.monitor_form, 'mark_mids' );"<?php if ( !canEdit( 'Monitors' ) || isset($user['MonitorIds']) ) {?> disabled<?php } ?>></td>
</tr>
<?php
}
}
?>
<tr>
<td colspan="2" align="center">

View File

@ -1,45 +1,65 @@
<?php
if ( !canView( 'Stream' ) )
{
$view = "error";
return;
}
if ( !isset($mode) )
{
if ( canStream() )
$mode = "stream";
else
$mode = "still";
}
//
// ZoneMinder web cycle view file, $Date$, $Revision$
// Copyright (C) 2003 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
$result = mysql_query( "select * from Monitors where Function != 'None' order by Id" );
$monitors = array();
$mon_idx = 0;
while( $row = mysql_fetch_assoc( $result ) )
if ( !canView( 'Stream' ) )
{
$view = "error";
return;
}
if ( !isset($mode) )
{
if ( canStream() )
$mode = "stream";
else
$mode = "still";
}
$result = mysql_query( "select * from Monitors where Function != 'None' order by Id" );
$monitors = array();
$mon_idx = 0;
while( $row = mysql_fetch_assoc( $result ) )
{
if ( !visibleMonitor( $row['Id'] ) )
{
if ( !visibleMonitor( $row['Id'] ) )
{
continue;
}
if ( isset($mid) && $row['Id'] == $mid )
$mon_idx = count($monitors);
$monitors[] = $row;
continue;
}
if ( isset($mid) && $row['Id'] == $mid )
$mon_idx = count($monitors);
$monitors[] = $row;
}
$monitor = $monitors[$mon_idx];
$next_mid = $mon_idx==(count($monitors)-1)?$monitors[0]['Id']:$monitors[$mon_idx+1]['Id'];
$monitor = $monitors[$mon_idx];
$next_mid = $mon_idx==(count($monitors)-1)?$monitors[0]['Id']:$monitors[$mon_idx+1]['Id'];
// Prompt an image to be generated
chdir( ZM_DIR_IMAGES );
$status = exec( escapeshellcmd( ZMU_COMMAND." -m ".$monitor['Id']." -i" ) );
if ( ZM_WEB_REFRESH_METHOD == "http" )
header("Refresh: ".REFRESH_CYCLE."; URL=$PHP_SELF?view=cycle&mid=$next_mid&mode=$mode" );
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
// Prompt an image to be generated
chdir( ZM_DIR_IMAGES );
$status = exec( escapeshellcmd( ZMU_COMMAND." -m ".$monitor['Id']." -i" ) );
if ( ZM_WEB_REFRESH_METHOD == "http" )
header("Refresh: ".REFRESH_CYCLE."; URL=$PHP_SELF?view=cycle&mid=$next_mid&mode=$mode" );
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
?>
<html>
<head>
@ -55,12 +75,12 @@ function closeWindow()
top.window.close();
}
<?php
if ( ZM_WEB_REFRESH_METHOD == "javascript" )
{
if ( ZM_WEB_REFRESH_METHOD == "javascript" )
{
?>
window.setTimeout( "window.location.replace( '<?= "$PHP_SELF?view=cycle&mid=$next_mid&mode=$mode" ?>' )", <?= REFRESH_CYCLE*1000 ?> );
<?php
}
}
?>
</script>
</head>
@ -78,28 +98,28 @@ window.setTimeout( "window.location.replace( '<?= "$PHP_SELF?view=cycle&mid=$nex
<td width="33%" align="right" class="text"><a href="javascript: closeWindow();"><?= $zmSlangClose ?></a></td>
</tr>
<?php
if ( $mode == "stream" )
if ( $mode == "stream" )
{
$stream_src = ZM_PATH_ZMS."?monitor=".$monitor['Id']."&idle=".STREAM_IDLE_DELAY."&refresh=".STREAM_FRAME_DELAY."&ttl=".REFRESH_CYCLE;
if ( isNetscape() )
{
$stream_src = ZM_PATH_ZMS."?monitor=".$monitor['Id']."&idle=".STREAM_IDLE_DELAY."&refresh=".STREAM_FRAME_DELAY."&ttl=".REFRESH_CYCLE;
if ( isNetscape() )
{
?>
<tr><td colspan="3" align="center"><a href="javascript: newWindow( '<?= $PHP_SELF ?>?view=watch&mid=<?= $monitor['Id'] ?>', 'zmWatch<?= $monitor['Name'] ?>', <?= $monitor['Width']+$jws['watch']['w'] ?>, <?= $monitor['Height']+$jws['watch']['h'] ?> );"><img src="<?= $stream_src ?>" border="0" width="<?= $monitor['Width'] ?>" height="<?= $monitor['Height'] ?>"></a></td></tr>
<?php
}
else
{
?>
<tr><td colspan="3" align="center"><applet code="com.charliemouse.cambozola.Viewer" archive="<?= ZM_PATH_CAMBOZOLA ?>" align="middle" width="<?= $monitor['Width'] ?>" height="<?= $monitor['Height'] ?>"><param name="url" value="<?= $stream_src ?>"></applet></td></tr>
<?php
}
}
else
{
?>
<tr><td colspan="3" align="center"><a href="javascript: newWindow( '<?= $PHP_SELF ?>?view=watch&mid=<?= $monitor['Id'] ?>', 'zmWatch<?= $monitor['Name'] ?>', <?= $monitor['Width']+$jws['watch']['w'] ?>, <?= $monitor['Height']+$jws['watch']['h'] ?> );"><img src="<?= ZM_DIR_IMAGES.'/'.$monitor['Name'] ?>.jpg" border="0" width="<?= $monitor['Width'] ?>" height="<?= $monitor['Height'] ?>"></a></td></tr>
<tr><td colspan="3" align="center"><applet code="com.charliemouse.cambozola.Viewer" archive="<?= ZM_PATH_CAMBOZOLA ?>" align="middle" width="<?= $monitor['Width'] ?>" height="<?= $monitor['Height'] ?>"><param name="url" value="<?= $stream_src ?>"></applet></td></tr>
<?php
}
}
else
{
?>
<tr><td colspan="3" align="center"><a href="javascript: newWindow( '<?= $PHP_SELF ?>?view=watch&mid=<?= $monitor['Id'] ?>', 'zmWatch<?= $monitor['Name'] ?>', <?= $monitor['Width']+$jws['watch']['w'] ?>, <?= $monitor['Height']+$jws['watch']['h'] ?> );"><img src="<?= ZM_DIR_IMAGES.'/'.$monitor['Name'] ?>.jpg" border="0" width="<?= $monitor['Width'] ?>" height="<?= $monitor['Height'] ?>"></a></td></tr>
<?php
}
?>
</table>
</body>

View File

@ -1,3 +1,24 @@
<?php
//
// ZoneMinder web error view file, $Date$, $Revision$
// Copyright (C) 2003 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
?>
<html>
<head>
<title>ZM - <?= $zmSlangError ?></title>

View File

@ -1,40 +1,60 @@
<?php
if ( !canView( 'Events' ) )
{
$view = "error";
return;
}
if ( !isset($mode) )
{
if ( canStream() )
$mode = "stream";
else
$mode = "still";
}
//
// ZoneMinder web event view file, $Date$, $Revision$
// Copyright (C) 2003 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
$result = mysql_query( "select E.*,M.Name as MonitorName,M.Width,M.Height from Events as E, Monitors as M where E.Id = '$eid' and E.MonitorId = M.Id" );
if ( !$result )
die( mysql_error() );
$event = mysql_fetch_assoc( $result );
if ( !canView( 'Events' ) )
{
$view = "error";
return;
}
if ( !isset($mode) )
{
if ( canStream() )
$mode = "stream";
else
$mode = "still";
}
$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 );
$result = mysql_query( "select E.*,M.Name as MonitorName,M.Width,M.Height from Events as E, Monitors as M where E.Id = '$eid' and E.MonitorId = M.Id" );
if ( !$result )
die( mysql_error() );
$event = mysql_fetch_assoc( $result );
$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 );
$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;
?>
<html>
<head>
@ -42,22 +62,22 @@
<link rel="stylesheet" href="zm_styles.css" type="text/css">
<script language="JavaScript">
<?php
if ( !$event )
{
if ( !$event )
{
?>
opener.location.reload(true);
window.close();
<?php
}
}
?>
window.focus();
<?php
if ( !empty($refresh_parent) )
{
if ( !empty($refresh_parent) )
{
?>
opener.location.reload(true);
<?php
}
}
?>
function refreshWindow()
{
@ -138,164 +158,164 @@ Learn Pref:&nbsp;<select name="learn_state" class="form" onChange="learn_form.su
<td align="right" class="text"><a href="javascript: closeWindow();"><?= $zmSlangClose ?></a></td>
</tr>
<?php
if ( $mode == "still" && $paged && !empty($page) )
{
if ( $mode == "still" && $paged && !empty($page) )
{
?>
<?php
$pages = (int)ceil($event['Frames']/$frames_per_page);
$max_shortcuts = 5;
$pages = (int)ceil($event['Frames']/$frames_per_page);
$max_shortcuts = 5;
?>
<tr><td colspan="6" align="center" class="text">
<?php
if ( $page < 0 )
$page = 1;
if ( $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 )
{
?>
<a href="<?= $PHP_SELF ?>?view=event&mode=still&mid=<?= $mid ?>&eid=<?= $eid ?>&page=<?= $new_page ?>"><?= $new_page ?></a>&nbsp;
<?php
}
}
}
?>
-&nbsp;<?= $page ?>&nbsp;-
<?php
if ( $page < $pages )
if ( $page < $pages )
{
$new_pages = array();
$pages_used = array();
$hi_exp = max(2,log($pages-$page)/log($max_shortcuts));
for ( $i = 0; $i < $max_shortcuts; $i++ )
{
$new_pages = array();
$pages_used = array();
$hi_exp = max(2,log($pages-$page)/log($max_shortcuts));
for ( $i = 0; $i < $max_shortcuts; $i++ )
{
$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 );
$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 )
{
?>
&nbsp;<a href="<?= $PHP_SELF ?>?view=event&mode=still&mid=<?= $mid ?>&eid=<?= $eid ?>&page=<?= $new_page ?>"><?= $new_page ?></a>
<?php
}
}
}
?>
</td></tr>
<?php
}
}
?>
<?php
if ( $mode == "stream" )
if ( $mode == "stream" )
{
$stream_src = ZM_PATH_ZMS."?path=".ZM_PATH_WEB."&event=$eid&rate=$rate&scale=$scale";
if ( isNetscape() )
{
$stream_src = ZM_PATH_ZMS."?path=".ZM_PATH_WEB."&event=$eid&rate=$rate&scale=$scale";
if ( isNetscape() )
{
?>
<tr><td colspan="6" align="center" valign="middle"><img src="<?= $stream_src ?>" border="0" width="<?= reScale( $event['Width'], $scale ) ?>" height="<?= reScale( $event['Height'], $scale ) ?>"></td></tr>
<?php
}
else
{
?>
<tr><td colspan="6" align="center" valign="middle"><applet code="com.charliemouse.cambozola.Viewer" archive="<?= ZM_PATH_CAMBOZOLA ?>" align="middle" width="<?= reScale( $event['Width'], $scale ) ?>" height="<?= reScale( $event['Height'], $scale ) ?>"><param name="url" value="<?= $stream_src ?>"></applet></td></tr>
<?php
}
}
else
{
$sql = "select * from Frames where EventID = '$eid' order by Id";
if ( $paged && !empty($page) )
$sql .= " limit ".(($page-1)*$frames_per_page).", ".$frames_per_page;
$result = mysql_query( $sql );
if ( !$result )
die( mysql_error() );
?>
<tr><td colspan="6" align="center" valign="middle"><applet code="com.charliemouse.cambozola.Viewer" archive="<?= ZM_PATH_CAMBOZOLA ?>" align="middle" width="<?= reScale( $event['Width'], $scale ) ?>" height="<?= reScale( $event['Height'], $scale ) ?>"><param name="url" value="<?= $stream_src ?>"></applet></td></tr>
<?php
}
}
else
{
$sql = "select * from Frames where EventID = '$eid' order by Id";
if ( $paged && !empty($page) )
$sql .= " limit ".(($page-1)*$frames_per_page).", ".$frames_per_page;
$result = mysql_query( $sql );
if ( !$result )
die( mysql_error() );
?>
<tr><td colspan="6"><table border="0" cellpadding="0" cellspacing="2" align="center">
<tr>
<?php
$count = 0;
$scale = IMAGE_SCALING;
$fraction = sprintf( "%.2f", 1/$scale );
$thumb_width = $event['Width']/4;
$thumb_height = $event['Height']/4;
while( $row = mysql_fetch_assoc( $result ) )
$count = 0;
$scale = IMAGE_SCALING;
$fraction = sprintf( "%.2f", 1/$scale );
$thumb_width = $event['Width']/4;
$thumb_height = $event['Height']/4;
while( $row = mysql_fetch_assoc( $result ) )
{
$frame_id = $row['FrameId'];
$image_path = $row['ImagePath'];
$capt_image = $image_path;
if ( $scale == 1 || !file_exists( ZM_PATH_NETPBM."/jpegtopnm" ) )
{
$frame_id = $row['FrameId'];
$image_path = $row['ImagePath'];
$anal_image = preg_replace( "/capture/", "analyse", $image_path );
$capt_image = $image_path;
if ( $scale == 1 || !file_exists( ZM_PATH_NETPBM."/jpegtopnm" ) )
if ( file_exists($anal_image) && filesize( $anal_image ) )
{
$anal_image = preg_replace( "/capture/", "analyse", $image_path );
if ( file_exists($anal_image) && filesize( $anal_image ) )
{
$thumb_image = $anal_image;
}
else
{
$thumb_image = $capt_image;
}
$thumb_image = $anal_image;
}
else
{
$thumb_image = preg_replace( "/capture/", "thumb", $capt_image );
if ( !file_exists($thumb_image) || !filesize( $thumb_image ) )
{
$anal_image = preg_replace( "/capture/", "analyse", $capt_image );
if ( file_exists( $anal_image ) )
$command = ZM_PATH_NETPBM."/jpegtopnm -dct fast $anal_image | ".ZM_PATH_NETPBM."/pnmscalefixed $fraction | ".ZM_PATH_NETPBM."/ppmtojpeg --dct=fast > $thumb_image";
else
$command = ZM_PATH_NETPBM."/jpegtopnm -dct fast $capt_image | ".ZM_PATH_NETPBM."/pnmscalefixed $fraction | ".ZM_PATH_NETPBM."/ppmtojpeg --dct=fast > $thumb_image";
#exec( escapeshellcmd( $command ) );
exec( $command );
}
$thumb_image = $capt_image;
}
$img_class = $row['AlarmFrame']?"alarm":"normal";
}
else
{
$thumb_image = preg_replace( "/capture/", "thumb", $capt_image );
if ( !file_exists($thumb_image) || !filesize( $thumb_image ) )
{
$anal_image = preg_replace( "/capture/", "analyse", $capt_image );
if ( file_exists( $anal_image ) )
$command = ZM_PATH_NETPBM."/jpegtopnm -dct fast $anal_image | ".ZM_PATH_NETPBM."/pnmscalefixed $fraction | ".ZM_PATH_NETPBM."/ppmtojpeg --dct=fast > $thumb_image";
else
$command = ZM_PATH_NETPBM."/jpegtopnm -dct fast $capt_image | ".ZM_PATH_NETPBM."/pnmscalefixed $fraction | ".ZM_PATH_NETPBM."/ppmtojpeg --dct=fast > $thumb_image";
#exec( escapeshellcmd( $command ) );
exec( $command );
}
}
$img_class = $row['AlarmFrame']?"alarm":"normal";
?>
<td align="center" width="88"><a href="javascript: newWindow( '<?= $PHP_SELF ?>?view=frame&eid=<?= $eid ?>&fid=<?= $frame_id ?>', 'zmImage', <?= $event['Width']+$jws['image']['w'] ?>, <?= $event['Height']+$jws['image']['h'] ?> );"><img src="<?= $thumb_image ?>" width="<?= $thumb_width ?>" height="<? echo $thumb_height ?>" class="<?= $img_class ?>" alt="<?= $frame_id ?>/<?= $row['Score'] ?>"></a></td>
<?php
flush();
if ( !(++$count % 4) )
{
flush();
if ( !(++$count % 4) )
{
?>
</tr>
<tr>
<?php
}
}
}
?>
</tr>
</table></td></tr>
<?php
}
}
?>
<tr>
<td colspan="6"><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr>

View File

@ -1,153 +1,173 @@
<?php
if ( !canView( 'Events' ) )
{
$view = "error";
return;
}
if ( !isset($sort_parms) )
{
$sort_parms = "";
}
if ( !isset($sort_field) )
{
$sort_field = "Time";
$sort_asc = false;
}
switch( $sort_field )
{
case 'Id' :
$sort_column = "E.Id";
break;
case 'Name' :
$sort_column = "E.Name";
break;
case 'Time' :
$sort_column = "E.StartTime";
break;
case 'Secs' :
$sort_column = "E.Length";
break;
case 'Frames' :
$sort_column = "E.Frames";
break;
case 'AlarmFrames' :
$sort_column = "E.AlarmFrames";
break;
case 'TotScore' :
$sort_column = "E.TotScore";
break;
case 'AvgScore' :
$sort_column = "E.AvgScore";
break;
case 'MaxScore' :
$sort_column = "E.MaxScore";
break;
default:
$sort_column = "E.StartTime";
break;
}
$sort_order = $sort_asc?"asc":"desc";
if ( !$sort_asc ) $sort_asc = 0;
//
// ZoneMinder web events view file, $Date$, $Revision$
// Copyright (C) 2003 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
$result = mysql_query( "select * from Monitors where Id = '$mid'" );
if ( !$result )
die( mysql_error() );
$monitor = mysql_fetch_assoc( $result );
if ( !canView( 'Events' ) )
{
$view = "error";
return;
}
if ( !isset($sort_parms) )
{
$sort_parms = "";
}
if ( !isset($sort_field) )
{
$sort_field = "Time";
$sort_asc = false;
}
switch( $sort_field )
{
case 'Id' :
$sort_column = "E.Id";
break;
case 'Name' :
$sort_column = "E.Name";
break;
case 'Time' :
$sort_column = "E.StartTime";
break;
case 'Secs' :
$sort_column = "E.Length";
break;
case 'Frames' :
$sort_column = "E.Frames";
break;
case 'AlarmFrames' :
$sort_column = "E.AlarmFrames";
break;
case 'TotScore' :
$sort_column = "E.TotScore";
break;
case 'AvgScore' :
$sort_column = "E.AvgScore";
break;
case 'MaxScore' :
$sort_column = "E.MaxScore";
break;
default:
$sort_column = "E.StartTime";
break;
}
$sort_order = $sort_asc?"asc":"desc";
if ( !$sort_asc ) $sort_asc = 0;
$count_sql = "select count(E.Id) as EventCount from Monitors as M inner join Events as E on (M.Id = E.MonitorId) where M.Id = '$mid'";
$events_sql = "select E.Id,E.Name,E.StartTime,E.Length,E.Frames,E.AlarmFrames,E.TotScore,E.AvgScore,E.MaxScore,E.Archived,E.LearnState from Monitors as M inner join Events as E on (M.Id = E.MonitorId) where M.Id = '$mid'";
$filter_query = '';
$filter_sql = '';
$filter_fields = '';
if ( $trms )
$result = mysql_query( "select * from Monitors where Id = '$mid'" );
if ( !$result )
die( mysql_error() );
$monitor = mysql_fetch_assoc( $result );
$count_sql = "select count(E.Id) as EventCount from Monitors as M inner join Events as E on (M.Id = E.MonitorId) where M.Id = '$mid'";
$events_sql = "select E.Id,E.Name,E.StartTime,E.Length,E.Frames,E.AlarmFrames,E.TotScore,E.AvgScore,E.MaxScore,E.Archived,E.LearnState from Monitors as M inner join Events as E on (M.Id = E.MonitorId) where M.Id = '$mid'";
$filter_query = '';
$filter_sql = '';
$filter_fields = '';
if ( $trms )
{
$filter_query .= "&trms=$trms";
$filter_fields .= '<input type="hidden" name="trms" value="'.$trms.'">'."\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 ( isset($$conjunction_name) )
{
$filter_query .= "&trms=$trms";
$filter_fields .= '<input type="hidden" name="trms" value="'.$trms.'">'."\n";
$filter_query .= "&$conjunction_name=".$$conjunction_name;
$filter_sql .= " ".$$conjunction_name." ";
$filter_fields .= '<input type="hidden" name="'.$conjunction_name.'" value="'.$$conjunction_name.'">'."\n";
}
for ( $i = 1; $i <= $trms; $i++ )
if ( isset($$obracket_name) )
{
$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 ( isset($$conjunction_name) )
{
$filter_query .= "&$conjunction_name=".$$conjunction_name;
$filter_sql .= " ".$$conjunction_name." ";
$filter_fields .= '<input type="hidden" name="'.$conjunction_name.'" value="'.$$conjunction_name.'">'."\n";
}
if ( isset($$obracket_name) )
{
$filter_query .= "&$obracket_name=".$$obracket_name;
$filter_sql .= str_repeat( "(", $$obracket_name );
$filter_fields .= '<input type="hidden" name="'.$obracket_name.'" value="'.$$obracket_name.'">'."\n";
}
if ( isset($$attr_name) )
{
$filter_query .= "&$attr_name=".$$attr_name;
$filter_fields .= '<input type="hidden" name="'.$attr_name.'" value="'.$$attr_name.'">'."\n";
switch ( $$attr_name )
{
case 'DateTime':
$dt_val = strftime( "%Y-%m-%d %H:%M:%S", strtotime( $$value_name ) );
$filter_sql .= "E.StartTime ".$$op_name." '$dt_val'";
$filter_query .= "&$op_name=".urlencode($$op_name);
$filter_fields .= '<input type="hidden" name="'.$op_name.'" value="'.$$op_name.'">'."\n";
break;
case 'Date':
$dt_val = strftime( "%Y-%m-%d %H:%M:%S", strtotime( $$value_name ) );
$filter_sql .= "to_days( E.StartTime ) ".$$op_name." to_days( '$dt_val' )";
$filter_query .= "&$op_name=".urlencode($$op_name);
$filter_fields .= '<input type="hidden" name="'.$op_name.'" value="'.$$op_name.'">'."\n";
break;
case 'Time':
$dt_val = strftime( "%Y-%m-%d %H:%M:%S", strtotime( $$value_name ) );
$filter_sql .= "extract( hour_second from E.StartTime ) ".$$op_name." extract( hour_second from '$dt_val' )";
$filter_query .= "&$op_name=".urlencode($$op_name);
$filter_fields .= '<input type="hidden" name="'.$op_name.'" value="'.$$op_name.'">'."\n";
break;
case 'Weekday':
$dt_val = strftime( "%Y-%m-%d %H:%M:%S", strtotime( $$value_name ) );
$filter_sql .= "weekday( E.StartTime ) ".$$op_name." weekday( '$dt_val' )";
$filter_query .= "&$op_name=".urlencode($$op_name);
$filter_fields .= '<input type="hidden" name="'.$op_name.'" value="'.$$op_name.'">'."\n";
break;
case 'Length':
case 'Frames':
case 'AlarmFrames':
case 'TotScore':
case 'AvgScore':
case 'MaxScore':
$filter_sql .= "E.".$$attr_name." ".$$op_name." ".$$value_name;
$filter_query .= "&$op_name=".urlencode($$op_name);
$filter_fields .= '<input type="hidden" name="'.$op_name.'" value="'.$$op_name.'">'."\n";
break;
case 'Archived':
$filter_sql .= "E.Archived = ".$$value_name;
break;
}
$filter_query .= "&$value_name=".urlencode($$value_name);
$filter_fields .= '<input type="hidden" name="'.$value_name.'" value="'.$$value_name.'">'."\n";
}
if ( isset($$cbracket_name) )
{
$filter_query .= "&$cbracket_name=".$$cbracket_name;
$filter_sql .= str_repeat( ")", $$cbracket_name );
$filter_fields .= '<input type="hidden" name="'.$cbracket_name.'" value="'.$$cbracket_name.'">'."\n";
}
$filter_query .= "&$obracket_name=".$$obracket_name;
$filter_sql .= str_repeat( "(", $$obracket_name );
$filter_fields .= '<input type="hidden" name="'.$obracket_name.'" value="'.$$obracket_name.'">'."\n";
}
if ( $filter_sql )
if ( isset($$attr_name) )
{
$count_sql .= " and ( $filter_sql )";
$events_sql .= " and ( $filter_sql )";
$filter_query .= "&$attr_name=".$$attr_name;
$filter_fields .= '<input type="hidden" name="'.$attr_name.'" value="'.$$attr_name.'">'."\n";
switch ( $$attr_name )
{
case 'DateTime':
$dt_val = strftime( "%Y-%m-%d %H:%M:%S", strtotime( $$value_name ) );
$filter_sql .= "E.StartTime ".$$op_name." '$dt_val'";
$filter_query .= "&$op_name=".urlencode($$op_name);
$filter_fields .= '<input type="hidden" name="'.$op_name.'" value="'.$$op_name.'">'."\n";
break;
case 'Date':
$dt_val = strftime( "%Y-%m-%d %H:%M:%S", strtotime( $$value_name ) );
$filter_sql .= "to_days( E.StartTime ) ".$$op_name." to_days( '$dt_val' )";
$filter_query .= "&$op_name=".urlencode($$op_name);
$filter_fields .= '<input type="hidden" name="'.$op_name.'" value="'.$$op_name.'">'."\n";
break;
case 'Time':
$dt_val = strftime( "%Y-%m-%d %H:%M:%S", strtotime( $$value_name ) );
$filter_sql .= "extract( hour_second from E.StartTime ) ".$$op_name." extract( hour_second from '$dt_val' )";
$filter_query .= "&$op_name=".urlencode($$op_name);
$filter_fields .= '<input type="hidden" name="'.$op_name.'" value="'.$$op_name.'">'."\n";
break;
case 'Weekday':
$dt_val = strftime( "%Y-%m-%d %H:%M:%S", strtotime( $$value_name ) );
$filter_sql .= "weekday( E.StartTime ) ".$$op_name." weekday( '$dt_val' )";
$filter_query .= "&$op_name=".urlencode($$op_name);
$filter_fields .= '<input type="hidden" name="'.$op_name.'" value="'.$$op_name.'">'."\n";
break;
case 'Length':
case 'Frames':
case 'AlarmFrames':
case 'TotScore':
case 'AvgScore':
case 'MaxScore':
$filter_sql .= "E.".$$attr_name." ".$$op_name." ".$$value_name;
$filter_query .= "&$op_name=".urlencode($$op_name);
$filter_fields .= '<input type="hidden" name="'.$op_name.'" value="'.$$op_name.'">'."\n";
break;
case 'Archived':
$filter_sql .= "E.Archived = ".$$value_name;
break;
}
$filter_query .= "&$value_name=".urlencode($$value_name);
$filter_fields .= '<input type="hidden" name="'.$value_name.'" value="'.$$value_name.'">'."\n";
}
$events_sql .= " order by $sort_column $sort_order";
if ( $page )
if ( isset($$cbracket_name) )
{
$events_sql .= " limit ".(($page-1)*EVENT_HEADER_LINES).", ".EVENT_HEADER_LINES;
$filter_query .= "&$cbracket_name=".$$cbracket_name;
$filter_sql .= str_repeat( ")", $$cbracket_name );
$filter_fields .= '<input type="hidden" name="'.$cbracket_name.'" value="'.$$cbracket_name.'">'."\n";
}
}
if ( $filter_sql )
{
$count_sql .= " and ( $filter_sql )";
$events_sql .= " and ( $filter_sql )";
}
$events_sql .= " order by $sort_column $sort_order";
if ( $page )
{
$events_sql .= " limit ".(($page-1)*EVENT_HEADER_LINES).", ".EVENT_HEADER_LINES;
}
?>
<html>
<head>
@ -206,8 +226,8 @@ function configureButton(form,name)
}
window.focus();
<?php
if ( isset($filter) )
{
if ( isset($filter) )
{
?>
//opener.location.reload(true);
filterWindow( '<?= $PHP_SELF ?>?view=filter&mid=<?= $mid ?>&page=<?= $page ?><?= $filter_query ?>', 'zmFilter<?= $monitor['Name'] ?>' );
@ -216,13 +236,13 @@ location.replace( '<?= $PHP_SELF ?>?view=events&mid=<?= $mid ?>&page=<?= $page ?
</head>
</html>
<?php
}
else
{
if ( !($result = mysql_query( $count_sql )) )
die( mysql_error() );
$row = mysql_fetch_assoc( $result );
$n_events = $row['EventCount'];
}
else
{
if ( !($result = mysql_query( $count_sql )) )
die( mysql_error() );
$row = mysql_fetch_assoc( $result );
$n_events = $row['EventCount'];
?>
</script>
</head>
@ -239,93 +259,93 @@ location.replace( '<?= $PHP_SELF ?>?view=events&mid=<?= $mid ?>&page=<?= $page ?
<tr>
<td align="left" class="text" width="20%"><b><?= $monitor['Name'] ?> - <?= sprintf( $zmClangEventCount, $n_events, zmVlang( $zmVlangEvent, $n_events ) ) ?></b></td>
<?php
$pages = (int)ceil($n_events/EVENT_HEADER_LINES);
if ( $pages <= 1 )
{
$pages = (int)ceil($n_events/EVENT_HEADER_LINES);
if ( $pages <= 1 )
{
?>
<td align="center" class="text" width="60%">&nbsp;</td>
<td align="center" class="text" width="10%">&nbsp;</td>
<?php
}
else
}
else
{
if ( $page )
{
if ( $page )
{
$max_shortcuts = 5;
$max_shortcuts = 5;
?>
<td align="center" class="text" width="34%">
<?php
if ( $page < 0 )
$page = 1;
if ( $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 )
{
?>
<a href="<?= $PHP_SELF ?>?view=events&mid=<?= $mid ?>&page=<?= $new_page ?>&<?= $filter_query ?><?= $sort_parms ?>&sort_field=<?= $sort_field ?>&sort_asc=<?= $sort_asc ?>"><?= $new_page ?></a>&nbsp;
<?php
}
}
}
?>
-&nbsp;<?= $page ?>&nbsp;-
<?php
if ( $page < $pages )
if ( $page < $pages )
{
$new_pages = array();
$pages_used = array();
$hi_exp = max(2,log($pages-$page)/log($max_shortcuts));
for ( $i = 0; $i < $max_shortcuts; $i++ )
{
$new_pages = array();
$pages_used = array();
$hi_exp = max(2,log($pages-$page)/log($max_shortcuts));
for ( $i = 0; $i < $max_shortcuts; $i++ )
{
$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 );
$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 )
{
?>
&nbsp;<a href="<?= $PHP_SELF ?>?view=events&mid=<?= $mid ?>&page=<?= $new_page ?>&<?= $filter_query ?><?= $sort_parms ?>&sort_field=<?= $sort_field ?>&sort_asc=<?= $sort_asc ?>"><?= $new_page ?></a>
<?php
}
}
}
?>
</td>
<td align="right" class="text" width="10%"><a href="<?= $PHP_SELF ?>?view=events&mid=<?= $mid ?>&page=0&<?= $filter_query ?><?= $sort_parms ?>&sort_field=<?= $sort_field ?>&sort_asc=<?= $sort_asc ?>"><?= $zmSlangViewAll ?></a></td>
<?php
}
else
{
}
else
{
?>
<td align="center" class="text" width="60%">&nbsp;</td>
<td align="center" class="text" width="10%"><a href="<?= $PHP_SELF ?>?view=events&mid=<?= $mid ?>&page=1&<?= $filter_query ?><?= $sort_parms ?>&sort_field=<?= $sort_field ?>&sort_asc=<?= $sort_asc ?>"><?= $zmSlangViewPaged ?></a></td>
<?php
}
}
}
?>
<td align="right" class="text" width="10%"><a href="javascript: closeWindow();"><?= $zmSlangClose ?></a></td>
</tr>
@ -338,14 +358,14 @@ location.replace( '<?= $PHP_SELF ?>?view=events&mid=<?= $mid ?>&page=<?= $page ?
<tr><td colspan="4" class="text">&nbsp;</td></tr>
<tr><td colspan="4"><table border="0" cellspacing="1" cellpadding="0" width="100%" bgcolor="#7F7FB2">
<?php
flush();
$count = 0;
if ( !($result = mysql_query( $events_sql )) )
die( mysql_error() );
while( $event = mysql_fetch_assoc( $result ) )
flush();
$count = 0;
if ( !($result = mysql_query( $events_sql )) )
die( mysql_error() );
while( $event = mysql_fetch_assoc( $result ) )
{
if ( ($count++%EVENT_HEADER_LINES) == 0 )
{
if ( ($count++%EVENT_HEADER_LINES) == 0 )
{
?>
<tr align="center" bgcolor="#FFFFFF">
<td class="text"><a href="<?= $PHP_SELF ?>?view=events&mid=<?= $mid ?>&page=1&<?= $filter_query ?><?= $sort_parms ?>&sort_field=Id&sort_asc=<?= $sort_field == 'Id'?!$sort_asc:0 ?>"><?= $zmSlangId ?><?php if ( $sort_field == "Id" ) if ( $sort_asc ) echo "(^)"; else echo "(v)"; ?></a></td>
@ -360,13 +380,13 @@ location.replace( '<?= $PHP_SELF ?>?view=events&mid=<?= $mid ?>&page=<?= $page ?
<td class="text">Mark</td>
</tr>
<?php
}
if ( $event['LearnState'] == '+' )
$bgcolor = "#98FB98";
elseif ( $event['LearnState'] == '-' )
$bgcolor = "#FFC0CB";
else
unset( $bgcolor );
}
if ( $event['LearnState'] == '+' )
$bgcolor = "#98FB98";
elseif ( $event['LearnState'] == '-' )
$bgcolor = "#FFC0CB";
else
unset( $bgcolor );
?>
<tr<?= ' bgcolor="'.(isset($bgcolor)?$bgcolor:"#FFFFFF").'"' ?> >
<td align="center" class="text"><a href="javascript: eventWindow( '<?= $PHP_SELF ?>?view=event&mid=<?= $mid ?>&eid=<?= $event['Id'] ?>&page=1', 'zmEvent' );"><?= $event['Id'] ?><?php if ( $event['Archived'] ) echo "*" ?></a></td>
@ -381,7 +401,7 @@ location.replace( '<?= $PHP_SELF ?>?view=events&mid=<?= $mid ?>&page=<?= $page ?
<td align="center" class="text"><input type="checkbox" name="mark_eids[]" value="<?= $event['Id'] ?>" onClick="configureButton( document.event_form, 'mark_eids' );"<?php if ( !canEdit( 'Events' ) ) { ?> disabled<?php } ?>></td>
</tr>
<?php
}
}
?>
</table></td></tr>
</table></td>
@ -392,5 +412,5 @@ location.replace( '<?= $PHP_SELF ?>?view=events&mid=<?= $mid ?>&page=<?= $page ?
</body>
</html>
<?php
}
}
?>

View File

@ -1,76 +1,96 @@
<?php
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 );
//
// ZoneMinder web filter view file, $Date$, $Revision$
// Copyright (C) 2003 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
$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;
}
}
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
);
?>
<html>
<head>
@ -79,89 +99,89 @@
<script language="JavaScript">
function newWindow(Url,Name,Width,Height)
{
var Name = window.open(Url,Name,"resizable,scrollbars,width="+Width+",height="+Height);
var Name = window.open(Url,Name,"resizable,scrollbars,width="+Width+",height="+Height);
}
function closeWindow()
{
top.window.close();
top.window.close();
}
function validateForm( form )
{
<?php
if ( $trms > 2 )
{
if ( $trms > 2 )
{
?>
var bracket_count = 0;
var bracket_count = 0;
<?php
for ( $i = 1; $i <= $trms; $i++ )
{
for ( $i = 1; $i <= $trms; $i++ )
{
?>
bracket_count += form.obr<?= $i ?>.value;
bracket_count -= form.cbr<?= $i ?>.value;
bracket_count += form.obr<?= $i ?>.value;
bracket_count -= form.cbr<?= $i ?>.value;
<?php
}
}
?>
if ( bracket_count )
{
alert( "<?= $zmSlangErrorBrackets ?>" );
return( false );
}
if ( bracket_count )
{
alert( "<?= $zmSlangErrorBrackets ?>" );
return( false );
}
<?php
}
}
?>
<?php
for ( $i = 1; $i <= $trms; $i++ )
{
for ( $i = 1; $i <= $trms; $i++ )
{
?>
if ( form.val<?= $i?>.value == '' )
{
alert( "<?= $zmSlangErrorValidValue ?>" );
return( false );
}
if ( form.val<?= $i?>.value == '' )
{
alert( "<?= $zmSlangErrorValidValue ?>" );
return( false );
}
<?php
}
}
?>
return( true );
return( true );
}
function submitToFilter( form )
{
form.target = window.name;
form.view.value = 'filter';
form.submit();
form.target = window.name;
form.view.value = 'filter';
form.submit();
}
function submitToEvents( form )
{
var Url = '<?= $PHP_SELF ?>';
var Name = 'zmEvents<?= $monitor['Name'] ?>';
var Width = <?= $jws['events']['w'] ?>;
var Height = <?= $jws['events']['h'] ?>;
var Options = 'resizable,scrollbars,width='+Width+',height='+Height;
var Url = '<?= $PHP_SELF ?>';
var Name = 'zmEvents<?= $monitor['Name'] ?>';
var Width = <?= $jws['events']['w'] ?>;
var Height = <?= $jws['events']['h'] ?>;
var Options = 'resizable,scrollbars,width='+Width+',height='+Height;
form.target = Name;
form.view.value = 'events';
form.submit();
form.target = Name;
form.view.value = 'events';
form.submit();
}
function saveFilter( form )
{
var Url = '<?= $PHP_SELF ?>';
var Name = 'zmEventsFilterSave';
var Width = <?= $jws['filtersave']['w'] ?>;
var Height = <?= $jws['filtersave']['h'] ?>;
var Options = 'resizable,scrollbars,width='+Width+',height='+Height;
var Url = '<?= $PHP_SELF ?>';
var Name = 'zmEventsFilterSave';
var Width = <?= $jws['filtersave']['w'] ?>;
var Height = <?= $jws['filtersave']['h'] ?>;
var Options = 'resizable,scrollbars,width='+Width+',height='+Height;
window.open( Url, Name, Options );
form.target = Name;
form.view.value = 'filtersave';
form.submit();
window.open( Url, Name, Options );
form.target = Name;
form.view.value = 'filtersave';
form.submit();
}
function deleteFilter( form, name, id )
{
if ( confirm( "<?= $zmSlangDeleteSavedFilter ?> '"+name+"'" ) )
{
form.action.value = 'delete';
form.fid.value = name;
submitToFilter( form );
}
if ( confirm( "<?= $zmSlangDeleteSavedFilter ?> '"+name+"'" ) )
{
form.action.value = 'delete';
form.fid.value = name;
submitToFilter( form );
}
}
window.focus();
</script>
@ -198,29 +218,29 @@ window.focus();
<td colspan="5">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<?php
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";
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";
?>
<tr>
<?php
if ( $i == 1 )
{
if ( $i == 1 )
{
?>
<td class="text">&nbsp;</td>
<?php
}
else
{
}
else
{
?>
<td class="text"><?= buildSelect( $conjunction_name, $conjunction_types ); ?></td>
<?php
}
}
?>
<td class="text"><?php if ( $trms > 2 ) { echo buildSelect( $obracket_name, $obracket_types ); } else { ?>&nbsp;<?php } ?></td>
<td class="text"><?= buildSelect( $attr_name, $attr_types, "$value_name.value = ''; submitToFilter( document.filter_form );" ); ?></td>
@ -237,7 +257,7 @@ window.focus();
<td class="text"><?php if ( $trms > 2 ) { echo buildSelect( $cbracket_name, $cbracket_types ); } else { ?>&nbsp;<?php } ?></td>
</tr>
<?php
}
}
?>
</table>
</td>

View File

@ -1,13 +1,33 @@
<?php
if ( !canEdit( 'Events' ) )
{
$view = "error";
return;
}
$result = mysql_query( "select * from Monitors where Id = '$mid'" );
if ( !$result )
die( mysql_error() );
$monitor = mysql_fetch_assoc( $result );
//
// ZoneMinder web filter save view file, $Date$, $Revision$
// Copyright (C) 2003 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
if ( !canEdit( 'Events' ) )
{
$view = "error";
return;
}
$result = mysql_query( "select * from Monitors where Id = '$mid'" );
if ( !$result )
die( mysql_error() );
$monitor = mysql_fetch_assoc( $result );
?>
<html>
<head>
@ -32,20 +52,20 @@ window.focus();
<input type="hidden" name="mid" value="<?= $mid ?>">
<input type="hidden" name="trms" value="<?= $trms ?>">
<?php
for ( $i = 1; $i <= $trms; $i++ )
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 ( $i > 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 )
{
?>
<input type="hidden" name="<?= $conjunction_name ?>" value="<?= $$conjunction_name ?>">
<?php
}
}
?>
<input type="hidden" name="<?= $obracket_name ?>" value="<?= isset($$obracket_name)?$$obracket_name:'' ?>">
<input type="hidden" name="<?= $cbracket_name ?>" value="<?= isset($$cbracket_name)?$$cbracket_name:'' ?>">
@ -53,23 +73,23 @@ window.focus();
<input type="hidden" name="<?= $op_name ?>" value="<?= isset($$op_name)?$$op_name:'' ?>">
<input type="hidden" name="<?= $value_name ?>" value="<?= isset($$value_name)?$$value_name:'' ?>">
<?php
}
}
?>
<center><table width="96%" align="center" border="0" cellspacing="1" cellpadding="0">
<tr>
<?php
$select_name = "filter_name";
$result = mysql_query( "select * from Filters where MonitorId = '$mid' order by Name" );
if ( !$result )
die( mysql_error() );
while ( $row = mysql_fetch_assoc( $result ) )
$select_name = "filter_name";
$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_names[$row['Name']] = $row['Name'];
if ( $filter_name == $row['Name'] )
{
$filter_data = $row;
}
$filter_data = $row;
}
}
?>
<?php if ( count($filter_names) ) { ?>
<td align="left" colspan="2" class="text"><?= $zmSlangSaveAs ?>:&nbsp;<?= buildSelect( $select_name, $filter_names, "submitToFilter( document.filter_form );" ); ?>&nbsp;<?= $zmSlangOrEnterNewName ?>:&nbsp;<input type="text" size="32" name="new_<?= $select_name ?>" value="<?= $filter_name ?>" class="form"></td>

View File

@ -1,48 +1,68 @@
<?php
if ( !canView( 'Events' ) )
{
$view = "error";
return;
}
$result = mysql_query( "select E.*,M.Name as MonitorName,M.Width,M.Height from Events as E, Monitors as M where E.Id = '$eid' and E.MonitorId = M.Id" );
//
// ZoneMinder web frame view file, $Date$, $Revision$
// Copyright (C) 2003 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
if ( !canView( 'Events' ) )
{
$view = "error";
return;
}
$result = mysql_query( "select E.*,M.Name as MonitorName,M.Width,M.Height from Events as E, Monitors as M where E.Id = '$eid' and E.MonitorId = M.Id" );
if ( !$result )
die( mysql_error() );
$event = mysql_fetch_assoc( $result );
if ( $fid )
{
$result = mysql_query( "select * from Frames where EventID = '$eid' and FrameId = '$fid'" );
if ( !$result )
die( mysql_error() );
$event = mysql_fetch_assoc( $result );
if ( $fid )
{
$result = mysql_query( "select * from Frames where EventID = '$eid' and FrameId = '$fid'" );
if ( !$result )
die( mysql_error() );
$frame = mysql_fetch_assoc( $result );
}
else
{
$result = mysql_query( "select * from Frames where EventID = '$eid' and Score = '".$event['MaxScore']."'" );
if ( !$result )
die( mysql_error() );
$frame = mysql_fetch_assoc( $result );
$fid = $frame['FrameId'];
}
$result = mysql_query( "select count(*) as FrameCount from Frames where EventID = '$eid'" );
$frame = mysql_fetch_assoc( $result );
}
else
{
$result = mysql_query( "select * from Frames where EventID = '$eid' and Score = '".$event['MaxScore']."'" );
if ( !$result )
die( mysql_error() );
$row = mysql_fetch_assoc( $result );
$max_fid = $row['FrameCount'];
$frame = mysql_fetch_assoc( $result );
$fid = $frame['FrameId'];
}
$first_fid = 1;
$prev_fid = $fid-1;
$next_fid = $fid+1;
$last_fid = $max_fid;
$result = mysql_query( "select count(*) as FrameCount from Frames where EventID = '$eid'" );
if ( !$result )
die( mysql_error() );
$row = mysql_fetch_assoc( $result );
$max_fid = $row['FrameCount'];
$first_fid = 1;
$prev_fid = $fid-1;
$next_fid = $fid+1;
$last_fid = $max_fid;
$image_path = $frame['ImagePath'];
$anal_image = preg_replace( "/capture/", "analyse", $image_path );
if ( file_exists( $anal_image ) )
{
$image_path = $anal_image;
}
$img_class = $frame['AlarmFrame']?"alarm":"normal";
$image_path = $frame['ImagePath'];
$anal_image = preg_replace( "/capture/", "analyse", $image_path );
if ( file_exists( $anal_image ) )
{
$image_path = $anal_image;
}
$img_class = $frame['AlarmFrame']?"alarm":"normal";
?>
<html>
<head>

View File

@ -1,16 +1,35 @@
<?php
if ( !canView( 'Events' ) )
{
$view = "error";
return;
}
$result = mysql_query( "select F.*,unix_timestamp(F.TimeStamp) as UnixTimeStamp,E.*,M.Name as MonitorName,M.Width,M.Height from Frames as F left join Events as E on F.EventId = E.Id left join Monitors as M on E.MonitorId = M.Id where F.EventId = '$eid' order by F.FrameId" );
if ( !$result )
die( mysql_error() );
while ( $row = mysql_fetch_assoc( $result ) )
{
$frames[] = $row;
}
//
// ZoneMinder web frames view file, $Date$, $Revision$
// Copyright (C) 2003 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
if ( !canView( 'Events' ) )
{
$view = "error";
return;
}
$result = mysql_query( "select F.*,unix_timestamp(F.TimeStamp) as UnixTimeStamp,E.*,M.Name as MonitorName,M.Width,M.Height from Frames as F left join Events as E on F.EventId = E.Id left join Monitors as M on E.MonitorId = M.Id where F.EventId = '$eid' order by F.FrameId" );
if ( !$result )
die( mysql_error() );
while ( $row = mysql_fetch_assoc( $result ) )
{
$frames[] = $row;
}
?>
<html>
<head>
@ -42,10 +61,10 @@ function closeWindow()
<td class="smallhead" align="center"><?= $zmSlangScore ?></td>
</tr>
<?php
if ( count($frames) )
if ( count($frames) )
{
foreach ( $frames as $frame )
{
foreach ( $frames as $frame )
{
?>
<tr bgcolor="<?= $frame['AlarmFrame']?'#FA8072':'#FFFFFF' ?>">
<td class="text" align="center"><?= $frame['FrameId'] ?></td>
@ -53,31 +72,31 @@ function closeWindow()
<td class="text" align="center"><?= date( "H:i:s", $frame['UnixTimeStamp'] ) ?></td>
<td class="text" align="center"><?= number_format( $frame['Delta'], 2 ) ?></td>
<?php
if ( ZM_RECORD_EVENT_STATS && $frame['AlarmFrame'] )
{
if ( ZM_RECORD_EVENT_STATS && $frame['AlarmFrame'] )
{
?>
<td class="text" align="center"><a href="javascript: newWindow( '<?= $PHP_SELF ?>?view=stats&eid=<?= $eid ?>&fid=<?= $frame['FrameId'] ?>', 'zmStats', <?= $jws['stats']['w'] ?>, <?= $jws['stats']['h'] ?> );"><?= $frame['Score'] ?></a></td>
<?php
}
else
{
}
else
{
?>
<td class="text" align="center"><?= $frame['Score'] ?></td>
<?php
}
}
?>
</tr>
<?php
}
}
else
{
}
else
{
?>
<tr bgcolor="#FFFFFF">
<td class="text" colspan="8" align="center"><br><?= $zmSlangNoFramesRecorded ?><br><br></td>
</tr>
<?php
}
}
?>
</table></td>
</tr>

View File

@ -1,13 +1,33 @@
<?php
if ( !canEdit( 'Monitors' ) )
{
$view = "error";
return;
}
$result = mysql_query( "select * from Monitors where Id = '$mid'" );
if ( !$result )
die( mysql_error() );
$monitor = mysql_fetch_assoc( $result );
//
// ZoneMinder web function view file, $Date$, $Revision$
// Copyright (C) 2003 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
if ( !canEdit( 'Monitors' ) )
{
$view = "error";
return;
}
$result = mysql_query( "select * from Monitors where Id = '$mid'" );
if ( !$result )
die( mysql_error() );
$monitor = mysql_fetch_assoc( $result );
?>
<html>
<head>
@ -15,12 +35,12 @@
<link rel="stylesheet" href="zm_styles.css" type="text/css">
<script language="JavaScript">
<?php
if ( !empty($refresh_parent) )
{
if ( !empty($refresh_parent) )
{
?>
opener.location.reload(true);
<?php
}
}
?>
window.focus();
function refreshWindow()
@ -45,12 +65,12 @@ function closeWindow()
<input type="hidden" name="mid" value="<?= $mid ?>">
<td colspan="2" align="center"><select name="new_function" class="form">
<?php
foreach ( getEnumValues( 'Monitors', 'Function' ) as $opt_function )
{
foreach ( getEnumValues( 'Monitors', 'Function' ) as $opt_function )
{
?>
<option value="<?= $opt_function ?>"<?php if ( $opt_function == $monitor['Function'] ) { ?> selected<?php } ?>><?= $opt_function ?></option>
<?php
}
}
?>
</select></td>
</tr>

View File

@ -1,3 +1,24 @@
<?php
//
// ZoneMinder web login view file, $Date$, $Revision$
// Copyright (C) 2003 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
?>
<html>
<head>
<title>ZM - <?= $zmSlangLogin ?></title>

View File

@ -1,3 +1,24 @@
<?php
//
// ZoneMinder web logout view file, $Date$, $Revision$
// Copyright (C) 2003 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
?>
<html>
<head>
<title>ZM - <?= $zmSlangLogout ?></title>

View File

@ -1,77 +1,97 @@
<?php
if ( !canView( 'Monitors' ) )
{
$view = "error";
return;
}
//
// ZoneMinder web monitor view file, $Date$, $Revision$
// Copyright (C) 2003 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
$tabs = array();
$tabs["monitor"] = $zmSlangMonitor;
$tabs["source"] = $zmSlangSource;
$tabs["timestamp"] = $zmSlangTimestamp;
$tabs["buffers"] = $zmSlangBuffers;
$tabs["misc"] = $zmSlangMisc;
if ( !canView( 'Monitors' ) )
{
$view = "error";
return;
}
$tabs = array();
$tabs["monitor"] = $zmSlangMonitor;
$tabs["source"] = $zmSlangSource;
$tabs["timestamp"] = $zmSlangTimestamp;
$tabs["buffers"] = $zmSlangBuffers;
$tabs["misc"] = $zmSlangMisc;
if ( ZM_OPT_X10 )
{
$tabs["x10"] = $zmSlangX10;
}
if ( !isset($tab) )
$tab = "monitor";
if ( !empty($mid) )
{
$result = mysql_query( "select * from Monitors where Id = '$mid'" );
if ( !$result )
die( mysql_error() );
$monitor = mysql_fetch_assoc( $result );
if ( ZM_OPT_X10 )
{
$tabs["x10"] = $zmSlangX10;
}
if ( !isset($tab) )
$tab = "monitor";
if ( !empty($mid) )
{
$result = mysql_query( "select * from Monitors where Id = '$mid'" );
$result = mysql_query( "select * from TriggersX10 where MonitorId = '$mid'" );
if ( !$result )
die( mysql_error() );
$monitor = mysql_fetch_assoc( $result );
if ( ZM_OPT_X10 )
{
$result = mysql_query( "select * from TriggersX10 where MonitorId = '$mid'" );
if ( !$result )
die( mysql_error() );
$x10_monitor = mysql_fetch_assoc( $result );
}
$x10_monitor = mysql_fetch_assoc( $result );
}
else
{
$monitor = array();
$monitor['Name'] = $zmSlangNew;
$monitor['Function'] = "None";
$monitor['RunMode'] = "Continuous";
$monitor['Type'] = "Local";
$monitor['Device'] = "";
$monitor['Channel'] = "";
$monitor['Format'] = "";
$monitor['Host'] = "";
$monitor['Path'] = "";
$monitor['Port'] = "80";
$monitor['Width'] = "";
$monitor['Height'] = "";
$monitor['Orientation'] = "0";
$monitor['LabelFormat'] = '%%s - %y/%m/%d %H:%M:%S';
$monitor['LabelX'] = 0;
$monitor['LabelY'] = 0;
$monitor['ImageBufferCount'] = 100;
$monitor['WarmupCount'] = 25;
$monitor['PreEventCount'] = 10;
$monitor['PostEventCount'] = 10;
$monitor['SectionLength'] = 600;
$monitor['FrameSkip'] = 0;
$monitor['MaxFPS'] = 0;
$monitor['FPSReportInterval'] = 1000;
$monitor['RefBlendPerc'] = 10;
$monitor['Triggers'] = "";
}
if ( !isset( $new_monitor ) )
{
$new_monitor = $monitor;
$new_monitor['Triggers'] = split( ',', isset($monitor['Triggers'])?$monitor['Triggers']:"" );
$new_x10_monitor = isset($x10_monitor)?$x10_monitor:array();
}
$local_palettes = array( $zmSlangGrey=>1, "RGB24"=>4, "RGB565"=>3, "RGB555"=>6, "YUV422P"=>13, "YUV420P"=>15 );
$remote_palettes = array( $zmSlang8BitGrey=>1, $zmSlang24BitColour=>4 );
$orientations = array( $zmSlangNormal=>0, $zmSlangRotateRight=>90, $zmSlangInverted=>180, $zmSlangRotateLeft=>270 );
}
else
{
$monitor = array();
$monitor['Name'] = $zmSlangNew;
$monitor['Function'] = "None";
$monitor['RunMode'] = "Continuous";
$monitor['Type'] = "Local";
$monitor['Device'] = "";
$monitor['Channel'] = "";
$monitor['Format'] = "";
$monitor['Host'] = "";
$monitor['Path'] = "";
$monitor['Port'] = "80";
$monitor['Width'] = "";
$monitor['Height'] = "";
$monitor['Orientation'] = "0";
$monitor['LabelFormat'] = '%%s - %y/%m/%d %H:%M:%S';
$monitor['LabelX'] = 0;
$monitor['LabelY'] = 0;
$monitor['ImageBufferCount'] = 100;
$monitor['WarmupCount'] = 25;
$monitor['PreEventCount'] = 10;
$monitor['PostEventCount'] = 10;
$monitor['SectionLength'] = 600;
$monitor['FrameSkip'] = 0;
$monitor['MaxFPS'] = 0;
$monitor['FPSReportInterval'] = 1000;
$monitor['RefBlendPerc'] = 10;
$monitor['Triggers'] = "";
}
if ( !isset( $new_monitor ) )
{
$new_monitor = $monitor;
$new_monitor['Triggers'] = split( ',', isset($monitor['Triggers'])?$monitor['Triggers']:"" );
$new_x10_monitor = isset($x10_monitor)?$x10_monitor:array();
}
$local_palettes = array( $zmSlangGrey=>1, "RGB24"=>4, "RGB565"=>3, "RGB555"=>6, "YUV422P"=>13, "YUV420P"=>15 );
$remote_palettes = array( $zmSlang8BitGrey=>1, $zmSlang24BitColour=>4 );
$orientations = array( $zmSlangNormal=>0, $zmSlangRotateRight=>90, $zmSlangInverted=>180, $zmSlangRotateLeft=>270 );
?>
<html>
<head>
@ -79,12 +99,12 @@
<link rel="stylesheet" href="zm_styles.css" type="text/css">
<script language="JavaScript">
<?php
if ( !empty($refresh_parent) )
{
if ( !empty($refresh_parent) )
{
?>
opener.location.reload(true);
<?php
}
}
?>
window.focus();
function validateForm(Form)
@ -117,21 +137,21 @@ function closeWindow()
<table border="0" cellspacing="0" cellpadding="4" width="100%">
<tr>
<?php
foreach ( $tabs as $name=>$value )
foreach ( $tabs as $name=>$value )
{
if ( $tab == $name )
{
if ( $tab == $name )
{
?>
<td width="10" class="activetab"><?= $value ?></td>
<?php
}
else
{
}
else
{
?>
<td width="10" class="passivetab"><a href="javascript: submitTab( document.monitor_form, '<?= $name ?>' );"><?= $value ?></a></td>
<?php
}
}
}
?>
<td class="nontab">&nbsp;</td>
</tr>
@ -143,8 +163,8 @@ function closeWindow()
<input type="hidden" name="action" value="monitor">
<input type="hidden" name="mid" value="<?= $mid ?>">
<?php
if ( $tab != 'monitor' )
{
if ( $tab != 'monitor' )
{
?>
<input type="hidden" name="new_monitor[Name]" value="<?= $new_monitor['Name'] ?>">
<input Type="hidden" name="new_monitor[Type]" value="<?= $new_monitor['Type'] ?>">
@ -153,18 +173,18 @@ function closeWindow()
<input type="hidden" name="new_monitor[FrameSkip]" value="<?= $new_monitor['FrameSkip'] ?>">
<input type="hidden" name="new_monitor[RunMode]" value="<?= $new_monitor['RunMode'] ?>">
<?php
if ( isset($new_monitor['Triggers']) )
if ( isset($new_monitor['Triggers']) )
{
foreach( $new_monitor['Triggers'] as $new_trigger )
{
foreach( $new_monitor['Triggers'] as $new_trigger )
{
?>
<input type="hidden" name="new_monitor[Triggers][]" value="<?= $new_trigger ?>">
<?php
}
}
}
if ( $tab != 'source' )
{
}
if ( $tab != 'source' )
{
?>
<input type="hidden" name="new_monitor[Device]" value="<?= $new_monitor['Device'] ?>">
<input type="hidden" name="new_monitor[Channel]" value="<?= $new_monitor['Channel'] ?>">
@ -177,171 +197,171 @@ function closeWindow()
<input type="hidden" name="new_monitor[Height]" value="<?= $new_monitor['Height'] ?>">
<input type="hidden" name="new_monitor[Orientation]" value="<?= $new_monitor['Orientation'] ?>">
<?php
}
if ( $tab != 'timestamp' )
{
}
if ( $tab != 'timestamp' )
{
?>
<input type="hidden" name="new_monitor[LabelFormat]" value="<?= $new_monitor['LabelFormat'] ?>">
<input type="hidden" name="new_monitor[LabelX]" value="<?= $new_monitor['LabelX'] ?>">
<input type="hidden" name="new_monitor[LabelY]" value="<?= $new_monitor['LabelY'] ?>">
<?php
}
if ( $tab != 'buffers' )
{
}
if ( $tab != 'buffers' )
{
?>
<input type="hidden" name="new_monitor[ImageBufferCount]" value="<?= $new_monitor['ImageBufferCount'] ?>">
<input type="hidden" name="new_monitor[WarmupCount]" value="<?= $new_monitor['WarmupCount'] ?>">
<input type="hidden" name="new_monitor[PreEventCount]" value="<?= $new_monitor['PreEventCount'] ?>">
<input type="hidden" name="new_monitor[PostEventCount]" value="<?= $new_monitor['PostEventCount'] ?>">
<?php
}
if ( $tab != 'misc' )
{
}
if ( $tab != 'misc' )
{
?>
<input type="hidden" name="new_monitor[MaxFPS]" value="<?= $new_monitor['MaxFPS'] ?>">
<input type="hidden" name="new_monitor[FPSReportInterval]" value="<?= $new_monitor['FPSReportInterval'] ?>">
<input type="hidden" name="new_monitor[RefBlendPerc]" value="<?= $new_monitor['RefBlendPerc'] ?>">
<?php
}
if ( ZM_OPT_X10 && $tab != 'x10' )
{
}
if ( ZM_OPT_X10 && $tab != 'x10' )
{
?>
<input type="hidden" name="new_x10_monitor[Activation]" value="<?= $new_x10_monitor['Activation'] ?>">
<input type="hidden" name="new_x10_monitor[AlarmInput]" value="<?= $new_x10_monitor['AlarmInput'] ?>">
<input type="hidden" name="new_x10_monitor[AlarmOutput]" value="<?= $new_x10_monitor['AlarmOutput'] ?>">
<?php
}
}
?>
<tr>
<td align="left" class="smallhead" width="70%"><?= $zmSlangParameter ?></td><td align="left" class="smallhead" width="30%"><?= $zmSlangValue ?></td>
</tr>
<?php
switch ( $tab )
switch ( $tab )
{
case 'monitor' :
{
case 'monitor' :
{
?>
<tr><td align="left" class="text"><?= $zmSlangName ?></td><td align="left" class="text"><input type="text" name="new_monitor[Name]" value="<?= $new_monitor['Name'] ?>" size="16" class="form"></td></tr>
<tr><td align="left" class="text"><?= $zmSlangFunction ?></td><td align="left" class="text"><select name="new_monitor[Function]" class="form">
<?php
foreach ( getEnumValues( 'Monitors', 'Function' ) as $opt_function )
{
foreach ( getEnumValues( 'Monitors', 'Function' ) as $opt_function )
{
?>
<option value="<?= $opt_function ?>"<?php if ( $opt_function == $new_monitor['Function'] ) { ?> selected<?php } ?>><?= $opt_function ?></option>
<?php
}
}
?>
</select></td></tr>
<tr><td align="left" class="text"><?= $zmSlangSectionlength ?></td><td align="left" class="text"><input type="text" name="new_monitor[SectionLength]" value="<?= $new_monitor['SectionLength'] ?>" size="6" class="form"></td></tr>
<tr><td align="left" class="text"><?= $zmSlangFrameSkip ?></td><td align="left" class="text"><input type="text" name="new_monitor[FrameSkip]" value="<?= $new_monitor['FrameSkip'] ?>" size="6" class="form"></td></tr>
<tr><td align="left" class="text"><?= $zmSlangRunMode ?></td><td align="left" class="text"><select name="new_monitor[RunMode]" class="form">
<?php
foreach ( getEnumValues( 'Monitors', 'RunMode' ) as $opt_runmode )
{
foreach ( getEnumValues( 'Monitors', 'RunMode' ) as $opt_runmode )
{
?>
<option value="<?= $opt_runmode ?>"<?php if ( $opt_runmode == $new_monitor['RunMode'] ) { ?> selected<?php } ?>><?= $opt_runmode ?></option>
<?php
}
}
?>
</select></td></tr>
<tr><td align="left" class="text"><?= $zmSlangTriggers ?></td><td align="left" class="text">
<?php
$opt_triggers = getSetValues( 'Monitors', 'Triggers' );
$break_count = (int)(ceil(count($opt_triggers)));
$break_count = min( 3, $break_count );
$opt_count = 0;
foreach( $opt_triggers as $opt_trigger )
{
if ( !ZM_OPT_X10 && $opt_trigger == 'X10' )
continue;
if ( $opt_count && ($opt_count%$break_count == 0) )
echo "</br>";
$opt_triggers = getSetValues( 'Monitors', 'Triggers' );
$break_count = (int)(ceil(count($opt_triggers)));
$break_count = min( 3, $break_count );
$opt_count = 0;
foreach( $opt_triggers as $opt_trigger )
{
if ( !ZM_OPT_X10 && $opt_trigger == 'X10' )
continue;
if ( $opt_count && ($opt_count%$break_count == 0) )
echo "</br>";
?>
<input type="checkbox" name="new_monitor[Triggers][]" value="<?= $opt_trigger ?>" class="form-noborder"<?php if ( isset($new_monitor['Triggers']) && in_array( $opt_trigger, $new_monitor['Triggers'] ) ) { ?> checked<?php } ?>><?= $opt_trigger ?>
<?php
$opt_count ++;
}
if ( !$opt_count )
{
$opt_count ++;
}
if ( !$opt_count )
{
?>
<em><?= $zmSlangNoneAvailable ?></em>
<?php
}
}
?>
</td></tr>
<?php
$select_name = "new_monitor[Type]";
$source_types = array( 'Local'=>$zmSlangLocal, 'Remote'=>$zmSlangRemote );
$select_name = "new_monitor[Type]";
$source_types = array( 'Local'=>$zmSlangLocal, 'Remote'=>$zmSlangRemote );
?>
<tr><td align="left" class="text"><?= $zmSlangSourceType ?></td><td><?= buildSelect( $select_name, $source_types ); ?></td></tr>
<?php
break;
}
case 'source' :
break;
}
case 'source' :
{
if ( $new_monitor['Type'] == "Local" )
{
if ( $new_monitor['Type'] == "Local" )
{
?>
<tr><td align="left" class="text"><?= $zmSlangDeviceNumber ?></td><td align="left" class="text"><input type="text" name="new_monitor[Device]" value="<?= $new_monitor['Device'] ?>" size="4" class="form"></td></tr>
<tr><td align="left" class="text"><?= $zmSlangDeviceNumber ?></td><td align="left" class="text"><input type="text" name="new_monitor[Channel]" value="<?= $new_monitor['Channel'] ?>" size="4" class="form"></td></tr>
<tr><td align="left" class="text"><?= $zmSlangDeviceFormat ?></td><td align="left" class="text"><input type="text" name="new_monitor[Format]" value="<?= $new_monitor['Format'] ?>" size="4" class="form"></td></tr>
<tr><td align="left" class="text"><?= $zmSlangCapturePalette ?></td><td align="left" class="text"><select name="new_monitor[Palette]" class="form"><?php foreach ( $local_palettes as $name => $value ) { ?><option value="<?= $value ?>"<?php if ( $value == $new_monitor['Palette'] ) { ?> selected<?php } ?>><?= $name ?></option><?php } ?></select></td></tr>
<?php
}
else
{
}
else
{
?>
<tr><td align="left" class="text"><?= $zmSlangRemoteHostName ?></td><td align="left" class="text"><input type="text" name="new_monitor[Host]" value="<?= $new_monitor['Host'] ?>" size="16" class="form"></td></tr>
<tr><td align="left" class="text"><?= $zmSlangRemoteHostPort ?></td><td align="left" class="text"><input type="text" name="new_monitor[Port]" value="<?= $new_monitor['Port'] ?>" size="6" class="form"></td></tr>
<tr><td align="left" class="text"><?= $zmSlangRemoteHostPath ?></td><td align="left" class="text"><input type="text" name="new_monitor[Path]" value="<?= $new_monitor['Path'] ?>" size="36" class="form"></td></tr>
<tr><td align="left" class="text"><?= $zmSlangRemoteImageColours ?></td><td align="left" class="text"><select name="new_monitor[Palette]" class="form"><?php foreach ( $remote_palettes as $name => $value ) { ?><option value="<?= $value ?>"<?php if ( $value == $new_monitor['Palette'] ) { ?> selected<?php } ?>><?= $name ?></option><?php } ?></select></td></tr>
<?php
}
}
?>
<tr><td align="left" class="text"><?= $zmSlangCaptureWidth ?> (<?= $zmSlangPixels ?>)</td><td align="left" class="text"><input type="text" name="new_monitor[Width]" value="<?= $new_monitor['Width'] ?>" size="4" class="form"></td></tr>
<tr><td align="left" class="text"><?= $zmSlangCaptureHeight ?> (<?= $zmSlangPixels ?>)</td><td align="left" class="text"><input type="text" name="new_monitor[Height]" value="<?= $new_monitor['Height'] ?>" size="4" class="form"></td></tr>
<tr><td align="left" class="text"><?= $zmSlangOrientation ?></td><td align="left" class="text"><select name="new_monitor[Orientation]" class="form"><?php foreach ( $orientations as $name => $value ) { ?><option value="<?= $value ?>"<?php if ( $value == $new_monitor['Orientation'] ) { ?> selected<?php } ?>><?= $name ?></option><?php } ?></select></td></tr>
<?php
break;
}
case 'timestamp' :
{
break;
}
case 'timestamp' :
{
?>
<tr><td align="left" class="text"><?= $zmSlangTimestampLabelFormat ?></td><td align="left" class="text"><input type="text" name="new_monitor[LabelFormat]" value="<?= $new_monitor['LabelFormat'] ?>" size="20" class="form"></td></tr>
<tr><td align="left" class="text"><?= $zmSlangTimestampLabelX ?></td><td align="left" class="text"><input type="text" name="new_monitor[LabelX]" value="<?= $new_monitor['LabelX'] ?>" size="4" class="form"></td></tr>
<tr><td align="left" class="text"><?= $zmSlangTimestampLabelY ?></td><td align="left" class="text"><input type="text" name="new_monitor[LabelY]" value="<?= $new_monitor['LabelY'] ?>" size="4" class="form"></td></tr>
<?php
break;
}
case 'buffers' :
{
break;
}
case 'buffers' :
{
?>
<tr><td align="left" class="text"><?= $zmSlangImageBufferSize ?> (<?= strtolower($zmSlangFrames) ?>)</td><td align="left" class="text"><input type="text" name="new_monitor[ImageBufferCount]" value="<?= $new_monitor['ImageBufferCount'] ?>" size="6" class="form"></td></tr>
<tr><td align="left" class="text"><?= $zmSlangWarmupFrames ?></td><td align="left" class="text"><input type="text" name="new_monitor[WarmupCount]" value="<?= $new_monitor['WarmupCount'] ?>" size="4" class="form"></td></tr>
<tr><td align="left" class="text"><?= $zmSlangPreEventImageBuffer ?></td><td align="left" class="text"><input type="text" name="new_monitor[PreEventCount]" value="<?= $new_monitor['PreEventCount'] ?>" size="4" class="form"></td></tr>
<tr><td align="left" class="text"><?= $zmSlangPostEventImageBuffer ?></td><td align="left" class="text"><input type="text" name="new_monitor[PostEventCount]" value="<?= $new_monitor['PostEventCount'] ?>" size="4" class="form"></td></tr>
<?php
break;
}
case 'misc' :
{
break;
}
case 'misc' :
{
?>
<tr><td align="left" class="text"><?= $zmSlangMaximumFPS ?></td><td align="left" class="text"><input type="text" name="new_monitor[MaxFPS]" value="<?= $new_monitor['MaxFPS'] ?>" size="6" class="form"></td></tr>
<tr><td align="left" class="text"><?= $zmSlangFPSReportInterval ?></td><td align="left" class="text"><input type="text" name="new_monitor[FPSReportInterval]" value="<?= $new_monitor['FPSReportInterval'] ?>" size="6" class="form"></td></tr>
<tr><td align="left" class="text"><?= $zmSlangRefImageBlendPct ?></td><td align="left" class="text"><input type="text" name="new_monitor[RefBlendPerc]" value="<?= $new_monitor['RefBlendPerc'] ?>" size="4" class="form"></td></tr>
<?php
break;
}
case 'x10' :
{
break;
}
case 'x10' :
{
?>
<tr><td align="left" class="text"><?= $zmSlangX10ActivationString ?></td><td align="left" class="text"><input type="text" name="new_x10_monitor[Activation]" value="<?= $new_x10_monitor['Activation'] ?>" size="20" class="form"></td></tr>
<tr><td align="left" class="text"><?= $zmSlangX10InputAlarmString ?></td><td align="left" class="text"><input type="text" name="new_x10_monitor[AlarmInput]" value="<?= $new_x10_monitor['AlarmInput'] ?>" size="20" class="form"></td></tr>
<tr><td align="left" class="text"><?= $zmSlangX10OutputAlarmString ?></td><td align="left" class="text"><input type="text" name="new_x10_monitor[AlarmOutput]" value="<?= $new_x10_monitor['AlarmOutput'] ?>" size="20" class="form"></td></tr>
<?php
break;
}
break;
}
}
?>
<tr><td colspan="2" align="left" class="text">&nbsp;</td></tr>
<tr>

View File

@ -1,36 +1,56 @@
<?php
if ( !canView( 'Stream' ) )
//
// ZoneMinder web montage view file, $Date$, $Revision$
// Copyright (C) 2003 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
if ( !canView( 'Stream' ) )
{
$view = "error";
return;
}
$result = mysql_query( "select * from Monitors where Function != 'None' order by Id" );
$monitors = array();
while( $row = mysql_fetch_assoc( $result ) )
{
if ( !visibleMonitor( $row['Id'] ) )
{
$view = "error";
return;
continue;
}
$result = mysql_query( "select * from Monitors where Function != 'None' order by Id" );
$monitors = array();
while( $row = mysql_fetch_assoc( $result ) )
{
if ( !visibleMonitor( $row['Id'] ) )
{
continue;
}
$monitors[] = $row;
}
$rows = intval(ceil(count($monitors)/ZM_WEB_MONTAGE_MAX_COLS));
$cols = count($monitors)>=ZM_WEB_MONTAGE_MAX_COLS?ZM_WEB_MONTAGE_MAX_COLS:count($monitors);
$widths = array();
$heights = array();
for ( $i = 0; $i < count($monitors); $i++ )
{
$monitor = $monitors[$i];
$frame_height = $monitor['Height']+16;
$row = $i/ZM_WEB_MONTAGE_MAX_COLS;
$col = $i%ZM_WEB_MONTAGE_MAX_COLS;
if ( empty( $heights[$row] ) || $frame_height > $heights[$row] )
$heights[$row] = $frame_height;
if ( empty( $widths[$col] ) || $monitor['Width'] > $widths[$col] )
$widths[$col] = $monitor['Width'];
}
$row_spec = join( ',', $heights );
$col_spec = join( ',', $widths );
$monitors[] = $row;
}
$rows = intval(ceil(count($monitors)/ZM_WEB_MONTAGE_MAX_COLS));
$cols = count($monitors)>=ZM_WEB_MONTAGE_MAX_COLS?ZM_WEB_MONTAGE_MAX_COLS:count($monitors);
$widths = array();
$heights = array();
for ( $i = 0; $i < count($monitors); $i++ )
{
$monitor = $monitors[$i];
$frame_height = $monitor['Height']+16;
$row = $i/ZM_WEB_MONTAGE_MAX_COLS;
$col = $i%ZM_WEB_MONTAGE_MAX_COLS;
if ( empty( $heights[$row] ) || $frame_height > $heights[$row] )
$heights[$row] = $frame_height;
if ( empty( $widths[$col] ) || $monitor['Width'] > $widths[$col] )
$widths[$col] = $monitor['Width'];
}
$row_spec = join( ',', $heights );
$col_spec = join( ',', $widths );
?>
<html>
<head>
@ -43,22 +63,22 @@ window.focus();
</head>
<frameset rows="<?= $row_spec ?>" cols="<?= $col_spec ?>" border="1" frameborder="no" framespacing="0">
<?php
for ( $row = 0; $row < $rows; $row++ )
for ( $row = 0; $row < $rows; $row++ )
{
for ( $col = 0; $col < $cols; $col++ )
{
for ( $col = 0; $col < $cols; $col++ )
$i = ($row*$cols)+$col;
if ( $i < count($monitors) )
{
$i = ($row*$cols)+$col;
if ( $i < count($monitors) )
{
$monitor = $monitors[$i];
$monitor = $monitors[$i];
?>
<frameset rows="*,16" cols="100%" border="1" frameborder="no" framespacing="0">
<frame src="<?= $PHP_SELF ?>?view=montagefeed&mid=<?= $monitor['Id'] ?>" marginwidth="0" marginheight="0" name="MonitorStream" scrolling="no">
<frame src="<?= $PHP_SELF ?>?view=montagestatus&mid=<?= $monitor['Id'] ?>" marginwidth="0" marginheight="0" name="MonitorStatus" scrolling="no">
</frameset>
<?php
}
}
}
}
?>
</frameset>

View File

@ -1,36 +1,56 @@
<?php
if ( !canView( 'Stream' ) )
{
$view = "error";
return;
}
if ( !isset($mode) )
{
if ( canStream() )
$mode = "stream";
else
$mode = "still";
}
//
// ZoneMinder web montage feed view file, $Date$, $Revision$
// Copyright (C) 2003 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
$result = mysql_query( "select * from Monitors where Id = '$mid'" );
if ( !$result )
die( mysql_error() );
$monitor = mysql_fetch_assoc( $result );
if ( !canView( 'Stream' ) )
{
$view = "error";
return;
}
if ( !isset($mode) )
{
if ( canStream() )
$mode = "stream";
else
$mode = "still";
}
$result = mysql_query( "select * from Monitors where Id = '$mid'" );
if ( !$result )
die( mysql_error() );
$monitor = mysql_fetch_assoc( $result );
if ( $mode != "stream" )
{
// Prompt an image to be generated
chdir( ZM_DIR_IMAGES );
$status = exec( escapeshellcmd( ZMU_COMMAND." -m $mid -i" ) );
chdir( '..' );
if ( ZM_WEB_REFRESH_METHOD == "http" )
header("Refresh: ".REFRESH_IMAGE."; URL=$PHP_SELF?view=montagefeed&mid=$mid&mode=still" );
}
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
if ( $mode != "stream" )
{
// Prompt an image to be generated
chdir( ZM_DIR_IMAGES );
$status = exec( escapeshellcmd( ZMU_COMMAND." -m $mid -i" ) );
chdir( '..' );
if ( ZM_WEB_REFRESH_METHOD == "http" )
header("Refresh: ".REFRESH_IMAGE."; URL=$PHP_SELF?view=montagefeed&mid=$mid&mode=still" );
}
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
?>
<html>
<head>
@ -60,28 +80,28 @@ window.setTimeout( "window.location.reload(true)", <?= REFRESH_IMAGE*1000 ?> );
<?php } ?>
</tr>
<?php
if ( $mode == "stream" )
if ( $mode == "stream" )
{
$stream_src = ZM_PATH_ZMS."?monitor=".$monitor['Id']."&idle=".STREAM_IDLE_DELAY."&refresh=".STREAM_FRAME_DELAY;
if ( isNetscape() )
{
$stream_src = ZM_PATH_ZMS."?monitor=".$monitor['Id']."&idle=".STREAM_IDLE_DELAY."&refresh=".STREAM_FRAME_DELAY;
if ( isNetscape() )
{
?>
<tr><td colspan="2" align="center"><img src="<?= $stream_src ?>" border="0" width="<?= $monitor['Width'] ?>" height="<?= $monitor['Height'] ?>"></td></tr>
<?php
}
else
{
?>
<tr><td colspan="2" align="center"><applet code="com.charliemouse.cambozola.Viewer" archive="<?= ZM_PATH_CAMBOZOLA ?>" align="middle" width="<?= $monitor['Width'] ?>" height="<?= $monitor['Height'] ?>"><param name="url" value="<?= $stream_src ?>"></applet></td></tr>
<?php
}
}
else
{
?>
<tr><td colspan="2" align="center"><img src="<?= ZM_DIR_IMAGES.'/'.$monitor['Name'] ?>.jpg" border="0" width="<?= $monitor['Width'] ?>" height="<?= $monitor['Height'] ?>"></td></tr>
<tr><td colspan="2" align="center"><applet code="com.charliemouse.cambozola.Viewer" archive="<?= ZM_PATH_CAMBOZOLA ?>" align="middle" width="<?= $monitor['Width'] ?>" height="<?= $monitor['Height'] ?>"><param name="url" value="<?= $stream_src ?>"></applet></td></tr>
<?php
}
}
else
{
?>
<tr><td colspan="2" align="center"><img src="<?= ZM_DIR_IMAGES.'/'.$monitor['Name'] ?>.jpg" border="0" width="<?= $monitor['Width'] ?>" height="<?= $monitor['Height'] ?>"></td></tr>
<?php
}
?>
</table>
</body>

View File

@ -1,64 +1,84 @@
<?php
if ( !canView( 'Stream' ) )
{
$view = "error";
return;
}
$zmu_command = ZMU_COMMAND." -m $mid -s -f";
$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 && empty($last_status) );
$old_alarm = ( $status == 0 && isset($last_status) && $last_status > 0 );
//
// ZoneMinder web montage status view file, $Date$, $Revision$
// Copyright (C) 2003 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
if ( !canView( 'Stream' ) )
{
$view = "error";
return;
}
$zmu_command = ZMU_COMMAND." -m $mid -s -f";
$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 && empty($last_status) );
$old_alarm = ( $status == 0 && isset($last_status) && $last_status > 0 );
$refresh = $status?1:REFRESH_STATUS;
$url = "$PHP_SELF?view=montagestatus&mid=$mid&last_status=$status";
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 = $status?1:REFRESH_STATUS;
$url = "$PHP_SELF?view=montagestatus&mid=$mid&last_status=$status";
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
?>
<html>
<head>
<link rel="stylesheet" href="zm_styles.css" type="text/css">
<script language="JavaScript">
<?php
if ( ZM_WEB_POPUP_ON_ALARM && $new_alarm )
{
if ( ZM_WEB_POPUP_ON_ALARM && $new_alarm )
{
?>
top.window.focus();
<?php
}
if ( ZM_WEB_REFRESH_METHOD == "javascript" )
{
}
if ( ZM_WEB_REFRESH_METHOD == "javascript" )
{
?>
window.setTimeout( "window.location.reload(true)", <?= $refresh*1000 ?> );
<?php
}
}
?>
</script>
</head>
@ -71,12 +91,12 @@ window.setTimeout( "window.location.reload(true)", <?= $refresh*1000 ?> );
</tr>
</table>
<?php
if ( ZM_WEB_SOUND_ON_ALARM && $status == 1 )
{
if ( ZM_WEB_SOUND_ON_ALARM && $status == 1 )
{
?>
<embed src="<?= ZM_DIR_SOUNDS.'/'.ZM_WEB_ALARM_SOUND ?>" autostart="yes" hidden="true"></embed>
<?php
}
}
?>
</body>
</html>

View File

@ -1,14 +1,35 @@
<?php
//
// ZoneMinder web null view file, $Date$, $Revision$
// Copyright (C) 2003 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
?>
<html>
<head>
<script language="JavaScript">
<?php
if ( !empty($refresh_parent) )
{
if ( !empty($refresh_parent) )
{
?>
//self.onerror = function() { return( true ); }
opener.location.reload(true);
<?php
}
}
?>
window.close();
</script>

View File

@ -1,4 +1,22 @@
<?php
//
// ZoneMinder web option help view file, $Date$, $Revision$
// Copyright (C) 2003 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
// Help Text can be either the default from the DB or overridden in the language files
include_once( 'zm_help.php' );

View File

@ -1,29 +1,49 @@
<?php
if ( !canView( 'System' ) )
{
$view = "error";
return;
}
//
// ZoneMinder web options view file, $Date$, $Revision$
// Copyright (C) 2003 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
$tabs = array();
$tabs['system'] = $zmSlangSystem;
$tabs['paths'] = $zmSlangPaths;
$tabs['video'] = $zmSlangVideo;
$tabs['network'] = $zmSlangNetwork;
$tabs['web'] = $zmSlangWeb;
$tabs['mail'] = $zmSlangEmail;
$tabs['ftp'] = $zmSlangFTP;
$tabs['x10'] = $zmSlangX10;
$tabs['tools'] = $zmSlangTools;
$tabs['highband'] = $zmSlangHighBW;
$tabs['medband'] = $zmSlangMediumBW;
$tabs['lowband'] = $zmSlangLowBW;
$tabs['phoneband'] = $zmSlangPhoneBW;
if ( ZM_OPT_USE_AUTH )
$tabs['users'] = $zmSlangUsers;
if ( !canView( 'System' ) )
{
$view = "error";
return;
}
$tabs = array();
$tabs['system'] = $zmSlangSystem;
$tabs['paths'] = $zmSlangPaths;
$tabs['video'] = $zmSlangVideo;
$tabs['network'] = $zmSlangNetwork;
$tabs['web'] = $zmSlangWeb;
$tabs['mail'] = $zmSlangEmail;
$tabs['ftp'] = $zmSlangFTP;
$tabs['x10'] = $zmSlangX10;
$tabs['tools'] = $zmSlangTools;
$tabs['highband'] = $zmSlangHighBW;
$tabs['medband'] = $zmSlangMediumBW;
$tabs['lowband'] = $zmSlangLowBW;
$tabs['phoneband'] = $zmSlangPhoneBW;
if ( ZM_OPT_USE_AUTH )
$tabs['users'] = $zmSlangUsers;
if ( !isset($tab) )
$tab = "system";
if ( !isset($tab) )
$tab = "system";
?>
<html>
<head>
@ -31,12 +51,12 @@
<link rel="stylesheet" href="zm_styles.css" type="text/css">
<script language="JavaScript">
<?php
if ( !empty($refresh_parent) )
{
if ( !empty($refresh_parent) )
{
?>
opener.location.reload(true);
<?php
}
}
?>
window.focus();
@ -68,73 +88,72 @@ function closeWindow()
}
<?php
if ( $tab == 'users' )
{
if ( $tab == 'users' )
{
?>
function validateForm( form )
{
return( true );
}
<?php
}
else
{
}
else
{
?>
function validateForm( form )
{
var errors = Array();
<?php
$config_cat = $config_cats[$tab];
$config_cat = $config_cats[$tab];
foreach ( $config_cat as $name=>$value )
foreach ( $config_cat as $name=>$value )
{
if ( 0 && $value['Type'] == "boolean" )
{
if ( 0 && $value['Type'] == "boolean" )
{
?>
if ( !form.<?= $name ?>.value )
{
form.<?= $name ?>.value = 0;
}
<?php
}
}
}
?>
return( true );
}
<?php
}
}
?>
</script>
</head>
<body>
<table border="0" cellspacing="0" cellpadding="4" width="100%">
<tr>
<?php
foreach ( $tabs as $name=>$value )
foreach ( $tabs as $name=>$value )
{
if ( $tab == $name )
{
if ( $tab == $name )
{
?>
<td width="10" class="activetab"><?= $value ?></td>
<?php
}
else
{
}
else
{
?>
<td width="10" class="passivetab"><a href="<?= $PHP_SELF ?>?view=<?= $view ?>&tab=<?= $name ?>"?><?= $value ?></a></td>
<?php
}
}
}
?>
<td class="nontab">&nbsp;</td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<?php
if ( $tab == "users" )
{
if ( $tab == "users" )
{
?>
<form name="user_form" method="post" action="<?= $PHP_SELF ?>" onSubmit="validateForm( this )">
<input type="hidden" name="view" value="<?= $view ?>">
@ -153,11 +172,11 @@ function validateForm( form )
<td align="left" class="smallhead"><?= $zmSlangMark ?></td>
</tr>
<?php
$result = mysql_query( "select * from Users" );
if ( !$result )
die( mysql_error() );
while( $row = mysql_fetch_assoc( $result ) )
{
$result = mysql_query( "select * from Users" );
if ( !$result )
die( mysql_error() );
while( $row = mysql_fetch_assoc( $result ) )
{
?>
<tr onMouseOver="this.className='over'" onMouseOut="this.className='out'">
<td align="left" class="ruled"><?= $row['Id'] ?></td>
@ -172,15 +191,15 @@ function validateForm( form )
<td align="center" class="ruled"><input type="checkbox" name="mark_uids[]" value="<?= $row['Id'] ?>" onClick="configureButton( document.user_form, 'mark_uids' );"<?php if ( !canEdit( 'System' ) ) { ?> disabled<?php } ?>></td>
</tr>
<?php
}
}
?>
<tr><td colspan="10" class="ruled">&nbsp;</td></tr>
<tr><td colspan="10" align="right"><input type="button" value="<?= $zmSlangAddNewUser ?>" class="form" onClick="javascript: newWindow( '<?= $PHP_SELF ?>?view=user&uid=-1', 'zmUser', <?= $jws['user']['w'] ?>, <?= $jws['user']['h'] ?> );"<?php if ( !canEdit( 'System' ) ) { ?> disabled<?php } ?>>&nbsp;<input type="submit" name="delete_btn" value="<?= $zmSlangDelete ?>" class="form" disabled>&nbsp;<input type="button" value="<?= $zmSlangCancel ?>" class="form" onClick="closeWindow();"></td></tr>
</form>
<?php
}
else
{
}
else
{
?>
<form name="options_form" method="post" action="<?= $PHP_SELF ?>" onSubmit="return( validateForm( document.options_form ) );">
<input type="hidden" name="view" value="<?= $view ?>">
@ -192,75 +211,75 @@ function validateForm( form )
<td align="left" class="smallhead"><?= $zmSlangValue ?></td>
</tr>
<?php
$config_cat = $config_cats[$tab];
$config_cat = $config_cats[$tab];
foreach ( $config_cat as $name=>$value )
{
foreach ( $config_cat as $name=>$value )
{
?>
<tr>
<td align="left" class="text"><?= $value['Name'] ?></td>
<td align="left" class="text"><?= $value['Prompt'] ?> (<a href="javascript: newWindow( '<?= $PHP_SELF ?>?view=optionhelp&option=<?= $value['Name'] ?>', 'zmOptionHelp', <?= $jws['optionhelp']['w'] ?>, <?= $jws['optionhelp']['h'] ?>);">?</a>)</td>
<?php
if ( $value['Type'] == "boolean" )
{
if ( $value['Type'] == "boolean" )
{
?>
<td align="left" class="text"><input type="checkbox" class="text" id="<?= $value['Name'] ?>" name="new_config[<?= $value['Name'] ?>]" value="1"<?php if ( $value['Value'] ) { ?> checked<?php } ?>></td>
<?php
}
elseif ( preg_match( "/\|/", $value['Hint'] ) )
{
}
elseif ( preg_match( "/\|/", $value['Hint'] ) )
{
?>
<td align="left" class="text">
<?php
foreach ( split( "\|", $value['Hint'] ) as $option )
{
foreach ( split( "\|", $value['Hint'] ) as $option )
{
?>
<input type="radio" class="text" id="<?= $value['Name'] ?>" name="new_config[<?= $value['Name'] ?>]" value="<?= $option ?>"<?php if ( $value['Value'] == $option ) { ?> checked<?php } ?>>&nbsp;<?= $option ?>&nbsp;&nbsp;
<?php
}
}
?>
</td>
<?php
}
elseif ( $value['Type'] == "text" )
{
}
elseif ( $value['Type'] == "text" )
{
?>
<td align="left" class="text"><textarea class="form" id="<?= $value['Name'] ?>" name="new_config[<?= $value['Name'] ?>]" rows="5" cols="40"><?= htmlspecialchars($value['Value']) ?></textarea></td>
<?php
}
elseif ( $value['Type'] == "integer" )
{
}
elseif ( $value['Type'] == "integer" )
{
?>
<td align="left" class="text"><input type="text" class="form" id="<?= $value['Name'] ?>" name="new_config[<?= $value['Name'] ?>]" value="<?= $value['Value'] ?>" size="8"></td>
<?php
}
else
{
}
else
{
?>
<td align="left" class="text"><input type="text" class="form" id="<?= $value['Name'] ?>" name="new_config[<?= $value['Name'] ?>]" value="<?= $value['Value'] ?>" size="40"></td>
<?php
}
}
?>
</tr>
<?php
}
}
?>
<tr><td colspan="3" align="right"><input type="submit" value="<?= $zmSlangSave ?>" class="form">&nbsp;<input type="button" value="<?= $zmSlangCancel ?>" class="form" onClick="closeWindow();"></td></tr>
</form>
<?php
}
}
?>
</table>
<?php
if ( !empty($restart) )
{
flush();
if ( !empty($restart) )
{
flush();
?>
<script language="JavaScript">
alert( "<?= $zmSlangOptionRestartWarning ?>" );
</script>
<?php
}
}
?>
</body>
</html>

View File

@ -1,3 +1,24 @@
<?php
//
// ZoneMinder web logging in view file, $Date$, $Revision$
// Copyright (C) 2003 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
?>
<html>
<head>
<title>ZM - <?= $zmSlangLoggingIn ?></title>

View File

@ -1,3 +1,24 @@
<?php
//
// ZoneMinder web restarting view file, $Date$, $Revision$
// Copyright (C) 2003 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
?>
<html>
<head>
<title>ZM - Restarting</title>

View File

@ -1,17 +1,37 @@
<?php
if ( !canView( 'Monitors' ) )
{
$view = "error";
return;
}
$result = mysql_query( "select * from Monitors where Id = '$mid'" );
if ( !$result )
die( mysql_error() );
$monitor = mysql_fetch_assoc( $result );
//
// ZoneMinder web settings view file, $Date$, $Revision$
// Copyright (C) 2003 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
if ( !canView( 'Monitors' ) )
{
$view = "error";
return;
}
$result = mysql_query( "select * from Monitors where Id = '$mid'" );
if ( !$result )
die( mysql_error() );
$monitor = mysql_fetch_assoc( $result );
$zmu_command = ZMU_COMMAND." -m $mid -B -C -H -O";
$zmu_output = exec( escapeshellcmd( $zmu_command ) );
list( $brightness, $contrast, $hue, $colour ) = split( ' ', $zmu_output );
$zmu_command = ZMU_COMMAND." -m $mid -B -C -H -O";
$zmu_output = exec( escapeshellcmd( $zmu_command ) );
list( $brightness, $contrast, $hue, $colour ) = split( ' ', $zmu_output );
?>
<html>
<head>
@ -19,12 +39,12 @@
<link rel="stylesheet" href="zm_styles.css" type="text/css">
<script language="JavaScript">
<?php
if ( !empty($refresh_parent) )
{
if ( !empty($refresh_parent) )
{
?>
opener.location.reload(true);
<?php
}
}
?>
window.focus();
function validateForm(Form)

View File

@ -1,18 +1,38 @@
<?php
if ( !canEdit( 'System' ) )
{
$view = "error";
return;
}
$running = daemonCheck();
//
// ZoneMinder web run state view file, $Date$, $Revision$
// Copyright (C) 2003 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
if ( !canEdit( 'System' ) )
{
$view = "error";
return;
}
$running = daemonCheck();
$result = mysql_query( "select * from States" );
if ( !$result )
die( mysql_error() );
while( $state = mysql_fetch_assoc( $result ) )
{
$states[] = $state;
}
$result = mysql_query( "select * from States" );
if ( !$result )
die( mysql_error() );
while( $state = mysql_fetch_assoc( $result ) )
{
$states[] = $state;
}
?>
<html>
<head>
@ -20,12 +40,12 @@
<link rel="stylesheet" href="zm_styles.css" type="text/css">
<script language="JavaScript">
<?php
if ( !empty($refresh_parent) )
{
if ( !empty($refresh_parent) )
{
?>
opener.location.reload(true);
<?php
}
}
?>
window.focus();
function refreshWindow()
@ -41,8 +61,8 @@ function checkState()
with ( document.state_form )
{
<?php
if ( $running )
{
if ( $running )
{
?>
if ( run_state.selectedIndex < 2 )
{
@ -50,9 +70,9 @@ function checkState()
delete_btn.disabled = true;
}
<?php
}
else
{
}
else
{
?>
if ( run_state.selectedIndex < 1 )
{
@ -60,7 +80,7 @@ function checkState()
delete_btn.disabled = true;
}
<?php
}
}
?>
else
{

View File

@ -1,16 +1,36 @@
<?php
if ( !canView( 'Events' ) )
{
$view = "error";
return;
}
$result = mysql_query( "select S.*,E.*,Z.Name as ZoneName,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' and S.FrameId = '$fid' order by S.ZoneId" );
if ( !$result )
die( mysql_error() );
while ( $row = mysql_fetch_assoc( $result ) )
{
$stats[] = $row;
}
//
// ZoneMinder web stats view file, $Date$, $Revision$
// Copyright (C) 2003 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
if ( !canView( 'Events' ) )
{
$view = "error";
return;
}
$result = mysql_query( "select S.*,E.*,Z.Name as ZoneName,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' and S.FrameId = '$fid' order by S.ZoneId" );
if ( !$result )
die( mysql_error() );
while ( $row = mysql_fetch_assoc( $result ) )
{
$stats[] = $row;
}
?>
<html>
<head>
@ -41,10 +61,10 @@ function closeWindow()
<td class="smallhead" align="right"><?= $zmSlangScore ?></td>
</tr>
<?php
if ( count($stats) )
if ( count($stats) )
{
foreach ( $stats as $stat )
{
foreach ( $stats as $stat )
{
?>
<tr bgcolor="#FFFFFF">
<td class="text"><?= $stat['ZoneName'] ?></td>
@ -57,16 +77,16 @@ function closeWindow()
<td class="text" align="right"><?= $stat['Score'] ?></td>
</tr>
<?php
}
}
else
{
}
else
{
?>
<tr bgcolor="#FFFFFF">
<td class="text" colspan="8" align="center"><br><?= $zmSlangNoStatisticsRecorded ?><br><br></td>
</tr>
<?php
}
}
?>
</table></td>
</tr>

View File

@ -1,18 +1,38 @@
<?php
if ( !canEdit( 'System' ) )
{
$view = "error";
return;
}
$result = mysql_query( "select * from Users where Id = '$uid'" );
if ( !$result )
die( mysql_error() );
if ( !($row = mysql_fetch_assoc( $result )) )
{
$row = array();
$row['Username'] = $zmSlangNewUser;
$row['Enabled'] = 1;
}
//
// ZoneMinder web user view file, $Date$, $Revision$
// Copyright (C) 2003 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
if ( !canEdit( 'System' ) )
{
$view = "error";
return;
}
$result = mysql_query( "select * from Users where Id = '$uid'" );
if ( !$result )
die( mysql_error() );
if ( !($row = mysql_fetch_assoc( $result )) )
{
$row = array();
$row['Username'] = $zmSlangNewUser;
$row['Enabled'] = 1;
}
?>
<html>
<head>
@ -20,12 +40,12 @@
<link rel="stylesheet" href="zm_styles.css" type="text/css">
<script language="JavaScript">
<?php
if ( !empty($refresh_parent) )
{
if ( !empty($refresh_parent) )
{
?>
opener.location.reload(true);
<?php
}
}
?>
window.focus();
function validateForm(Form)
@ -78,20 +98,20 @@ function closeWindow()
<tr><td align="right" class="text"><?= $zmSlangConfirmPassword ?></td><td align="left" class="text"><input type="password" name="new_password2" value="<?= $row['Password'] ?>" size="16" class="form"></td></tr>
<tr><td align="right" class="text"><?= $zmSlangLanguage ?></td><td align="left" class="text"><input type="text" name="new_language" value="<?= $row['Language'] ?>" size="16" class="form"></td></tr>
<?php
$new_enabled = $row['Enabled'];
$yesno = array( 0=>$zmSlangNo, 1=>$zmSlangYes );
$new_enabled = $row['Enabled'];
$yesno = array( 0=>$zmSlangNo, 1=>$zmSlangYes );
?>
<tr><td align="right" class="text"><?= $zmSlangEnabled ?></td><td align="left" class="text"><?= buildSelect( "new_enabled", $yesno ) ?></td></tr>
<?php
$new_stream = $row['Stream'];
$nv = array( 'None'=>$zmSlangNone, 'View'=>$zmSlangView );
$new_stream = $row['Stream'];
$nv = array( 'None'=>$zmSlangNone, 'View'=>$zmSlangView );
?>
<tr><td align="right" class="text">Stream</td><td align="left" class="text"><?= buildSelect( "new_stream", $nv ) ?></td></tr>
<?php
$new_events = $row['Events'];
$new_monitors = $row['Monitors'];
$new_system = $row['System'];
$nve = array( 'None'=>$zmSlangNone, 'View'=>$zmSlangView, 'Edit'=>$zmSlangEdit );
$new_events = $row['Events'];
$new_monitors = $row['Monitors'];
$new_system = $row['System'];
$nve = array( 'None'=>$zmSlangNone, 'View'=>$zmSlangView, 'Edit'=>$zmSlangEdit );
?>
<tr><td align="right" class="text"><?= $zmSlangEvents ?></td><td align="left" class="text"><?= buildSelect( "new_events", $nve ) ?></td></tr>
<tr><td align="right" class="text"><?= $zmSlangMonitors ?></td><td align="left" class="text"><?= buildSelect( "new_monitors", $nve ) ?></td></tr>

View File

@ -1,20 +1,40 @@
<?php
if ( !canView( 'Events' ) )
{
$view = "error";
return;
}
$result = mysql_query( "select E.*,M.Name as MonitorName, M.Palette from Events as E, Monitors as M where E.Id = '$eid' and E.MonitorId = M.Id" );
if ( !$result )
die( mysql_error() );
$event = mysql_fetch_assoc( $result );
//
// ZoneMinder web video view file, $Date$, $Revision$
// Copyright (C) 2003 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
if ( !isset( $scale ) )
$scale = 1;
if ( !isset( $rate ) )
$rate = 1;
if ( !canView( 'Events' ) )
{
$view = "error";
return;
}
$result = mysql_query( "select E.*,M.Name as MonitorName, M.Palette from Events as E, Monitors as M where E.Id = '$eid' and E.MonitorId = M.Id" );
if ( !$result )
die( mysql_error() );
$event = mysql_fetch_assoc( $result );
if ( !isset( $scale ) )
$scale = 1;
if ( !isset( $rate ) )
$rate = 1;
ob_start();
ob_start();
?>
<html>
<head>
@ -40,8 +60,8 @@
</table>
</form>
<?php
if ( $generate )
{
if ( $generate )
{
?>
<table border="0" cellspacing="0" cellpadding="4" width="100%">
<tr><td>&nbsp;</td></tr>
@ -53,18 +73,18 @@
</body>
</html>
<?php
$buffer_string = "<!-- This is some long buffer text to ensure that IE flushes correctly -->";
for ( $i = 0; $i < 4096/strlen($buffer_string); $i++ )
{
echo $buffer_string."\n";
}
$buffer_string = "<!-- This is some long buffer text to ensure that IE flushes correctly -->";
for ( $i = 0; $i < 4096/strlen($buffer_string); $i++ )
{
echo $buffer_string."\n";
}
?>
<?php
ob_end_flush();
if ( $video_file = createVideo( $event, $rate, $scale, $overwrite ) )
{
$event_dir = ZM_DIR_EVENTS."/$event['MonitorName']/".sprintf( "%d", $eid );
$video_path = $event_dir.'/'.$video_file;
ob_end_flush();
if ( $video_file = createVideo( $event, $rate, $scale, $overwrite ) )
{
$event_dir = ZM_DIR_EVENTS."/".$event['MonitorName']."/".sprintf( "%d", $eid );
$video_path = $event_dir.'/'.$video_file;
?>
<html>
<head>
@ -74,10 +94,10 @@ location.replace('<?= $video_path ?>');
</head>
</html>
<?php
}
else
{
ob_end_flush();
}
else
{
ob_end_flush();
?>
<html>
<head>
@ -86,12 +106,12 @@ location.replace('<?= $video_path ?>');
<body>
<p class="head" align="center"><font color="red"><br><br><?= $zmSlangVideoGenFailed ?><br><br></font></p>
<?php
}
}
else
{
ob_end_flush();
}
}
else
{
ob_end_flush();
}
?>
</body>
</html>

View File

@ -1,13 +1,33 @@
<?php
if ( !canView( 'Stream' ) )
{
$view = "error";
return;
}
$result = mysql_query( "select * from Monitors where Id = '$mid'" );
if ( !$result )
die( mysql_error() );
$monitor = mysql_fetch_assoc( $result );
//
// ZoneMinder web watch view file, $Date$, $Revision$
// Copyright (C) 2003 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
if ( !canView( 'Stream' ) )
{
$view = "error";
return;
}
$result = mysql_query( "select * from Monitors where Id = '$mid'" );
if ( !$result )
die( mysql_error() );
$monitor = mysql_fetch_assoc( $result );
?>
<html>
<head>

View File

@ -1,53 +1,72 @@
<?php
if ( !canView( 'Events' ) )
{
$view = "error";
return;
}
if ( empty($sort_field) )
{
$sort_field = "Time";
$sort_asc = false;
}
switch( $sort_field )
{
case 'Id' :
$sort_column = "E.Id";
break;
case 'Name' :
$sort_column = "E.Name";
break;
case 'Time' :
$sort_column = "E.StartTime";
break;
case 'Secs' :
$sort_column = "E.Length";
break;
case 'Frames' :
$sort_column = "E.Frames";
break;
case 'Score' :
$sort_column = "E.AvgScore";
break;
default:
$sort_column = "E.StartTime";
break;
}
$sort_order = $sort_asc?"asc":"desc";
if ( !$sort_asc )
$sort_asc = 0;
if ( ZM_WEB_REFRESH_METHOD == "http" )
header("Refresh: ".REFRESH_EVENTS."; URL=$PHP_SELF?view=watchevents&mid=$mid&max_events=".MAX_EVENTS );
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
//
// ZoneMinder web watch events view file, $Date$, $Revision$
// Copyright (C) 2003 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
$result = mysql_query( "select * from Monitors where Id = '$mid'" );
if ( !$result )
die( mysql_error() );
$monitor = mysql_fetch_assoc( $result );
if ( !canView( 'Events' ) )
{
$view = "error";
return;
}
if ( empty($sort_field) )
{
$sort_field = "Time";
$sort_asc = false;
}
switch( $sort_field )
{
case 'Id' :
$sort_column = "E.Id";
break;
case 'Name' :
$sort_column = "E.Name";
break;
case 'Time' :
$sort_column = "E.StartTime";
break;
case 'Secs' :
$sort_column = "E.Length";
break;
case 'Frames' :
$sort_column = "E.Frames";
break;
case 'Score' :
$sort_column = "E.AvgScore";
break;
default:
$sort_column = "E.StartTime";
break;
}
$sort_order = $sort_asc?"asc":"desc";
if ( !$sort_asc )
$sort_asc = 0;
if ( ZM_WEB_REFRESH_METHOD == "http" )
header("Refresh: ".REFRESH_EVENTS."; URL=$PHP_SELF?view=watchevents&mid=$mid&max_events=".MAX_EVENTS );
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
$result = mysql_query( "select * from Monitors where Id = '$mid'" );
if ( !$result )
die( mysql_error() );
$monitor = mysql_fetch_assoc( $result );
?>
<html>
@ -90,12 +109,12 @@ function configureButton(form,name)
form.delete_btn.disabled = !checked;
}
<?php
if ( ZM_WEB_REFRESH_METHOD == "javascript" )
{
if ( ZM_WEB_REFRESH_METHOD == "javascript" )
{
?>
window.setTimeout( "window.location.replace( '<?= "$PHP_SELF?view=watchevents&mid=$mid&max_events=".MAX_EVENTS ?>' )", <?= REFRESH_EVENTS*1000 ?> );
<?php
}
}
?>
</script>
</head>
@ -109,15 +128,15 @@ window.setTimeout( "window.location.replace( '<?= "$PHP_SELF?view=watchevents&mi
<tr>
<td valign="top"><table border="0" cellspacing="0" cellpadding="0" width="100%">
<?php
$sql = "select E.Id,E.Name,E.StartTime,E.Length,E.Frames,E.AlarmFrames,E.AvgScore,E.MaxScore from Monitors as M left join Events as E on M.Id = E.MonitorId where M.Id = '$mid' and E.Archived = 0";
$sql .= " order by $sort_column $sort_order";
$sql .= " limit 0,$max_events";
$result = mysql_query( $sql );
if ( !$result )
{
die( mysql_error() );
}
$n_events = mysql_num_rows( $result );
$sql = "select E.Id,E.Name,E.StartTime,E.Length,E.Frames,E.AlarmFrames,E.AvgScore,E.MaxScore from Monitors as M left join Events as E on M.Id = E.MonitorId where M.Id = '$mid' and E.Archived = 0";
$sql .= " order by $sort_column $sort_order";
$sql .= " limit 0,$max_events";
$result = mysql_query( $sql );
if ( !$result )
{
die( mysql_error() );
}
$n_events = mysql_num_rows( $result );
?>
<tr>
<td class="text"><b><?= sprintf( $zmClangLastEvents, $n_events, strtolower( zmVlang( $zmVlangEvent, $n_events ) ) ) ?></b></td>
@ -137,8 +156,8 @@ window.setTimeout( "window.location.replace( '<?= "$PHP_SELF?view=watchevents&mi
<td class="text"><?= $zmSlangMark ?></td>
</tr>
<?php
while( $event = mysql_fetch_assoc( $result ) )
{
while( $event = mysql_fetch_assoc( $result ) )
{
?>
<tr bgcolor="#FFFFFF">
<td align="center" class="text"><a href="javascript: eventWindow( '<?= $PHP_SELF ?>?view=event&mid=<?= $mid ?>&eid=<?= $event['Id'] ?>&page=1', 'zmEvent' );"><?= $event['Id'] ?></a></td>
@ -150,7 +169,7 @@ window.setTimeout( "window.location.replace( '<?= "$PHP_SELF?view=watchevents&mi
<td align="center" class="text"><input type="checkbox" name="mark_eids[]" value="<?= $event['Id'] ?>" onClick="configureButton( document.event_form, 'mark_eids' );"<?php if ( !canEdit( 'Events' ) ) { ?> disabled<?php } ?>></td>
</tr>
<?php
}
}
?>
</table></td></tr>
</table></td>

View File

@ -1,39 +1,59 @@
<?php
if ( !canView( 'Stream' ) )
{
$view = "error";
return;
}
if ( !isset($mode) )
{
if ( canStream() )
$mode = "stream";
else
$mode = "still";
}
//
// ZoneMinder web watch feed view file, $Date$, $Revision$
// Copyright (C) 2003 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
$result = mysql_query( "select * from Monitors where Id = '$mid'" );
if ( !$result )
die( mysql_error() );
$monitor = mysql_fetch_assoc( $result );
if ( !canView( 'Stream' ) )
{
$view = "error";
return;
}
if ( !isset($mode) )
{
if ( canStream() )
$mode = "stream";
else
$mode = "still";
}
if ( $mode != "stream" )
{
// Prompt an image to be generated
chdir( ZM_DIR_IMAGES );
$status = exec( escapeshellcmd( ZMU_COMMAND." -m $mid -i" ) );
chdir( '..' );
if ( ZM_WEB_REFRESH_METHOD == "http" )
header("Refresh: ".REFRESH_IMAGE."; URL=$PHP_SELF?view=watchfeed&mid=$mid&mode=still" );
}
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
$result = mysql_query( "select * from Monitors where Id = '$mid'" );
if ( !$result )
die( mysql_error() );
$monitor = mysql_fetch_assoc( $result );
if ( $mode != "stream" )
{
// Prompt an image to be generated
chdir( ZM_DIR_IMAGES );
$status = exec( escapeshellcmd( ZMU_COMMAND." -m $mid -i" ) );
chdir( '..' );
if ( ZM_WEB_REFRESH_METHOD == "http" )
header("Refresh: ".REFRESH_IMAGE."; URL=$PHP_SELF?view=watchfeed&mid=$mid&mode=still" );
}
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
if ( !isset( $scale ) )
$scale = 1;
if ( !isset( $scale ) )
$scale = 1;
?>
<html>
<head>
@ -49,12 +69,12 @@ function closeWindow()
top.window.close();
}
<?php
if ( $mode != "stream" && ZM_WEB_REFRESH_METHOD == "javascript" )
{
if ( $mode != "stream" && ZM_WEB_REFRESH_METHOD == "javascript" )
{
?>
window.setTimeout( "window.location.reload(true)", <?= REFRESH_IMAGE*1000 ?> );
<?php
}
}
?>
</script>
</head>
@ -87,28 +107,28 @@ window.setTimeout( "window.location.reload(true)", <?= REFRESH_IMAGE*1000 ?> );
<td align="right" class="text"><a href="javascript: closeWindow();"><?= $zmSlangClose ?></a></td>
</tr>
<?php
if ( $mode == "stream" )
if ( $mode == "stream" )
{
$stream_src = ZM_PATH_ZMS."?monitor=".$monitor['Id']."&idle=".STREAM_IDLE_DELAY."&refresh=".STREAM_FRAME_DELAY."&scale=$scale";
if ( isNetscape() )
{
$stream_src = ZM_PATH_ZMS."?monitor=".$monitor['Id']."&idle=".STREAM_IDLE_DELAY."&refresh=".STREAM_FRAME_DELAY."&scale=$scale";
if ( isNetscape() )
{
?>
<tr><td colspan="5" align="center"><img src="<?= $stream_src ?>" border="0" width="<?= reScale( $monitor['Width'], $scale ) ?>" height="<?= reScale( $monitor['Height'], $scale ) ?>"></td></tr>
<?php
}
else
{
?>
<tr><td colspan="5" align="center"><applet code="com.charliemouse.cambozola.Viewer" archive="<?= ZM_PATH_CAMBOZOLA ?>" align="middle" width="<?= reScale( $monitor['Width'], $scale ) ?>" height="<?= reScale( $monitor['Height'], $scale ) ?>"><param name="url" value="<?= $stream_src ?>"></applet></td></tr>
<?php
}
}
else
{
?>
<tr><td colspan="5" align="center"><img src="<?= ZM_DIR_IMAGES.'/'.$monitor['Name'] ?>.jpg" border="0" width="<?= $monitor['Width'] ?>" height="<?= $monitor['Height'] ?>"></td></tr>
<tr><td colspan="5" align="center"><applet code="com.charliemouse.cambozola.Viewer" archive="<?= ZM_PATH_CAMBOZOLA ?>" align="middle" width="<?= reScale( $monitor['Width'], $scale ) ?>" height="<?= reScale( $monitor['Height'], $scale ) ?>"><param name="url" value="<?= $stream_src ?>"></applet></td></tr>
<?php
}
}
else
{
?>
<tr><td colspan="5" align="center"><img src="<?= ZM_DIR_IMAGES.'/'.$monitor['Name'] ?>.jpg" border="0" width="<?= $monitor['Width'] ?>" height="<?= $monitor['Height'] ?>"></td></tr>
<?php
}
?>
</table>
</body>

View File

@ -1,75 +1,95 @@
<?php
if ( !canView( 'Stream' ) )
{
$view = "error";
return;
}
$zmu_command = ZMU_COMMAND." -m $mid -s -f";
if ( canEdit( 'Monitors' ) && isset($force) )
{
$zmu_command .= ($force?" -a":" -c");
}
//
// ZoneMinder web watch status view file, $Date$, $Revision$
// Copyright (C) 2003 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
$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 );
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
?>
<html>
<head>
<link rel="stylesheet" href="zm_styles.css" type="text/css">
<script language="JavaScript">
<?php
if ( ZM_WEB_POPUP_ON_ALARM && $new_alarm )
{
if ( ZM_WEB_POPUP_ON_ALARM && $new_alarm )
{
?>
top.window.focus();
<?php
}
if ( $old_alarm )
{
}
if ( $old_alarm )
{
?>
parent.frames[2].location.reload(true);
<?php
}
if ( ZM_WEB_REFRESH_METHOD == "javascript" )
{
}
if ( ZM_WEB_REFRESH_METHOD == "javascript" )
{
?>
window.setTimeout( "window.location.replace( '<?= $url ?>' )", <?= $refresh*1000 ?> );
<?php
}
}
?>
</script>
</head>
@ -79,34 +99,34 @@ window.setTimeout( "window.location.replace( '<?= $url ?>' )", <?= $refresh*1000
<td width="15%" class="text" align="left">&nbsp;</td>
<td width="70%" class="<?= $class ?>" align="center" valign="middle"><?= $zmSlangStatus ?>:&nbsp;<?= $status_string ?>&nbsp;-&nbsp;<?= $fps_string ?>&nbsp;fps</td>
<?php
if ( canEdit( 'Monitors' ) && ($force || $forced) )
{
if ( canEdit( 'Monitors' ) && ($force || $forced) )
{
?>
<td width="15%" align="right" class="text"><a href="<?= $PHP_SELF ?>?view=watchstatus&mid=<?= $mid ?>&last_status=$status&force=0"><?= $zmSlangCancelForcedAlarm ?></a></td>
<?php
}
elseif ( canEdit( 'Monitors' ) && zmaCheck( $mid ) )
{
}
elseif ( canEdit( 'Monitors' ) && zmaCheck( $mid ) )
{
?>
<td width="15%" align="right" class="text"><a href="<?= $PHP_SELF ?>?view=watchstatus&mid=<?= $mid ?>&last_status=$status&force=1"><?= $zmSlangForceAlarm ?></a></td>
<?php
}
else
{
}
else
{
?>
<td width="15%" align="right" class="text">&nbsp;</td>
<?php
}
}
?>
</tr>
</table>
<?php
if ( ZM_WEB_SOUND_ON_ALARM && $status == 1 )
{
if ( ZM_WEB_SOUND_ON_ALARM && $status == 1 )
{
?>
<embed src="<?= ZM_DIR_SOUNDS.'/'.ZM_WEB_ALARM_SOUND ?>" autostart="yes" hidden="true"></embed>
<?php
}
}
?>
</body>
</html>

View File

@ -1,30 +1,50 @@
<?php
if ( !canView( 'Monitors' ) )
{
$view = "error";
return;
}
$result = mysql_query( "select * from Monitors where Id = '$mid'" );
//
// ZoneMinder web zone view file, $Date$, $Revision$
// Copyright (C) 2003 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
if ( !canView( 'Monitors' ) )
{
$view = "error";
return;
}
$result = mysql_query( "select * from Monitors where Id = '$mid'" );
if ( !$result )
die( mysql_error() );
$monitor = mysql_fetch_assoc( $result );
if ( $zid > 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;
}
?>
<html>
<head>
@ -32,12 +52,12 @@
<link rel="stylesheet" href="zm_styles.css" type="text/css">
<script language="JavaScript">
<?php
if ( !empty($refresh_parent) )
{
if ( !empty($refresh_parent) )
{
?>
opener.location.reload(true);
<?php
}
}
?>
window.focus();
function validateForm( Form )
@ -258,22 +278,22 @@ function closeWindow()
<tr><td align="left" class="text"><?= $zmSlangName ?></td><td align="left" class="text"><input type="text" name="new_name" value="<?= $zone['Name'] ?>" size="12" class="form"></td></tr>
<tr><td align="left" class="text"><?= $zmSlangType ?></td><td align="left" class="text"><select name="new_type" class="form" onchange="applyZoneType(document.zone_form)">
<?php
foreach ( getEnumValues( 'Zones', 'Type' ) as $opt_type )
{
foreach ( getEnumValues( 'Zones', 'Type' ) as $opt_type )
{
?>
<option value="<?= $opt_type ?>"<?php if ( $opt_type == $zone['Type'] ) { ?> selected<?php } ?>><?= $opt_type ?></option>
<?php
}
}
?>
</select></td></tr>
<tr><td align="left" class="text"><?= $zmSlangUnits ?></td><td align="left" class="text"><select name="new_units" class="form" onchange="applyZoneUnits(document.zone_form)">
<?php
foreach ( getEnumValues( 'Zones', 'Units' ) as $opt_units )
{
foreach ( getEnumValues( 'Zones', 'Units' ) as $opt_units )
{
?>
<option value="<?= $opt_units ?>"<?php if ( $opt_units == $zone['Units'] ) { ?> selected<?php } ?>><?= $opt_units ?></option>
<?php
}
}
?>
</select></td></tr>
<tr><td align="left" class="text"><?= $zmSlangZoneMinX ?></td><td align="left" class="text"><input type="text" name="new_lo_x" value="<?= $zone['LoX'] ?>" size="4" class="form" onchange="checkWidth(this,'Minimum X')"></td></tr>

View File

@ -1,28 +1,48 @@
<?php
if ( !canView( 'Monitors' ) )
{
$view = "error";
return;
}
chdir( ZM_DIR_IMAGES );
$status = exec( escapeshellcmd( ZMU_COMMAND." -m $mid -z" ) );
chdir( '..' );
//
// ZoneMinder web zones view file, $Date$, $Revision$
// Copyright (C) 2003 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
$result = mysql_query( "select * from Monitors where Id = '$mid'" );
if ( !$result )
die( mysql_error() );
$monitor = mysql_fetch_assoc( $result );
if ( !canView( 'Monitors' ) )
{
$view = "error";
return;
}
chdir( ZM_DIR_IMAGES );
$status = exec( escapeshellcmd( ZMU_COMMAND." -m $mid -z" ) );
chdir( '..' );
$result = mysql_query( "select * from Zones where MonitorId = '$mid'" );
if ( !$result )
die( mysql_error() );
$zones = array();
while( $row = mysql_fetch_assoc( $result ) )
{
$zones[] = $row;
}
$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'" );
if ( !$result )
die( mysql_error() );
$zones = array();
while( $row = mysql_fetch_assoc( $result ) )
{
$zones[] = $row;
}
$image = $monitor['Name']."-Zones.jpg";
$image = $monitor['Name']."-Zones.jpg";
?>
<html>
<head>
@ -59,21 +79,21 @@ function configureButton(form,name)
<body>
<map name="zonemap">
<?php
foreach( $zones as $zone )
foreach( $zones as $zone )
{
if ( $zone['Units'] == 'Percent' )
{
if ( $zone['Units'] == 'Percent' )
{
?>
<area shape="rect" coords="<?= sprintf( "%d,%d,%d,%d", ($zone['LoX']*$monitor['Width'])/100, ($zone['LoY']*$monitor['Height'])/100, ($zone['HiX']*$monitor['Width'])/100, ($zone['HiY']*$monitor['Height'])/100 ) ?>" href="javascript: newWindow( '<?= $PHP_SELF ?>?view=zone&mid=<?= $mid ?>&zid=<?= $zone['Id'] ?>', 'zmZone', <?= $jws['zone']['w'] ?>, <?= $jws['zone']['h'] ?> );">
<?php
}
else
{
}
else
{
?>
<area shape="rect" coords="<?= $zone['LoX'].",".$zone['LoY'].",".$zone['HiX'].",".$zone['HiY'] ?>" href="javascript: newWindow( '<?= $PHP_SELF ?>?view=zone&mid=<?= $mid ?>&zid=<?= $zone['Id'] ?>', 'zmZone', <?= $jws['zone']['w'] ?>, <?= $jws['zone']['h'] ?> );">
<?php
}
}
}
?>
<area shape="default" nohref>
</map>
@ -98,8 +118,8 @@ function configureButton(form,name)
<td align="center" class="smallhead"><?= $zmSlangMark ?></td>
</tr>
<?php
foreach( $zones as $zone )
{
foreach( $zones as $zone )
{
?>
<tr>
<td align="center" class="text"><a href="javascript: newWindow( '<?= $PHP_SELF ?>?view=zone&mid=<?= $mid ?>&zid=<?= $zone['Id'] ?>', 'zmZone', <?= $jws['zone']['w'] ?>, <?= $jws['zone']['h'] ?> );"><?= $zone['Id'] ?>.</a></td>
@ -110,7 +130,7 @@ function configureButton(form,name)
<td align="center" class="text"><input type="checkbox" name="mark_zids[]" value="<?= $zone['Id'] ?>" onClick="configureButton( document.zone_form, 'mark_zids' );"<?php if ( !canEdit( 'Monitors' ) ) { ?> disabled<?php } ?>></td>
</tr>
<?php
}
}
?>
<tr>
<td align="center" class="text">&nbsp;</td>

View File

@ -1,4 +1,22 @@
<?php
//
// ZoneMinder web language file, $Date$, $Revision$
// Copyright (C) 2003 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
$fallback_lang_file = 'zm_lang_en_gb.php';
$system_lang_file = 'zm_lang_'.ZM_LANG_DEFAULT.'.php';

View File

@ -1,28 +1,47 @@
<?php
//
// ZoneMinder web UK English language file, $Date$, $Revision$
// Copyright (C) 2003 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
// Translators Notes
// Notes for Translators
// 1. When composing the language tokens in your language you should try and keep to roughly the
// same length text if possible. Abbreviate where necessary as spacing is quite close in a number of places.
// same length text if possible. Abbreviate where necessary as spacing is quite close in a number of places.
// 2. There are three types of string replacement
// Simple replacements are words or short phrases that are static and used directly. This type of
// replacement can be used 'as is'.
// Complex replacements involve some dynamic element being included and so may require substitution
// or changing into a different order. The token listed in this file will be passed through sprintf as
// a formatting string. If the dynamic element is a number you will usually need to use a variable
// replacement also as described below.
// Variable replacements are used in conjunction with complex replacements and involve the generation
// of a singular or plural noun depending on the number passed into the zmVlang function. This is
// intended to allow phrases such a '0 potatoes', '1 potato', '2 potatoes' etc to conjunct correctly
// with the associated numerator. Variable replacements are expressed are arrays with a series of
// counts and their associated words. When doing a replacement the passed value is compared with
// those counts in descending order and the nearest match below is used if no exact match is found.
// Therefore is you have a variable replacement with 0,1 and 2 counts, which would be the normal form
// in English, if you have 5 'things' then the nearest match below is '2' and so that plural would be used.
// a) Simple replacements are words or short phrases that are static and used directly. This type of
// replacement can be used 'as is'.
// b) Complex replacements involve some dynamic element being included and so may require substitution
// or changing into a different order. The token listed in this file will be passed through sprintf as
// a formatting string. If the dynamic element is a number you will usually need to use a variable
// replacement also as described below.
// c) Variable replacements are used in conjunction with complex replacements and involve the generation
// of a singular or plural noun depending on the number passed into the zmVlang function. This is
// intended to allow phrases such a '0 potatoes', '1 potato', '2 potatoes' etc to conjunct correctly
// with the associated numerator. Variable replacements are expressed are arrays with a series of
// counts and their associated words. When doing a replacement the passed value is compared with
// those counts in descending order and the nearest match below is used if no exact match is found.
// Therefore is you have a variable replacement with 0,1 and 2 counts, which would be the normal form
// in English, if you have 5 'things' then the nearest match below is '2' and so that plural would be used.
// 3. The tokens listed below are not used to build up phrases or sentences from single words. Therefore
// you can safely assume that a single word token will only be used in that context.
// you can safely assume that a single word token will only be used in that context.
// 4. In new language files, or if you are changing only a few words or phrases it makes sense from a
// maintenance point of view to include the original language file rather than copy all the language
// tokens across. Change this to whatever your base language is and uncomment it.
// maintenance point of view to include the original language file and override the old definitions rather
// than copy all the language tokens across. To do this change the line below to whatever your base language
// is and uncomment it.
// require_once( 'zm_lang_en_gb.php' );
// Simple String Replacements

View File

@ -1,28 +1,47 @@
<?php
//
// ZoneMinder web US English language file, $Date$, $Revision$
// Copyright (C) 2003 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
// Translators Notes
// Notes for Translators
// 1. When composing the language tokens in your language you should try and keep to roughly the
// same length text if possible. Abbreviate where necessary as spacing is quite close in a number of places.
// same length text if possible. Abbreviate where necessary as spacing is quite close in a number of places.
// 2. There are three types of string replacement
// Simple replacements are words or short phrases that are static and used directly. This type of
// replacement can be used 'as is'.
// Complex replacements involve some dynamic element being included and so may require substitution
// or changing into a different order. The token listed in this file will be passed through sprintf as
// a formatting string. If the dynamic element is a number you will usually need to use a variable
// replacement also as described below.
// Variable replacements are used in conjunction with complex replacements and involve the generation
// of a singular or plural noun depending on the number passed into the zmVlang function. This is
// intended to allow phrases such a '0 potatoes', '1 potato', '2 potatoes' etc to conjunct correctly
// with the associated numerator. Variable replacements are expressed are arrays with a series of
// counts and their associated words. When doing a replacement the passed value is compared with
// those counts in descending order and the nearest match below is used if no exact match is found.
// Therefore is you have a variable replacement with 0,1 and 2 counts, which would be the normal form
// in English, if you have 5 'things' then the nearest match below is '2' and so that plural would be used.
// a) Simple replacements are words or short phrases that are static and used directly. This type of
// replacement can be used 'as is'.
// b) Complex replacements involve some dynamic element being included and so may require substitution
// or changing into a different order. The token listed in this file will be passed through sprintf as
// a formatting string. If the dynamic element is a number you will usually need to use a variable
// replacement also as described below.
// c) Variable replacements are used in conjunction with complex replacements and involve the generation
// of a singular or plural noun depending on the number passed into the zmVlang function. This is
// intended to allow phrases such a '0 potatoes', '1 potato', '2 potatoes' etc to conjunct correctly
// with the associated numerator. Variable replacements are expressed are arrays with a series of
// counts and their associated words. When doing a replacement the passed value is compared with
// those counts in descending order and the nearest match below is used if no exact match is found.
// Therefore is you have a variable replacement with 0,1 and 2 counts, which would be the normal form
// in English, if you have 5 'things' then the nearest match below is '2' and so that plural would be used.
// 3. The tokens listed below are not used to build up phrases or sentences from single words. Therefore
// you can safely assume that a single word token will only be used in that context.
// you can safely assume that a single word token will only be used in that context.
// 4. In new language files, or if you are changing only a few words or phrases it makes sense from a
// maintenance point of view to include the original language file rather than copy all the language
// tokens across. Change this to whatever your base language is and uncomment it.
// maintenance point of view to include the original language file and override the old definitions rather
// than copy all the language tokens across. To do this change the line below to whatever your base language
// is and uncomment it.
require_once( 'zm_lang_en_gb.php' );
// Simple String Replacements

View File

@ -1,5 +1,4 @@
<?php
//
// ZoneMinder WML interface file, $Date$, $Revision$
// Copyright (C) 2003 Philip Coombes

View File

@ -1,49 +1,69 @@
<?php
if ( !$HTTP_SESSION_VARS['event_reset_time'] )
$HTTP_SESSION_VARS['event_reset_time'] = "2000-01-01 00:00:00";
//
// ZoneMinder web console view file, $Date$, $Revision$
// Copyright (C) 2003 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
$db_now = strftime( "%Y-%m-%d %H:%M:%S" );
$sql = "select M.*, count(E.Id) as EventCount, count(if(E.StartTime>'$HTTP_SESSION_VARS['event_reset_time']' && E.Archived = 0,1,NULL)) as ResetEventCount, 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 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 )
if ( !$HTTP_SESSION_VARS['event_reset_time'] )
$HTTP_SESSION_VARS['event_reset_time'] = "2000-01-01 00:00:00";
$db_now = strftime( "%Y-%m-%d %H:%M:%S" );
$sql = "select M.*, count(E.Id) as EventCount, count(if(E.StartTime>'$HTTP_SESSION_VARS['event_reset_time']' && E.Archived = 0,1,NULL)) as ResetEventCount, 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 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 ( $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();
$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++;
}
$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();
$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 ) )
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] )
{
$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;
$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;
}
?>
<wml>
<card id="zmConsole" title="ZM - <?= $zmSlangConsole ?>" ontimer="<?= $PHP_SELF ?>?view=<?= $view ?>">
@ -59,11 +79,11 @@
<td><?= $zmSlangEvents ?></td>
</tr>
<?php
$reset_event_count = 0;
foreach( $monitors as $monitor )
{
$device = $devices[$monitor['Device']];
$reset_event_count += $monitor['ResetEventCount'];
$reset_event_count = 0;
foreach( $monitors as $monitor )
{
$device = $devices[$monitor['Device']];
$reset_event_count += $monitor['ResetEventCount'];
?>
<tr>
<td><a href="<?= $PHP_SELF ?>?view=feed&amp;mid=<?= $monitor['Id'] ?>"><?= $monitor['Name'] ?></a></td>
@ -71,7 +91,7 @@
<td><a href="<?= $PHP_SELF ?>?view=events&amp;mid=<?= $monitor['Id'] ?>"><?= $monitor['ResetEventCount'] ?></a></td>
</tr>
<?php
}
}
?>
</table>
</p>

View File

@ -1,21 +1,41 @@
<?php
$result = mysql_query( "select * from Monitors where Id = '$mid'" );
if ( !$result )
die( mysql_error() );
$monitor = mysql_fetch_assoc( $result );
$browser = array();
$browser['Width'] = 100;
$browser['Height'] = 80;
//
// ZoneMinder web feed file, $Date$, $Revision$
// Copyright (C) 2003 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
$result = mysql_query( "select * from Monitors where Id = '$mid'" );
if ( !$result )
die( mysql_error() );
$monitor = mysql_fetch_assoc( $result );
$browser = array();
$browser['Width'] = 100;
$browser['Height'] = 80;
// Generate an image
chdir( ZM_DIR_IMAGES );
$status = exec( escapeshellcmd( ZMU_PATH." -m $mid -i" ) );
$monitor_image = $monitor['Name'].".jpg";
$image_time = filemtime( $monitor_image );
$browser_image = $monitor['Name']."-wap-$image_time.jpg";
$command = ZM_PATH_NETPBM."/jpegtopnm -dct fast $monitor_image | ".ZM_PATH_NETPBM."/pnmscale -xysize ".$browser['Width']." ".$browser['Height']." | ".ZM_PATH_NETPBM."/ppmtojpeg > $browser_image";
exec( $command );
chdir( '..' );
// Generate an image
chdir( ZM_DIR_IMAGES );
$status = exec( escapeshellcmd( ZMU_PATH." -m $mid -i" ) );
$monitor_image = $monitor['Name'].".jpg";
$image_time = filemtime( $monitor_image );
$browser_image = $monitor['Name']."-wap-$image_time.jpg";
$command = ZM_PATH_NETPBM."/jpegtopnm -dct fast $monitor_image | ".ZM_PATH_NETPBM."/pnmscale -xysize ".$browser['Width']." ".$browser['Height']." | ".ZM_PATH_NETPBM."/ppmtojpeg > $browser_image";
exec( $command );
chdir( '..' );
?>
<wml>
<card id="zmFeed" title="ZM - <?= $monitor['Name'] ?>" ontimer="<?= $PHP_SELF ?>?view=<?= $view ?>&amp;mid=<?= $mid ?>">
@ -25,5 +45,5 @@
</card>
</wml>
<?php
flush();
flush();
?>