Initial pass at XHTML-MP support

git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@1173 e3e1d417-86f3-4887-817a-d78f3d33393f
pull/27/merge
stan 2004-12-28 18:20:11 +00:00
parent 1c5fee19d9
commit e6a61322c8
69 changed files with 2510 additions and 199 deletions

View File

@ -103,6 +103,7 @@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
bindir = @bindir@
build_alias = @build_alias@

115
configure vendored
View File

@ -308,7 +308,7 @@ ac_includes_default="\
# include <unistd.h>
#endif"
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE PATH_BUILD MYSQL_PREFIX MYSQL_LIBS MYSQL_CFLAGS FFMPEG_PREFIX FFMPEG_LIBS FFMPEG_CFLAGS LAME_PREFIX LAME_LIBS WEB_PREFIX CGI_PREFIX WEB_USER WEB_GROUP CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CPP EGREP CXXCPP XLIBS LIBOBJS LTLIBOBJS'
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE am__leading_dot PATH_BUILD MYSQL_PREFIX MYSQL_LIBS MYSQL_CFLAGS FFMPEG_PREFIX FFMPEG_LIBS FFMPEG_CFLAGS LAME_PREFIX LAME_LIBS WEB_PREFIX CGI_PREFIX WEB_USER WEB_GROUP CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CPP EGREP CXXCPP XLIBS LIBOBJS LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
@ -1532,6 +1532,15 @@ echo "${ECHO_T}no" >&6
SET_MAKE="MAKE=${MAKE-make}"
fi
rm -rf .tst 2>/dev/null
mkdir .tst 2>/dev/null
if test -d .tst; then
am__leading_dot=.
else
am__leading_dot=_
fi
rmdir .tst 2>/dev/null
# test to see if srcdir already configured
if test "`cd $srcdir && pwd`" != "`pwd`" &&
test -f $srcdir/config.status; then
@ -2706,24 +2715,16 @@ ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
rm -f .deps 2>/dev/null
mkdir .deps 2>/dev/null
if test -d .deps; then
DEPDIR=.deps
else
# MS-DOS does not allow filenames that begin with a dot.
DEPDIR=_deps
fi
rmdir .deps 2>/dev/null
DEPDIR="${am__leading_dot}deps"
ac_config_commands="$ac_config_commands depfiles"
am_make=${MAKE-make}
cat > confinc << 'END'
doit:
am__doit:
@echo done
.PHONY: am__doit
END
# If we don't find an include directive, just comment out the code.
echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
@ -2798,18 +2799,32 @@ else
# using a relative directory.
cp "$am_depcomp" conftest.dir
cd conftest.dir
# We will build objects and dependencies in a subdirectory because
# it helps to detect inapplicable dependency modes. For instance
# both Tru64's cc and ICC support -MD to output dependencies as a
# side effect of compilation, but ICC will put the dependencies in
# the current directory while Tru64 will put them in the object
# directory.
mkdir sub
am_cv_CC_dependencies_compiler_type=none
if test "$am_compiler_list" = ""; then
am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
fi
for depmode in $am_compiler_list; do
# Setup a source with many dependencies, because some compilers
# like to wrap large dependency lists on column 80 (with \), and
# we should not choose a depcomp mode which is confused by this.
#
# We need to recreate these files for each test, as the compiler may
# overwrite some of them when testing with obscure command lines.
# This happens at least with the AIX C compiler.
echo '#include "conftest.h"' > conftest.c
echo 'int i;' > conftest.h
echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf
: > sub/conftest.c
for i in 1 2 3 4 5 6; do
echo '#include "conftst'$i'.h"' >> sub/conftest.c
: > sub/conftst$i.h
done
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
case $depmode in
nosideeffect)
@ -2827,13 +2842,20 @@ else
# mode. It turns out that the SunPro C++ compiler does not properly
# handle `-M -o', and we need to detect this.
if depmode=$depmode \
source=conftest.c object=conftest.o \
depfile=conftest.Po tmpdepfile=conftest.TPo \
$SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
grep conftest.h conftest.Po > /dev/null 2>&1 &&
source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
$SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
>/dev/null 2>conftest.err &&
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
am_cv_CC_dependencies_compiler_type=$depmode
break
# icc doesn't choke on unknown options, it will just issue warnings
# (even with -Werror). So we grep stderr for any message
# that says an option was ignored.
if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else
am_cv_CC_dependencies_compiler_type=$depmode
break
fi
fi
done
@ -3199,18 +3221,32 @@ else
# using a relative directory.
cp "$am_depcomp" conftest.dir
cd conftest.dir
# We will build objects and dependencies in a subdirectory because
# it helps to detect inapplicable dependency modes. For instance
# both Tru64's cc and ICC support -MD to output dependencies as a
# side effect of compilation, but ICC will put the dependencies in
# the current directory while Tru64 will put them in the object
# directory.
mkdir sub
am_cv_CXX_dependencies_compiler_type=none
if test "$am_compiler_list" = ""; then
am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
fi
for depmode in $am_compiler_list; do
# Setup a source with many dependencies, because some compilers
# like to wrap large dependency lists on column 80 (with \), and
# we should not choose a depcomp mode which is confused by this.
#
# We need to recreate these files for each test, as the compiler may
# overwrite some of them when testing with obscure command lines.
# This happens at least with the AIX C compiler.
echo '#include "conftest.h"' > conftest.c
echo 'int i;' > conftest.h
echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf
: > sub/conftest.c
for i in 1 2 3 4 5 6; do
echo '#include "conftst'$i'.h"' >> sub/conftest.c
: > sub/conftst$i.h
done
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
case $depmode in
nosideeffect)
@ -3228,13 +3264,20 @@ else
# mode. It turns out that the SunPro C++ compiler does not properly
# handle `-M -o', and we need to detect this.
if depmode=$depmode \
source=conftest.c object=conftest.o \
depfile=conftest.Po tmpdepfile=conftest.TPo \
$SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
grep conftest.h conftest.Po > /dev/null 2>&1 &&
source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
$SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
>/dev/null 2>conftest.err &&
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
am_cv_CXX_dependencies_compiler_type=$depmode
break
# icc doesn't choke on unknown options, it will just issue warnings
# (even with -Werror). So we grep stderr for any message
# that says an option was ignored.
if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else
am_cv_CXX_dependencies_compiler_type=$depmode
break
fi
fi
done
@ -5709,6 +5752,7 @@ s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t
s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t
s,@AWK@,$AWK,;t t
s,@SET_MAKE@,$SET_MAKE,;t t
s,@am__leading_dot@,$am__leading_dot,;t t
s,@PATH_BUILD@,$PATH_BUILD,;t t
s,@MYSQL_PREFIX@,$MYSQL_PREFIX,;t t
s,@MYSQL_LIBS@,$MYSQL_LIBS,;t t
@ -6175,7 +6219,16 @@ echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
cat $tmp/config.h
rm -f $tmp/config.h
fi
_am_stamp_count=`expr ${_am_stamp_count-0} + 1`
# Compute $ac_file's index in $config_headers.
_am_stamp_count=1
for _am_header in $config_headers :; do
case $_am_header in
$ac_file | $ac_file:* )
break ;;
* )
_am_stamp_count=`expr $_am_stamp_count + 1` ;;
esac
done
echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null ||
$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X$ac_file : 'X\(//\)[^/]' \| \

View File

@ -103,6 +103,7 @@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
bindir = @bindir@
build_alias = @build_alias@

View File

@ -103,6 +103,7 @@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
bindir = @bindir@
build_alias = @build_alias@

View File

@ -103,6 +103,7 @@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
bindir = @bindir@
build_alias = @build_alias@

View File

@ -8,11 +8,13 @@ webgroup = @WEB_GROUP@
web_DATA = \
favicon.ico \
zm.php \
zm_actions.php \
zm_config.php \
zm_db.php \
zm_funcs.php \
zm_html.php \
zm_html_styles.css \
zm_html_view_bandwidth.php \
zm_html_view_console.php \
zm_html_view_cycle.php \
@ -50,6 +52,25 @@ web_DATA = \
zm_html_view_watchstatus.php \
zm_html_view_zone.php \
zm_html_view_zones.php \
zm_xhtml.php \
zm_xhtml_styles.css \
zm_xhtml_view_login.php \
zm_xhtml_view_console.php \
zm_xhtml_view_state.php \
zm_xhtml_view_function.php \
zm_xhtml_view_watch.php \
zm_xhtml_view_montage.php \
zm_xhtml_view_events.php \
zm_xhtml_view_event.php \
zm_xhtml_view_frame.php \
zm_xhtml_view_filter.php \
zm_xhtml_view_error.php \
zm_wml.php \
zm_wml_view_login.php \
zm_wml_view_postlogin.php \
zm_wml_view_console.php \
zm_wml_view_feed.php \
zm_wml_view_error.php \
zm_lang.php \
zm_lang_de_de.php \
zm_lang_en_gb.php \
@ -62,22 +83,19 @@ web_DATA = \
zm_lang_it_it.php \
zm_lang_it_it2.php \
zm_lang_es_ar.php \
zm_lang_pt_br.php \
zm.php \
zm_styles.css \
zm_wml.php \
zm_wml_view_console.php \
zm_wml_view_feed.php
zm_lang_pt_br.php
EXTRA_DIST = \
favicon.ico \
retag.sh \
swap.pl \
zm.php \
zm_actions.php \
zm_config.php.z \
zm_db.php \
zm_funcs.php \
zm_html.php \
zm_html_styles.css \
zm_html_view_bandwidth.php \
zm_html_view_console.php \
zm_html_view_cycle.php \
@ -115,6 +133,25 @@ EXTRA_DIST = \
zm_html_view_watchstatus.php \
zm_html_view_zone.php \
zm_html_view_zones.php \
zm_xhtml.php \
zm_xhtml_styles.css \
zm_xhtml_view_login.php \
zm_xhtml_view_console.php \
zm_xhtml_view_state.php \
zm_xhtml_view_function.php \
zm_xhtml_view_watch.php \
zm_xhtml_view_montage.php \
zm_xhtml_view_events.php \
zm_xhtml_view_event.php \
zm_xhtml_view_frame.php \
zm_xhtml_view_filter.php \
zm_xhtml_view_error.php \
zm_wml.php \
zm_wml_view_login.php \
zm_wml_view_postlogin.php \
zm_wml_view_console.php \
zm_wml_view_feed.php \
zm_wml_view_error.php \
zm_lang.php \
zm_lang_de_de.php \
zm_lang_en_gb.php \
@ -127,12 +164,7 @@ EXTRA_DIST = \
zm_lang_it_it.php \
zm_lang_it_it2.php \
zm_lang_es_ar.php \
zm_lang_pt_br.php \
zm.php \
zm_styles.css \
zm_wml.php \
zm_wml_view_console.php \
zm_wml_view_feed.php
zm_lang_pt_br.php
# Yes, you are correct. This is a HACK!
install-data-hook:

View File

@ -103,6 +103,7 @@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
bindir = @bindir@
build_alias = @build_alias@
@ -133,11 +134,13 @@ webgroup = @WEB_GROUP@
web_DATA = \
favicon.ico \
zm.php \
zm_actions.php \
zm_config.php \
zm_db.php \
zm_funcs.php \
zm_html.php \
zm_html_styles.css \
zm_html_view_bandwidth.php \
zm_html_view_console.php \
zm_html_view_cycle.php \
@ -175,6 +178,25 @@ web_DATA = \
zm_html_view_watchstatus.php \
zm_html_view_zone.php \
zm_html_view_zones.php \
zm_xhtml.php \
zm_xhtml_styles.css \
zm_xhtml_view_login.php \
zm_xhtml_view_console.php \
zm_xhtml_view_state.php \
zm_xhtml_view_function.php \
zm_xhtml_view_watch.php \
zm_xhtml_view_montage.php \
zm_xhtml_view_events.php \
zm_xhtml_view_event.php \
zm_xhtml_view_frame.php \
zm_xhtml_view_filter.php \
zm_xhtml_view_error.php \
zm_wml.php \
zm_wml_view_login.php \
zm_wml_view_postlogin.php \
zm_wml_view_console.php \
zm_wml_view_feed.php \
zm_wml_view_error.php \
zm_lang.php \
zm_lang_de_de.php \
zm_lang_en_gb.php \
@ -187,23 +209,20 @@ web_DATA = \
zm_lang_it_it.php \
zm_lang_it_it2.php \
zm_lang_es_ar.php \
zm_lang_pt_br.php \
zm.php \
zm_styles.css \
zm_wml.php \
zm_wml_view_console.php \
zm_wml_view_feed.php
zm_lang_pt_br.php
EXTRA_DIST = \
favicon.ico \
retag.sh \
swap.pl \
zm.php \
zm_actions.php \
zm_config.php.z \
zm_db.php \
zm_funcs.php \
zm_html.php \
zm_html_styles.css \
zm_html_view_bandwidth.php \
zm_html_view_console.php \
zm_html_view_cycle.php \
@ -241,6 +260,25 @@ EXTRA_DIST = \
zm_html_view_watchstatus.php \
zm_html_view_zone.php \
zm_html_view_zones.php \
zm_xhtml.php \
zm_xhtml_styles.css \
zm_xhtml_view_login.php \
zm_xhtml_view_console.php \
zm_xhtml_view_state.php \
zm_xhtml_view_function.php \
zm_xhtml_view_watch.php \
zm_xhtml_view_montage.php \
zm_xhtml_view_events.php \
zm_xhtml_view_event.php \
zm_xhtml_view_frame.php \
zm_xhtml_view_filter.php \
zm_xhtml_view_error.php \
zm_wml.php \
zm_wml_view_login.php \
zm_wml_view_postlogin.php \
zm_wml_view_console.php \
zm_wml_view_feed.php \
zm_wml_view_error.php \
zm_lang.php \
zm_lang_de_de.php \
zm_lang_en_gb.php \
@ -253,12 +291,7 @@ EXTRA_DIST = \
zm_lang_it_it.php \
zm_lang_it_it2.php \
zm_lang_es_ar.php \
zm_lang_pt_br.php \
zm.php \
zm_styles.css \
zm_wml.php \
zm_wml_view_console.php \
zm_wml_view_feed.php
zm_lang_pt_br.php
subdir = web
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs

View File

@ -29,20 +29,122 @@ if ( $debug )
//error_reporting( E_ALL );
}
// Useful debugging lines for mobile devices
//ob_start();
//phpinfo( INFO_VARIABLES );
//$fp = fopen( "/tmp/env.html", "w" );
//fwrite( $fp, ob_get_contents() );
//fclose( $fp );
//ob_end_clean();
if ( !isset($PHP_SELF) )
{
$PHP_SELF = $HTTP_SERVER_VARS['PHP_SELF'];
}
$accepts_wml = preg_match( '/text\/vnd.wap.wml/i', $HTTP_SERVER_VARS['HTTP_ACCEPT'] );
$accepts_html = preg_match( '/text\/html/i', $HTTP_SERVER_VARS['HTTP_ACCEPT'] );
if ( isset($wml) || ($accepts_wml && !$accepts_html) )
if ( empty($format) )
{
require_once( 'zm_wml.php' );
$wurfl_file = "wurfl/wurfl_class.php";
if ( file_exists( $wurfl_file ) )
{
require_once( $wurfl_file );
$wurfl = new wurfl_class( $wurfl, $wurfl_agents );
// Set the user agent
$wurfl->GetDeviceCapabilitiesFromAgent($HTTP_SERVER_VARS['HTTP_USER_AGENT']);
//print_r( $wurfl->wurfl_agent );
if ( $wurfl->wurfl_agent )
{
if ( $wurfl->getDeviceCapability( 'html_wi_oma_xhtmlmp_1_0' ) )
{
$format = "xhtml";
$cookies = false;
$device['width'] = $wurfl->getDeviceCapability( 'resolution_width' );
$device['height'] = $wurfl->getDeviceCapability( 'resolution_height' );
}
elseif ( $wurfl->getDeviceCapability( 'wml_1_3' ) )
{
$format = "wml";
$cookies = false;
$device['width'] = $wurfl->getDeviceCapability( 'resolution_width' );
$device['height'] = $wurfl->getDeviceCapability( 'resolution_height' );
}
}
else
{
$format = "html";
$cookies = true;
}
}
else
{
// This is an example of using fixed device strings to just match your phone etc
$devices = array(
array( 'name'=>"Motorola V600", 'ua_match'=>"MOT-V600", 'format'=>"xhtml", 'cookies'=>false, 'width'=>176, 'height'=>220 ),
array( 'name'=>"Motorola V600", 'ua_match'=>"MOT-A820", 'format'=>"xhtml", 'cookies'=>false, 'width'=>176, 'height'=>220 )
);
foreach ( $devices as $device )
{
if ( preg_match( '/'.$device['ua_match'].'/', $HTTP_SERVER_VARS['HTTP_USER_AGENT'] ) )
{
$format = $device['format'];
$cookies = $device['cookies'];
break;
}
}
if ( empty($format) )
{
$accepts_wml = preg_match( '/text\/vnd.wap.wml/i', $HTTP_SERVER_VARS['HTTP_ACCEPT'] );
$accepts_html = preg_match( '/text\/html/i', $HTTP_SERVER_VARS['HTTP_ACCEPT'] );
if ( $accepts_wml && !$accepts_html )
{
$format = "wml";
$cookies = false;
}
else
{
$format = "html";
$cookies = true;
}
}
}
}
ini_set( "session.name", "ZMSESSID" );
if ( $cookies )
{
ini_set( "session.use_cookies", "1" );
ini_set( "session.use_trans_sid", "0" );
ini_set( "url_rewriter.tags", "" );
}
else
{
require_once( 'zm_html.php' );
//ini_set( "session.auto_start", "1" );
ini_set( "session.use_cookies", "0" );
ini_set( "session.use_trans_sid", "1" );
if ( $format == "xhtml" )
{
ini_set( "arg_separator.output", "&amp;" );
ini_set( "url_rewriter.tags", "a=href,area=href,frame=src,input=src,fieldset=" );
}
elseif ( $format == "wml" )
{
ini_set( "arg_separator.output", "&amp;" );
ini_set( "url_rewriter.tags", "a=href,area=href,frame=src,input=src,go=href,card=ontimer" );
}
}
if ( !$HTTP_SESSION_VARS['format'] )
{
$HTTP_SESSION_VARS['format'] = $format;
$HTTP_SESSION_VARS['cookies'] = $cookies;
$HTTP_SESSION_VARS['device'] = $device;
}
require_once( "zm_$format.php" );
?>

View File

@ -143,7 +143,7 @@ if ( isset($action) )
echo mysql_error();
$monitor['Function'] = $new_function;
session_write_close();
if ( $cookies ) session_write_close();
zmcControl( $monitor, true );
zmaControl( $monitor, true );
$refresh_parent = true;
@ -186,7 +186,7 @@ if ( isset($action) )
$result = mysql_query( $sql );
if ( !$result )
die( mysql_error() );
session_write_close();
if ( $cookies ) session_write_close();
zmaControl( $mid, true );
$refresh_parent = true;
}
@ -298,7 +298,7 @@ if ( isset($action) )
die( mysql_error() );
$monitor = mysql_fetch_assoc( $result );
fixDevices();
session_write_close();
if ( $cookies ) session_write_close();
zmcControl( $monitor, true );
zmaControl( $monitor, true );
//daemonControl( 'restart', 'zmwatch.pl' );
@ -329,7 +329,7 @@ if ( isset($action) )
}
if ( $deleted_zid )
{
session_write_close();
if ( $cookies ) session_write_close();
zmaControl( $mid, true );
$refresh_parent = true;
}
@ -547,7 +547,7 @@ if ( isset($action) )
{
if ( $run_state )
{
session_write_close();
if ( $cookies ) session_write_close();
packageControl( $run_state );
$refresh_parent = true;
}
@ -656,7 +656,7 @@ if ( isset($action) )
{
$HTTP_SESSION_VARS['event_reset_time'] = strftime( "%Y-%m-%d %H:%M:%S" );
setcookie( "event_reset_time", $HTTP_SESSION_VARS['event_reset_time'], time()+3600*24*30*12*10 );
session_write_close();
if ( $cookies ) session_write_close();
}
}

View File

@ -55,6 +55,9 @@ define( "MAX_EVENTS", 10 ); // The maximum number of events to show in th
define( "RATE_SCALE", 100 ); // The additional scaling factor used to help get fractional rates in integer format
define( "SCALE_SCALE", 100 ); // The additional scaling factor used to help get fractional scales in integer format
define( "LEARN_MODE", false ); // Currently unimplemented, do not change
define( 'DEVICE_WIDTH', 150 ); // Default device width for phones and handhelds
define( 'DEVICE_HEIGHT', 150 ); // Default device height for phones and handhelds
define( 'DEVICE_LINES', 10 ); // Default device lines for phones and handhelds
require_once( 'zm_db.php' );
loadConfig();

View File

@ -20,7 +20,7 @@
function userLogin( $username, $password )
{
global $user, $HTTP_SESSION_VARS, $HTTP_SERVER_VARS;
global $user, $cookies, $HTTP_SESSION_VARS, $HTTP_SERVER_VARS;
$sql = "select * from Users where Username = '$username' and Password = password('$password') and Enabled = 1";
$result = mysql_query( $sql );
@ -37,7 +37,7 @@ function userLogin( $username, $password )
{
unset( $user );
}
session_write_close();
if ( $cookies ) session_write_close();
}
function userLogout()
@ -93,12 +93,12 @@ function deleteEvent( $eid )
}
}
function makeLink( $url, $label, $condition=1 )
function makeLink( $url, $label, $condition=1, $options="" )
{
$string = "";
if ( $condition )
{
$string .= '<a href="'.$url.'">';
$string .= '<a href="'.$url.'"'.($options?(' '.$options):'').'>';
}
$string .= $label;
if ( $condition )
@ -492,8 +492,9 @@ function reScale( $dimension, $scale=SCALE_SCALE )
return( (int)(($dimension*$scale)/SCALE_SCALE) );
}
function parseSort()
function parseSort( $save_to_session=false )
{
global $HTTP_SESSION_VARS;
global $sort_field, $sort_asc; // Inputs
global $sort_query, $sort_column, $sort_order; // Outputs
@ -545,21 +546,31 @@ function parseSort()
$sort_order = $sort_asc?"asc":"desc";
if ( !$sort_asc ) $sort_asc = 0;
$sort_query = "&sort_field=$sort_field&sort_asc=$sort_asc";
if ( $save_to_session )
{
$HTTP_SESSION_VARS['sort_field'] = $sort_field;
$HTTP_SESSION_VARS['sort_asc'] = $sort_asc;
}
}
function parseFilter()
function parseFilter( $save_to_session=false )
{
global $filter_query, $filter_sql, $filter_fields;
global $HTTP_SESSION_VARS;
global $trms; // Inputs
global $filter_query, $filter_sql, $filter_fields; // Outputs
$filter_query = '';
$filter_sql = '';
$filter_fields = '';
global $trms;
if ( $trms )
{
if ( $save_to_session )
{
$HTTP_SESSION_VARS['trms'] = $trms;
}
$filter_query .= "&trms=$trms";
$filter_fields .= '<input type="hidden" name="trms" value="'.$trms.'">'."\n";
$filter_fields .= '<input type="hidden" name="trms" value="'.$trms.'"/>'."\n";
for ( $i = 1; $i <= $trms; $i++ )
{
@ -576,18 +587,26 @@ function parseFilter()
{
$filter_query .= "&$conjunction_name=".$$conjunction_name;
$filter_sql .= " ".$$conjunction_name." ";
$filter_fields .= '<input type="hidden" name="'.$conjunction_name.'" value="'.$$conjunction_name.'">'."\n";
$filter_fields .= '<input type="hidden" name="'.$conjunction_name.'" value="'.$$conjunction_name.'"/>'."\n";
if ( $save_to_session )
{
$HTTP_SESSION_VARS[$conjunction_name] = $$conjunction_name;
}
}
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";
$filter_fields .= '<input type="hidden" name="'.$obracket_name.'" value="'.$$obracket_name.'"/>'."\n";
if ( $save_to_session )
{
$HTTP_SESSION_VARS[$obracket_name] = $$obracket_name;
}
}
if ( isset($$attr_name) )
{
$filter_query .= "&$attr_name=".$$attr_name;
$filter_fields .= '<input type="hidden" name="'.$attr_name.'" value="'.$$attr_name.'">'."\n";
$filter_fields .= '<input type="hidden" name="'.$attr_name.'" value="'.$$attr_name.'"/>'."\n";
switch ( $$attr_name )
{
case 'MonitorName':
@ -683,15 +702,25 @@ function parseFilter()
}
$filter_query .= "&$op_name=".urlencode($$op_name);
$filter_fields .= '<input type="hidden" name="'.$op_name.'" value="'.$$op_name.'">'."\n";
$filter_fields .= '<input type="hidden" name="'.$op_name.'" value="'.$$op_name.'"/>'."\n";
$filter_query .= "&$value_name=".urlencode($$value_name);
$filter_fields .= '<input type="hidden" name="'.$value_name.'" value="'.$$value_name.'">'."\n";
$filter_fields .= '<input type="hidden" name="'.$value_name.'" value="'.$$value_name.'"/>'."\n";
if ( $save_to_session )
{
$HTTP_SESSION_VARS[$attr_name] = $$attr_name;
$HTTP_SESSION_VARS[$op_name] = $$op_name;
$HTTP_SESSION_VARS[$value_name] = $$value_name;
}
}
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_fields .= '<input type="hidden" name="'.$cbracket_name.'" value="'.$$cbracket_name.'"/>'."\n";
if ( $save_to_session )
{
$HTTP_SESSION_VARS[$cbracket_name] = $$cbracket_name;
}
}
}
$filter_sql = " and ( $filter_sql )";
@ -724,4 +753,18 @@ function getDiskBlocks()
$space = $matches[1];
return( $space );
}
// Function to fix a problem whereby the built in PHP session handling
// features want to put the sid as a hidden field after the form or
// fieldset tag, neither of which will work with strict XHTML Basic.
function sidField()
{
if ( SID )
{
list( $sessname, $sessid ) = split( "=", SID );
?>
<input type="hidden" name="<?= $sessname ?>" value="<?= $sessid ?>"/>
<?php
}
}
?>

View File

@ -23,8 +23,6 @@ if ( !$bandwidth )
$bandwidth = "low";
}
ini_set( "session.use_trans_sid", "0" );
ini_set( "session.name", "ZMSESSID" );
//ini_set( "magic_quotes_gpc", "Off" );
require_once( 'zm_config.php' );
@ -140,7 +138,7 @@ switch( $view )
case "function" :
case "none" :
{
require_once( "zm_html_view_$view.php" );
require_once( "zm_".$format."_view_".$view.".php" );
break;
}
default :
@ -151,6 +149,6 @@ switch( $view )
if ( $view == "error" )
{
require_once( "zm_html_view_$view.php" );
require_once( "zm_".$format."_view_".$view.".php" );
}
?>

165
web/zm_html_styles.css Normal file
View File

@ -0,0 +1,165 @@
/*
* ZoneMinder Stylesheet, $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.
*/
.text {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size:10px;
color: #333333;
font-weight: normal
}
.redtext {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size:10px;
color: #DC143C;
font-weight: bold;
}
.ambtext {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size:10px;
color: #FF8C00;
font-weight: bold;
}
.gretext {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size:10px;
color: #688E23;
font-weight: bold;
}
.redtextem {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size:10px;
color: #DC143C;
font-weight: bold;
font-style: italic;
}
.ambtextem {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size:10px;
color: #FF8C00;
font-weight: bold;
font-style: italic;
}
.gretextem {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size:10px;
color: #688E23;
font-weight: bold;
font-style: italic;
}
.smallhead {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size:10px;
color: #016A9D;
font-weight: bold;
line-height: 20px
}
.head {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size:11px;
color: #000066;
font-weight: bold
}
.bighead {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size:12px;
color: #000066;
font-weight: bold
}
a:link {
color: #7F7FB2;
text-decoration: none
}
a:visited {
color: #7F7FB2;
text-decoration: none
}
a:hover {
color: #666699;
text-decoration: underline
}
.form {
border: 1px #7F7FB2 solid;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
color: #333333
}
.form-noborder {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
color: #333333
}
.textsmall {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size:9px;
color: #333333;
font-weight: normal
}
.closetext {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size:10px;
color: #333333;
font-weight: normal;
line-height: 12px
}
img.normal {
border: white solid 1px
}
img.alarm {
border: red solid 1px
}
td.activetab {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size:10px;
color: #333333;
font-weight: bold;
border-left: #7F7FB2 solid 2px;
border-top: #7F7FB2 solid 2px;
border-right: #7F7FB2 solid 2px;
border-bottom: #7F7FB2 dotted 1px;
text-align: center;
}
td.passivetab {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size:10px;
color: #333333;
font-weight: normal;
border: #7F7FB2 solid 1px;
background: #DDDDDD;
text-align: center;
}
td.nontab {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size:10px;
color: #333333;
font-weight: normal;
border-bottom: #7F7FB2 solid 1px;
}
td.ruled {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size:10px;
color: #333333;
font-weight: normal;
border-top: #7F7FB2 solid 1px;
}
tr.over {
background: #EEEEEE;
}
tr.out {
background: #FFFFFF;
}

View File

@ -24,7 +24,7 @@ $new_bandwidth = $bandwidth;
<html>
<head>
<title>ZM - <?= $zmSlangBandwidth ?></title>
<link rel="stylesheet" href="zm_styles.css" type="text/css">
<link rel="stylesheet" href="zm_html_styles.css" type="text/css">
<script language="JavaScript">
function closeWindow()
{

View File

@ -87,7 +87,7 @@ $montage_height = ZM_WEB_MONTAGE_HEIGHT?ZM_WEB_MONTAGE_HEIGHT:$max_height;
<html>
<head>
<title>ZM - Console</title>
<link rel="stylesheet" href="zm_styles.css" type="text/css">
<link rel="stylesheet" href="zm_html_styles.css" type="text/css">
<link rel="shortcut icon" href="favicon.ico">
<link rel="icon" type="image/ico" href="favicon.ico">
<script language="JavaScript">
@ -124,7 +124,8 @@ function confirmDelete()
if ( ZM_WEB_REFRESH_METHOD == "javascript" )
{
?>
window.setTimeout( "window.location.replace('<?= $PHP_SELF ?>?view=<?= $view ?>')", <?= (ZM_WEB_REFRESH_MAIN*1000) ?> );
//window.setTimeout( "window.location.replace('<?= $PHP_SELF ?>?view=<?= $view ?>')", <?= (ZM_WEB_REFRESH_MAIN*1000) ?> );
window.setTimeout( "window.location.replace('<?= $PHP_SELF ?>')", <?= (ZM_WEB_REFRESH_MAIN*1000) ?> );
<?php
}
?>

View File

@ -86,7 +86,7 @@ header("Pragma: no-cache"); // HTTP/1.0
<html>
<head>
<title>ZM - <?= $zmSlangCycleWatch ?></title>
<link rel="stylesheet" href="zm_styles.css" type="text/css">
<link rel="stylesheet" href="zm_html_styles.css" type="text/css">
<script language="JavaScript">
function newWindow(Url,Name,Width,Height)
{

View File

@ -22,7 +22,7 @@
<html>
<head>
<title>ZM - <?= $zmSlangError ?></title>
<link rel="stylesheet" href="zm_styles.css" type="text/css">
<link rel="stylesheet" href="zm_html_styles.css" type="text/css">
<script language="JavaScript">
function closeWindow()
{
@ -39,7 +39,6 @@ if ( window.parent != window )
</head>
<body>
<table align="center" border="0" cellspacing="2" cellpadding="2" width="96%">
<input type="hidden" name="action" value="login">
<tr><td colspan="2" class="smallhead" align="center">ZoneMinder <?= $zmSlangError ?></td></tr>
<tr><td colspan="2" class="text" align="center">&nbsp;</td></tr>
<tr><td colspan="2" class="text" align="center"><strong><?= $zmSlangYouNoPerms ?><br/><?= $zmSlangContactAdmin ?></strong></td></tr>

View File

@ -88,7 +88,7 @@ $paged = $event['Frames'] > $frames_per_page;
<html>
<head>
<title>ZM - <?= $zmSlangEvent ?> - <?= $event['Name'] ?></title>
<link rel="stylesheet" href="zm_styles.css" type="text/css">
<link rel="stylesheet" href="zm_html_styles.css" type="text/css">
<script language="JavaScript">
<?php
if ( !$event )

View File

@ -69,7 +69,7 @@ elseif ( !empty( $limit ) )
<html>
<head>
<title>ZM - <?= $zmSlangEvents ?></title>
<link rel="stylesheet" href="zm_styles.css" type="text/css">
<link rel="stylesheet" href="zm_html_styles.css" type="text/css">
<script language="JavaScript">
function newWindow(Url,Name,Width,Height)
{

View File

@ -20,8 +20,8 @@
if ( !canView( 'Events' ) )
{
$view = "error";
return;
$view = "error";
return;
}
$select_name = "filter_name";
$filter_names = array( ''=>'<?= $zmSlangChooseFilter ?>' );
@ -121,7 +121,7 @@ $sort_dirns = array(
<html>
<head>
<title>ZM - <?= $zmSlangEventFilter ?></title>
<link rel="stylesheet" href="zm_styles.css" type="text/css">
<link rel="stylesheet" href="zm_html_styles.css" type="text/css">
<script language="JavaScript">
function newWindow(Url,Name,Width,Height)
{
@ -298,7 +298,7 @@ else
<tr>
<td colspan="5" class="text"><hr width="100%"></td>
</tr>
<tr><td colspan="5" align="right"><input type="button" value="Reset" class="form" onClick="submitToFilter( document.filter_form, 1 );">&nbsp;&nbsp;<input type="button" value="Submit" class="form" onClick="if ( validateForm( document.filter_form ) ) submitToEvents( document.filter_form, 1 );"></td></tr>
<tr><td colspan="5" align="right"><input type="button" value="<?= $zmSlangReset ?>" class="form" onClick="submitToFilter( document.filter_form, 1 );">&nbsp;&nbsp;<input type="button" value="<?= $zmSlangSubmit ?>" class="form" onClick="if ( validateForm( document.filter_form ) ) submitToEvents( document.filter_form, 1 );"></td></tr>
</table></center>
</form>
</body>

View File

@ -27,7 +27,7 @@ if ( !canEdit( 'Events' ) )
<html>
<head>
<title>ZM - <?= $zmSlangSaveFilter ?></title>
<link rel="stylesheet" href="zm_styles.css" type="text/css">
<link rel="stylesheet" href="zm_html_styles.css" type="text/css">
<script language="JavaScript">
function closeWindow()
{

View File

@ -65,7 +65,7 @@ $img_class = $alarm_frame?"alarm":"normal";
<html>
<head>
<title>ZM - <?= $zmSlangFrame ?> <?= $eid."-".$fid ?></title>
<link rel="stylesheet" href="zm_styles.css" type="text/css">
<link rel="stylesheet" href="zm_html_styles.css" type="text/css">
<script language="JavaScript">
window.focus();
function newWindow(Url,Name,Width,Height)

View File

@ -42,7 +42,7 @@ while ( $row = mysql_fetch_assoc( $result ) )
<html>
<head>
<title>ZM - <?= $zmSlangFrames ?> <?= $eid ?></title>
<link rel="stylesheet" href="zm_styles.css" type="text/css">
<link rel="stylesheet" href="zm_html_styles.css" type="text/css">
<script language="JavaScript">
window.focus();
function newWindow(Url,Name,Width,Height)

View File

@ -32,7 +32,7 @@ $monitor = mysql_fetch_assoc( $result );
<html>
<head>
<title>ZM - <?= $zmSlangFunction ?> - <?= $monitor['Name'] ?></title>
<link rel="stylesheet" href="zm_styles.css" type="text/css">
<link rel="stylesheet" href="zm_html_styles.css" type="text/css">
<script language="JavaScript">
<?php
if ( !empty($refresh_parent) )

View File

@ -22,7 +22,7 @@
<html>
<head>
<title>ZM - <?= $zmSlangLogin ?></title>
<link rel="stylesheet" href="zm_styles.css" type="text/css">
<link rel="stylesheet" href="zm_html_styles.css" type="text/css">
<script language="JavaScript">
window.resizeTo( <?= $jws['console']['w'] ?>, <?= $jws['console']['h'] ?> );
</script>

View File

@ -22,7 +22,7 @@
<html>
<head>
<title>ZM - <?= $zmSlangLogout ?></title>
<link rel="stylesheet" href="zm_styles.css" type="text/css">
<link rel="stylesheet" href="zm_html_styles.css" type="text/css">
<script language="JavaScript">
function closeWindow()
{

View File

@ -98,7 +98,7 @@ $orientations = array( $zmSlangNormal=>0, $zmSlangRotateRight=>90, $zmSlangInver
<html>
<head>
<title>ZM - <?= $zmSlangMonitor ?> <?= $monitor['Name'] ?></title>
<link rel="stylesheet" href="zm_styles.css" type="text/css">
<link rel="stylesheet" href="zm_html_styles.css" type="text/css">
<script language="JavaScript">
<?php
if ( !empty($refresh_parent) )

View File

@ -70,7 +70,7 @@ $col_spec = join( ',', $widths );
<html>
<head>
<title>ZM - <?= $zmSlangMontage ?></title>
<link rel="stylesheet" href="zm_styles.css" type="text/css">
<link rel="stylesheet" href="zm_html_styles.css" type="text/css">
<script language="JavaScript">
window.focus();
</script>

View File

@ -61,7 +61,7 @@ $image_src = ZM_PATH_ZMS."?mode=single&monitor=".$monitor['Id']."&scale=".$scale
<html>
<head>
<title>ZM - <?= $monitor['Name'] ?> - <?= $zmSlangFeed ?></title>
<link rel="stylesheet" href="zm_styles.css" type="text/css">
<link rel="stylesheet" href="zm_html_styles.css" type="text/css">
<script language="JavaScript">
<?php
if ( $mode != "stream" && ZM_WEB_REFRESH_METHOD == "javascript" )

View File

@ -41,7 +41,7 @@ if ( $mid )
?>
<html>
<head>
<link rel="stylesheet" href="zm_styles.css" type="text/css">
<link rel="stylesheet" href="zm_html_styles.css" type="text/css">
</head>
<body>
<table width="96%" align="center" border="0" cellspacing="0" cellpadding="4">

View File

@ -64,7 +64,7 @@ header("Pragma: no-cache"); // HTTP/1.0
?>
<html>
<head>
<link rel="stylesheet" href="zm_styles.css" type="text/css">
<link rel="stylesheet" href="zm_html_styles.css" type="text/css">
<script language="JavaScript">
<?php
if ( ZM_WEB_POPUP_ON_ALARM && $new_alarm )

View File

@ -25,7 +25,7 @@ $option_help_text = $$option_help_var?$$option_help_var:$config[$option]['Help']
<html>
<head>
<title>ZM - <?= $zmSlangOptionHelp ?></title>
<link rel="stylesheet" href="zm_styles.css" type="text/css">
<link rel="stylesheet" href="zm_html_styles.css" type="text/css">
<script language="JavaScript">
function closeWindow()
{

View File

@ -49,7 +49,7 @@ if ( !isset($tab) )
<html>
<head>
<title>ZM - <?= $zmSlangOptions ?></title>
<link rel="stylesheet" href="zm_styles.css" type="text/css">
<link rel="stylesheet" href="zm_html_styles.css" type="text/css">
<script language="JavaScript">
<?php
if ( !empty($refresh_parent) )

View File

@ -22,7 +22,7 @@
<html>
<head>
<title>ZM - <?= $zmSlangLoggingIn ?></title>
<link rel="stylesheet" href="zm_styles.css" type="text/css">
<link rel="stylesheet" href="zm_html_styles.css" type="text/css">
<script language="JavaScript">
//window.resizeTo( <?= $jws['console']['w'] ?>, <?= $jws['console']['h'] ?> );
window.setTimeout( "window.location.replace('<?= $PHP_SELF ?>')", 250 );
@ -30,7 +30,6 @@ window.setTimeout( "window.location.replace('<?= $PHP_SELF ?>')", 250 );
</head>
<body>
<table align="center" border="0" cellspacing="2" cellpadding="2" width="96%">
<input type="hidden" name="action" value="login">
<tr><td colspan="2" class="smallhead" align="center">ZoneMinder - <?= $zmSlangLogin ?></td></tr>
<tr><td colspan="2" class="text" align="center">&nbsp;</td></tr>
<tr><td colspan="2" class="text" align="center"><strong><?= $zmSlangLoggingIn ?></strong></td></tr>

View File

@ -22,7 +22,7 @@
<html>
<head>
<title>ZM - Restarting</title>
<link rel="stylesheet" href="zm_styles.css" type="text/css">
<link rel="stylesheet" href="zm_html_styles.css" type="text/css">
<script language="JavaScript">
function closeWindow()
{

View File

@ -41,7 +41,7 @@ $monitor['Colour'] = $colour;
<html>
<head>
<title>ZM - <?= $monitor['Name'] ?> - <?= $zmSlangSettings ?></title>
<link rel="stylesheet" href="zm_styles.css" type="text/css">
<link rel="stylesheet" href="zm_html_styles.css" type="text/css">
<script language="JavaScript">
<?php
if ( !empty($refresh_parent) )

View File

@ -37,7 +37,7 @@ while( $state = mysql_fetch_assoc( $result ) )
<html>
<head>
<title>ZM - <?= $zmSlangState ?></title>
<link rel="stylesheet" href="zm_styles.css" type="text/css">
<link rel="stylesheet" href="zm_html_styles.css" type="text/css">
<script language="JavaScript">
<?php
if ( !empty($refresh_parent) )

View File

@ -43,7 +43,7 @@ while ( $row = mysql_fetch_assoc( $result ) )
<html>
<head>
<title>ZM - <?= $zmSlangStats ?> <?= $eid."-".$fid ?></title>
<link rel="stylesheet" href="zm_styles.css" type="text/css">
<link rel="stylesheet" href="zm_html_styles.css" type="text/css">
<script language="JavaScript">
window.focus();
function closeWindow()

View File

@ -37,7 +37,7 @@ if ( !($row = mysql_fetch_assoc( $result )) )
<html>
<head>
<title>ZM - <?= $zmSlangUser ?> - <?= $row['Username'] ?></title>
<link rel="stylesheet" href="zm_styles.css" type="text/css">
<link rel="stylesheet" href="zm_html_styles.css" type="text/css">
<script language="JavaScript">
<?php
if ( !empty($refresh_parent) )

View File

@ -41,7 +41,7 @@ if ( ZM_DYN_CURR_VERSION != ZM_DYN_LAST_VERSION )
<html>
<head>
<title>ZM - <?= $zmSlangVersion ?></title>
<link rel="stylesheet" href="zm_styles.css" type="text/css">
<link rel="stylesheet" href="zm_html_styles.css" type="text/css">
<script language="JavaScript">
window.focus();
function zmWindow()

View File

@ -39,7 +39,7 @@ ob_start();
<html>
<head>
<title>ZM - <?= $zmSlangVideo ?> - <?= $event['Name'] ?></title>
<link rel="stylesheet" href="zm_styles.css" type="text/css">
<link rel="stylesheet" href="zm_html_styles.css" type="text/css">
</head>
<body>
<form name="video_form" method="post" action="<?= $PHP_SELF ?>">
@ -101,7 +101,7 @@ location.replace('<?= $video_path ?>');
?>
<html>
<head>
<link rel="stylesheet" href="zm_styles.css" type="text/css">
<link rel="stylesheet" href="zm_html_styles.css" type="text/css">
</head>
<body>
<p class="head" align="center"><font color="red"><br><br><?= $zmSlangVideoGenFailed ?><br><br></font></p>

View File

@ -37,7 +37,7 @@ $height_scale = $scale;
<html>
<head>
<title>ZM - <?= $monitor['Name'] ?> - <?= $zmSlangWatch ?></title>
<link rel="stylesheet" href="zm_styles.css" type="text/css">
<link rel="stylesheet" href="zm_html_styles.css" type="text/css">
<script language="JavaScript">
window.resizeTo( <?= reScale($monitor['Width'],$width_scale)+$jws['watch']['w'] ?>, <?= reScale($monitor['Height'],$height_scale)+$jws['watch']['h'] ?> );
//opener.location.reload();

View File

@ -43,7 +43,7 @@ $monitor = mysql_fetch_assoc( $result );
<html>
<head>
<title>ZM - <?= $monitor['Name'] ?> - <?= $zmSlangEvents ?></title>
<link rel="stylesheet" href="zm_styles.css" type="text/css">
<link rel="stylesheet" href="zm_html_styles.css" type="text/css">
<script language="JavaScript">
function newWindow(Url,Name,Width,Height)
{

View File

@ -58,7 +58,7 @@ $image_src = ZM_PATH_ZMS."?mode=single&monitor=".$monitor['Id']."&scale=".$scale
<html>
<head>
<title>ZM - <?= $monitor['Name'] ?> - <?= $zmSlangFeed ?></title>
<link rel="stylesheet" href="zm_styles.css" type="text/css">
<link rel="stylesheet" href="zm_html_styles.css" type="text/css">
<script language="JavaScript">
<?php
if ( $mode != "stream" && ZM_WEB_REFRESH_METHOD == "javascript" )

View File

@ -43,7 +43,7 @@ if ( !isset( $scale ) )
?>
<html>
<head>
<link rel="stylesheet" href="zm_styles.css" type="text/css">
<link rel="stylesheet" href="zm_html_styles.css" type="text/css">
<script language="JavaScript">
function newWindow(Url,Name,Width,Height)
{

View File

@ -69,7 +69,7 @@ header("Pragma: no-cache"); // HTTP/1.0
?>
<html>
<head>
<link rel="stylesheet" href="zm_styles.css" type="text/css">
<link rel="stylesheet" href="zm_html_styles.css" type="text/css">
<script language="JavaScript">
<?php
if ( ZM_WEB_POPUP_ON_ALARM && $new_alarm )

View File

@ -49,7 +49,7 @@ $new_zone = $zone;
<html>
<head>
<title>ZM - <?= $monitor['Name'] ?> - <?= $zmSlangZone ?> <?= $zone['Name'] ?></title>
<link rel="stylesheet" href="zm_styles.css" type="text/css">
<link rel="stylesheet" href="zm_html_styles.css" type="text/css">
<script language="JavaScript">
<?php
if ( !empty($refresh_parent) )

View File

@ -47,7 +47,7 @@ $image = $monitor['Name']."-Zones.jpg";
<html>
<head>
<title>ZM - <?= $monitor['Name'] ?> - <?= $zmSlangZones ?></title>
<link rel="stylesheet" href="zm_styles.css" type="text/css">
<link rel="stylesheet" href="zm_html_styles.css" type="text/css">
<script language="JavaScript">
window.focus();
function newWindow(Url,Name,Width,Height)

View File

@ -139,6 +139,7 @@ $zmSlangConjAnd = 'and';
$zmSlangConjOr = 'or';
$zmSlangConsole = 'Console';
$zmSlangContactAdmin = 'Please contact your adminstrator for details.';
$zmSlangContinue = 'Continue';
$zmSlangContrast = 'Contrast';
$zmSlangCycle = 'Cycle';
$zmSlangCycleWatch = 'Cycle Watch';
@ -273,6 +274,7 @@ $zmSlangPassword = 'Password';
$zmSlangPasswordsDifferent = 'The new and confirm passwords are different';
$zmSlangPaths = 'Paths';
$zmSlangPlayAll = 'Play All';
$zmSlangPhone = 'Phone';
$zmSlangPhoneBW = 'Phone&nbsp;B/W';
$zmSlangPixels = 'pixels';
$zmSlangPleaseWait = 'Please Wait';
@ -291,6 +293,7 @@ $zmSlangRemoteImageColours = 'Remote Image Colours';
$zmSlangRemote = 'Remote';
$zmSlangRename = 'Rename';
$zmSlangReplay = 'Replay';
$zmSlangReset = 'Reset';
$zmSlangResetEventCounts = 'Reset Event Counts';
$zmSlangRestarting = 'Restarting';
$zmSlangRestart = 'Restart';
@ -325,6 +328,7 @@ $zmSlangStills = 'Stills';
$zmSlangStopped = 'Stopped';
$zmSlangStop = 'Stop';
$zmSlangStream = 'Stream';
$zmSlangSubmit = 'Submit';
$zmSlangSystem = 'System';
$zmSlangThumbnail = 'Thumbnail';
$zmSlangTimeDelta = 'Time Delta';
@ -334,6 +338,7 @@ $zmSlangTimestampLabelY = 'Timestamp Label Y';
$zmSlangTimestamp = 'Timestamp';
$zmSlangTimeStamp = 'Time Stamp';
$zmSlangTime = 'Time';
$zmSlangToday = 'Today';
$zmSlangTools = 'Tools';
$zmSlangTotalBrScore = 'Total<br/>Score';
$zmSlangTriggers = 'Triggers';

View File

@ -95,7 +95,7 @@ $zmSlangAttrAvgScore = 'Gem. score';
$zmSlangAttrDate = 'Datum';
$zmSlangAttrDateTime = 'Datum/tijd';
$zmSlangAttrDiskBlocks = 'Disk Blocks';
$zmSlangAttrDiskPercent = 'Disk Percentage';
$zmSlangAttrDiskPercent = 'Disk Percent';
$zmSlangAttrDuration = 'Duur';
$zmSlangAttrFrames = 'Frames';
$zmSlangAttrId = 'Id';

View File

@ -1,6 +1,6 @@
<?php
//
// ZoneMinder WML interface file, $Date$, $Revision$
// ZoneMinder HTML interface file, $Date$, $Revision$
// Copyright (C) 2003 Philip Coombes
//
// This program is free software; you can redistribute it and/or
@ -18,47 +18,131 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
//
// Note: This is _really_ prototypical and not intended to be much
// use at present. However I'm working on a much nicer version with
// built in brower capability detection which should be much nicer.
//
$bandwidth = "phone";
ini_set( "session.name", "ZMSESSID" );
ini_set( "session.auto_start", "1" );
ini_set( "session.use_cookies", "0" );
ini_set( "session.use_trans_sid", "1" );
ini_set( "arg_separator.output", "&amp;" );
ini_set( "url_rewriter.tags", ini_get( "url_rewriter.tags" ).",card=ontimer" );
session_start();
$bandwidth = "mobile";
//ini_set( "magic_quotes_gpc", "Off" );
require_once( 'zm_config.php' );
if ( ZM_OPT_USE_AUTH )
{
session_start();
if ( isset( $HTTP_SESSION_VARS['user'] ) )
{
$user = $HTTP_SESSION_VARS['user'];
define( "ZMU_COMMAND", ZMU_PATH." -U ".$HTTP_SESSION_VARS['username']." -P ".$HTTP_SESSION_VARS['password'] );
}
else
{
unset( $user );
}
}
else
{
$user = array(
"Username"=>"admin",
"Password"=>"",
"Language"=>"",
"Enabled"=>1,
"Stream"=>'View',
"Events"=>'Edit',
"Monitors"=>'Edit',
"System"=>'Edit',
);
define( "ZMU_COMMAND", ZMU_PATH );
}
require_once( 'zm_lang.php' );
require_once( 'zm_funcs.php' );
require_once( 'zm_actions.php' );
define( "WAP_COOKIES", false );
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
header("Content-type: text/vnd.wap.wml");
header("Content-type: text/vnd.wap.wml");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
echo( '<?xml version="1.0"?>'."\n" );
echo( '<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">'."\n" );
echo( '<?xml version="1.0" encoding="iso-8859-1"?>'."\n" );
//echo( '<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">'."\n" );
echo( '<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.3//EN" "http://www.wapforum.org/DTD/wml13.dtd">'."\n" );
if ( !$view )
ob_start();
$rates = array(
"10000" => "100x",
"5000" => "50x",
"2500" => "25x",
"1000" => "10x",
"400" => "4x",
"200" => "2x",
"100" => $zmSlangReal,
"50" => "1/2x",
"25" => "1/4x",
);
$scales = array(
"400" => "4x",
"300" => "3x",
"200" => "2x",
"150" => "1.5x",
"100" => $zmSlangActual,
"75" => "3/4x",
"50" => "1/2x",
"33" => "1/3x",
"25" => "1/4x",
);
if ( !isset($user) )
{
$view = "login";
}
elseif ( !isset($view) )
{
$view = "console";
}
switch( $view )
{
case "login" :
case "postlogin" :
case "logout" :
case "console" :
case "feed" :
case "state" :
case "cycle" :
case "watch" :
case "watchfeed" :
case "watchstatus" :
case "imagefetch" :
case "settings" :
case "events" :
case "filter" :
case "filtersave" :
case "event" :
case "frame" :
case "frames" :
case "monitor" :
case "video" :
case "function" :
case "none" :
{
require_once( "zm_wml_view_$view.php" );
require_once( "zm_".$format."_view_".$view.".php" );
break;
}
default :
{
$view = "error";
}
}
if ( $view == "error" )
{
require_once( "zm_".$format."_view_".$view.".php" );
}
$fp = fopen( "/tmp/output.html", "w" );
fwrite( $fp, ob_get_contents() );
fclose( $fp );
ob_end_flush();
?>

View File

@ -18,11 +18,11 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
if ( !$HTTP_SESSION_VARS['event_reset_time'] )
$HTTP_SESSION_VARS['event_reset_time'] = "2000-01-01 00:00:00";
$running = daemonCheck();
$status = $running?$zmSlangRunning:$zmSlangStopped;
$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";
$sql = "select M.*, count(if(E.StartTime>'$db_now' - INTERVAL 1 HOUR && E.Archived = 0,1,NULL)) as HourEventCount, count(if((to_days(E.StartTime)=to_days('$db_now')) && E.Archived = 0,1,NULL)) as TodayEventCount 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();
@ -32,69 +32,74 @@ $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']'";
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++;
}
$sql = "select distinct Device from Monitors order by Device";
$result = mysql_query( $sql );
if ( !$result )
echo mysql_error();
$devices = array();
while( $row = mysql_fetch_assoc( $result ) )
{
$ps_array = preg_split( "/\s+/", exec( "ps -edalf | grep 'zmc $row['Device']' | grep -v grep" ) );
if ( $ps_array[3] )
if ( $row['Function'] != 'None' )
{
$row['zmc'] = 1;
$cycle_count++;
if ( $max_width < $row['Width'] ) $max_width = $row['Width'];
if ( $max_height < $row['Height'] ) $max_height = $row['Height'];
}
$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 ?>">
<timer value="<?= ZM_WEB_REFRESH_MAIN*10 ?>"/>
<p mode="nowrap" align="center"><strong>ZM - <?= $zmSlangConsole ?></strong></p>
<p mode="nowrap" align="center"><?= count($monitors) ?> <?= $zmSlangMonitors ?> - <?= strftime( "%T" ) ?></p>
<p mode="nowrap" align="center"><?= $HTTP_SESSION_VARS['event_reset_time'] ?></p>
<timer value="<?= REFRESH_MAIN*10 ?>"/>
<p align="center">
<table columns="3">
<tr>
<td><?= $zmSlangName ?></td>
<td><?= $zmSlangFunc ?></td>
<td><?= $zmSlangEvents ?></td>
</tr>
<?= date( "H:i" ) ?> - <?= makeLink( "$PHP_SELF?view=state", $status, canEdit( 'System' ) ) ?> - <?= getLoad() ?> / <?= getDiskPercent() ?>%
<table columns="4" align="LLRR">
<?php
$reset_event_count = 0;
foreach( $monitors as $monitor )
if ( false )
{
$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>
<td><a href="<?= $PHP_SELF ?>?view=function&amp;mid=<?= $monitor['Id'] ?>"><?= substr( $monitor['Function'], 0, 1 ) ?></a></td>
<td><a href="<?= $PHP_SELF ?>?view=events&amp;mid=<?= $monitor['Id'] ?>"><?= $monitor['ResetEventCount'] ?></a></td>
<td><?= substr( $zmSlangName, 0, 5 ) ?></td>
<td><?= substr( $zmSlangFunction, 0, 4 ) ?></td>
<td><?= $zmSlangHour ?></td>
<td><?= $zmSlangToday ?></td>
</tr>
<?php
}
$monitor_count = 0;
$hour_event_count = 0;
$today_event_count = 0;
foreach( $monitors as $monitor )
{
$monitor_count++;
$hour_event_count += $monitor['HourEventCount'];
$today_event_count += $monitor['TodayEventCount'];
?>
<tr>
<td><?= makeLink( "$PHP_SELF?view=watch&amp;mid=".$monitor['Id'], substr( $monitor['Name'], 0, 6 ), canView( 'Stream' ), 'accesskey="'.$monitor_count.'"' ) ?></td>
<td><?= makeLink( "$PHP_SELF?view=function&amp;mid=".$monitor['Id'], substr( $monitor['Function'], 0, 4 ), canEdit( 'Monitors' ) ) ?></td>
<td><?= makeLink( "$PHP_SELF?view=events&amp;page=1&amp;filter=1&amp;trms=3&amp;attr1=MonitorId&amp;op1=%3d&amp;val1=".$monitor['Id']."&amp;cnj2=and&amp;attr2=Archived&amp;val2=0&amp;cnj3=and&amp;attr3=DateTime&amp;op3=%3e%3d&amp;val3=-1+hour", $monitor['HourEventCount'], canView( 'Events' ) ) ?></td>
<td><?= makeLink( "$PHP_SELF?view=events&amp;page=1&amp;filter=1&amp;trms=3&amp;attr1=MonitorId&amp;op1=%3d&amp;val1=".$monitor['Id']."&amp;cnj2=and&amp;attr2=Archived&amp;val2=0&amp;cnj3=and&amp;attr3=DateTime&amp;op3=%3e%3d&amp;val3=today", $monitor['TodayEventCount'], canView( 'Events' ) ) ?></td>
</tr>
<?php
}
?>
<tr>
<td>&nbsp;</td>
<td><?= makeLink( "$PHP_SELF?view=cycle", count($monitors), ( canView( 'Stream' ) && $cycle_count > 1 ) ) ?></td>
<td><?= makeLink( "$PHP_SELF?view=events&amp;page=1&amp;filter=1&amp;trms=2&amp;attr1=Archived&amp;val1=0&amp;cnj2=and&amp;attr2=DateTime&amp;op2=%3e%3d&amp;val2=-1+hour", $hour_event_count, canView( 'Events' ) ) ?></td>
<td><?= makeLink( "$PHP_SELF?view=events&amp;page=1&amp;filter=1&amp;trms=2&amp;attr1=Archived&amp;val1=0&amp;cnj2=and&amp;attr2=DateTime&amp;op2=%3e%3d&amp;val2=today", $today_event_count, canView( 'Events' ) ) ?></td>
</tr>
</table>
<do type="accept" name="Refresh" label="<?= $zmSlangRefresh ?>">
<go href="<?= $PHP_SELF ?>" method="post">
<postfield name="view" value="<?= $view ?>"/>
</go>
</do>
</p>
<p mode="nowrap" align="center"><a href="<?= $PHP_SELF ?>?view=<?= $view ?>&amp;action=reset"><?= $zmSlangResetEventCounts ?></a></p>
</card>
</wml>

32
web/zm_wml_view_error.php Normal file
View File

@ -0,0 +1,32 @@
<?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.
//
?>
<wml>
<card id="zmError" title="ZM - <?= $zmSlangError ?>">
<table columns="1" align="C">
<tr><td>ZoneMinder <?= $zmSlangError ?></td></tr>
<tr><td>&nbsp;</td></tr>
<tr><td><strong><?= $zmSlangYouNoPerms ?></strong></td></tr>
<tr><td><strong><?= $zmSlangContactAdmin ?></strong></td></tr>
<tr><td>&nbsp;</td></tr>
</table>
</card>
</wml>

38
web/zm_wml_view_login.php Normal file
View File

@ -0,0 +1,38 @@
<?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.
//
?>
<wml>
<card id="zmLogin" title="ZM - <?= $zmSlangLogin ?>">
<p align="center">ZoneMinder <?= $zmSlangLogin ?></p>
<p align="center">
<input title="<?= $zmSlangUsername ?>" type="text" name="Username" value="<?= isset($username)?$username:"" ?>" size="12"/><br/>
<input title="<?= $zmSlangPassword ?>" type="password" name="Password" value="" size="12"/><br/>
<do type="accept" name="Login" label="<?= $zmSlangLogin ?>">
<go href="<?= $PHP_SELF ?>" method="post">
<postfield name="action" value="login"/>
<postfield name="view" value="postlogin"/>
<postfield name="username" value="$(Username)"/>
<postfield name="password" value="$(Password)"/>
</go>
</do>
</p>
</card>
</wml>

View File

@ -0,0 +1,32 @@
<?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.
//
?>
<wml>
<card id="zmLoggingIn" title="ZM - <?= $zmSlangLoggingIn ?>" ontimer="<?= $PHP_SELF ?>?view=console">
<timer value="25"/>
<p align="center"><br/>ZoneMinder - <?= $zmSlangLogin ?></p>
<p align="center"><br/><strong><?= $zmSlangLoggingIn ?></strong><br/><br/>
<do type="accept" name="Continue" label="<?= $zmSlangContinue ?>">
<go href="<?= $PHP_SELF ?>?view=console" />
</do>
</p>
</card>
</wml>

144
web/zm_xhtml.php Normal file
View File

@ -0,0 +1,144 @@
<?php
//
// ZoneMinder HTML interface 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.
//
$bandwidth = "phone";
//ini_set( "magic_quotes_gpc", "Off" );
require_once( 'zm_config.php' );
if ( ZM_OPT_USE_AUTH )
{
session_start();
if ( isset( $HTTP_SESSION_VARS['user'] ) )
{
$user = $HTTP_SESSION_VARS['user'];
define( "ZMU_COMMAND", ZMU_PATH." -U ".$HTTP_SESSION_VARS['username']." -P ".$HTTP_SESSION_VARS['password'] );
}
else
{
unset( $user );
}
}
else
{
$user = array(
"Username"=>"admin",
"Password"=>"",
"Language"=>"",
"Enabled"=>1,
"Stream"=>'View',
"Events"=>'Edit',
"Monitors"=>'Edit',
"System"=>'Edit',
);
define( "ZMU_COMMAND", ZMU_PATH );
}
require_once( 'zm_lang.php' );
require_once( 'zm_funcs.php' );
require_once( 'zm_actions.php' );
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
header("Content-type: application/xhtml+xml" );
echo( '<?xml version="1.0" encoding="iso-8859-1"?>'."\n" );
echo( '<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">'."\n" );
ob_start();
$rates = array(
"10000" => "100x",
"5000" => "50x",
"2500" => "25x",
"1000" => "10x",
"400" => "4x",
"200" => "2x",
"100" => $zmSlangReal,
"50" => "1/2x",
"25" => "1/4x",
);
$scales = array(
"400" => "4x",
"300" => "3x",
"200" => "2x",
"150" => "1.5x",
"100" => $zmSlangActual,
"75" => "3/4x",
"50" => "1/2x",
"33" => "1/3x",
"25" => "1/4x",
);
if ( !isset($user) )
{
$view = "login";
}
elseif ( !isset($view) )
{
$view = "console";
}
switch( $view )
{
case "login" :
case "postlogin" :
case "logout" :
case "console" :
case "state" :
case "cycle" :
case "watch" :
case "montage" :
case "settings" :
case "events" :
case "filter" :
case "event" :
case "frame" :
case "frames" :
case "monitor" :
case "video" :
case "function" :
case "none" :
{
require_once( "zm_".$format."_view_".$view.".php" );
break;
}
default :
{
$view = "error";
}
}
if ( $view == "error" )
{
require_once( "zm_".$format."_view_".$view.".php" );
}
$fp = fopen( "/tmp/output.html", "w" );
fwrite( $fp, ob_get_contents() );
fclose( $fp );
ob_end_flush();
?>

158
web/zm_xhtml_styles.css Normal file
View File

@ -0,0 +1,158 @@
/*
* ZoneMinder Stylesheet, $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.
*/
.text {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size:8px;
color: #333333;
font-weight: normal
}
.redtext {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size:8px;
color: #DC143C;
}
.ambtext {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size:8px;
color: #FF8C00;
}
.gretext {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size:8px;
color: #688E23;
}
.redtextem {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size:8px;
color: #DC143C;
text-transform: lowercase;
}
.ambtextem {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size:8px;
color: #FF8C00;
text-transform: lowercase;
}
.gretextem {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size:8px;
color: #688E23;
text-transform: lowercase;
}
.bighead {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size:9px;
color: #000066;
font-weight: bold
}
.smallhead {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size:8px;
color: #016A9D;
font-weight: bold;
}
.head {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size:11px;
color: #000066;
font-weight: bold
}
a:link {
color: #7F7FB2;
text-decoration: none
}
a:visited {
color: #7F7FB2;
text-decoration: none
}
a:hover {
color: #666699;
text-decoration: underline
}
.form {
border: 1px #7F7FB2 solid;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 8px;
color: #333333
}
.form-noborder {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 8px;
color: #333333
}
.textsmall {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size:7px;
color: #333333;
font-weight: normal
}
.closetext {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size:8px;
color: #333333;
font-weight: normal;
line-height: 12px
}
img.normal {
border: white solid 1px
}
img.alarm {
border: red solid 1px
}
td.activetab {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size:8px;
color: #333333;
font-weight: bold;
border-left: #7F7FB2 solid 2px;
border-top: #7F7FB2 solid 2px;
border-right: #7F7FB2 solid 2px;
border-bottom: #7F7FB2 dotted 1px;
text-align: center;
}
td.passivetab {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size:8px;
color: #333333;
font-weight: normal;
border: #7F7FB2 solid 1px;
background: #DDDDDD;
text-align: center;
}
td.nontab {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size:8px;
color: #333333;
font-weight: normal;
border-bottom: #7F7FB2 solid 1px;
}
td.ruled {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size:8px;
color: #333333;
font-weight: normal;
border-top: #7F7FB2 solid 1px;
}
tr.over {
background: #EEEEEE;
}
tr.out {
background: #FFFFFF;
}

View File

@ -0,0 +1,121 @@
<?php
//
// 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.
//
$running = daemonCheck();
$status = $running?$zmSlangRunning:$zmSlangStopped;
$db_now = strftime( "%Y-%m-%d %H:%M:%S" );
$sql = "select M.*, count(if(E.StartTime>'$db_now' - INTERVAL 1 HOUR && E.Archived = 0,1,NULL)) as HourEventCount, count(if((to_days(E.StartTime)=to_days('$db_now')) && E.Archived = 0,1,NULL)) as TodayEventCount 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'] ) )
{
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'];
}
}
?>
<html>
<head>
<title>ZM - <?= $zmSlangConsole ?></title>
<link rel="stylesheet" href="zm_xhtml_styles.css" type="text/css"/>
</head>
<body>
<p align="center"><a href="<?= $PHP_SELF ?>?view=<?= $view ?>"><?= date( "H:i" ) ?></a> - <?= makeLink( "$PHP_SELF?view=state", $status, canEdit( 'System' ) ) ?> - <?= getLoad() ?> / <?= getDiskPercent() ?>%</p>
<table>
<?php
$hour_event_count = 0;
$today_event_count = 0;
foreach( $monitors as $monitor )
{
$hour_event_count += $monitor['HourEventCount'];
$today_event_count += $monitor['TodayEventCount'];
?>
<tr>
<?php
if ( !$monitor['zmc'] )
{
$dclass = "redtext";
}
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";
}
?>
<td align="left" style="width: 6em"><?= makeLink( "$PHP_SELF?view=watch&amp;mid=".$monitor['Id'], substr( $monitor['Name'], 0, 8 ), canView( 'Stream' ) ) ?></td>
<td align="left" style="width: 4em"><?= makeLink( "$PHP_SELF?view=function&amp;mid=".$monitor['Id'], "<span class=\"$fclass\">".substr( $monitor['Function'], 0, 4 )."</span>", canEdit( 'Monitors' ) ) ?></td>
<td align="right" style="width: 3em"><?= makeLink( "$PHP_SELF?view=events&amp;page=1&amp;filter=1&amp;trms=3&amp;attr1=MonitorId&amp;op1=%3d&amp;val1=".$monitor['Id']."&amp;cnj2=and&amp;attr2=Archived&amp;val2=0&amp;cnj3=and&amp;attr3=DateTime&amp;op3=%3e%3d&amp;val3=-1%20hour", $monitor['HourEventCount'], canView( 'Events' ) ) ?></td>
<td align="right" style="width: 3em"><?= makeLink( "$PHP_SELF?view=events&amp;page=1&amp;filter=1&amp;trms=3&amp;attr1=MonitorId&amp;op1=%3d&amp;val1=".$monitor['Id']."&amp;cnj2=and&amp;attr2=Archived&amp;val2=0&amp;cnj3=and&amp;attr3=Date&amp;op3=%3e%3d&amp;val3=today", $monitor['TodayEventCount'], canView( 'Events' ) ) ?></td>
</tr>
<?php
}
?>
<tr>
<td align="left">&nbsp;</td>
<td align="center"><?= makeLink( "$PHP_SELF?view=montage", count($monitors), ( canView( 'Stream' ) && $cycle_count > 1 ) ) ?></td>
<td align="right" class="text"><?= makeLink( "$PHP_SELF?view=events&amp;page=1&amp;filter=1&amp;trms=2&amp;attr1=Archived&amp;val1=0&amp;cnj2=and&amp;attr2=DateTime&amp;op2=%3e%3d&amp;val2=-1%20hour", $hour_event_count, canView( 'Events' ) ) ?></td>
<td align="right" class="text"><?= makeLink( "$PHP_SELF?view=events&amp;page=1&amp;filter=1&amp;trms=2&amp;attr1=Archived&amp;val1=0&amp;cnj2=and&amp;attr2=Date&amp;op2=%3e%3d&amp;val2=today", $today_event_count, canView( 'Events' ) ) ?></td>
</tr>
</table>
</body>
</html>

View File

@ -0,0 +1,33 @@
<?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>
<link rel="stylesheet" href="zm_xhtml_styles.css" type="text/css">
<body>
<table align="center" border="0" cellspacing="2" cellpadding="2" width="96%">
<tr><td colspan="2" class="smallhead" align="center">ZoneMinder <?= $zmSlangError ?></td></tr>
<tr><td colspan="2" class="text" align="center">&nbsp;</td></tr>
<tr><td colspan="2" class="text" align="center"><strong><?= $zmSlangYouNoPerms ?><br/><?= $zmSlangContactAdmin ?></strong></td></tr>
</table>
</body>
</html>

270
web/zm_xhtml_view_event.php Normal file
View File

@ -0,0 +1,270 @@
<?php
//
// 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.
//
if ( !canView( 'Events' ) )
{
$view = "error";
return;
}
if ( !isset($mode) )
{
$mode = "still";
}
if ( $user['MonitorIds'] )
{
$mid_sql = " and MonitorId in (".join( ",", preg_split( '/["\'\s]*,["\'\s]*/', $user['MonitorIds'] ) ).")";
}
else
{
$mid_sql = '';
}
$sql = "select E.*,M.Name as MonitorName,M.Width,M.Height from Events as E inner join Monitors as M on E.MonitorId = M.Id where E.Id = '$eid'$mid_sql";
$result = mysql_query( $sql );
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 );
}
elseif ( isset( $fid ) )
{
$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'];
}
parseSort();
parseFilter();
$sql = "select E.* from Events as E inner join Monitors as M on E.MonitorId = M.Id where $sort_column ".($sort_order=='asc'?'<=':'>=')." '".$event[$sort_field]."'$filter_sql$mid_sql order by $sort_column ".($sort_order=='asc'?'desc':'asc');
$result = mysql_query( $sql );
if ( !$result )
die( mysql_error() );
while ( $row = mysql_fetch_assoc( $result ) )
{
if ( $row[Id] == $eid )
{
$prev_event = mysql_fetch_assoc( $result );
break;
}
}
$sql = "select E.* from Events as E inner join Monitors as M on E.MonitorId = M.Id where $sort_column ".($sort_order=='asc'?'>=':'<=')." '".$event[$sort_field]."'$filter_sql$mid_sql order by $sort_column $sort_order";
$result = mysql_query( $sql );
if ( !$result )
die( mysql_error() );
while ( $row = mysql_fetch_assoc( $result ) )
{
if ( $row[Id] == $eid )
{
$next_event = mysql_fetch_assoc( $result );
break;
}
}
$frames_per_page = 10;
$paged = $event['Frames'] > $frames_per_page;
?>
<html>
<head>
<title>ZM - <?= $zmSlangEvent ?> - <?= $event['Name'] ?></title>
<link rel="stylesheet" href="zm_html_styles.css" type="text/css">
</head>
<body>
<table>
<tr>
<td align="left" class="text"><?= makeLink( "$PHP_SELF?view=eventdetails&eid=$eid", $event['Name'].($event['Archived']?'*':''), canEdit( 'Events' ) ) ?></td>
<td align="center" class="text"><?php if ( canEdit( 'Events' ) ) { ?><a href="<?= $PHP_SELF ?>?view=events&action=delete&mark_eid=<?= $eid ?><?= $filter_query ?><?= $sort_query ?>&limit=<?= $limit ?>&page=<?= $page ?>"><?= $zmSlangDelete ?></a><?php } else { ?>&nbsp;<?php } ?></td>
</tr>
<?php
if ( $paged && !empty($page) )
{
?>
<?php
$pages = (int)ceil($event['Frames']/$frames_per_page);
$max_shortcuts = 2;
?>
<tr><td colspan="2" align="center" class="text">
<?php
if ( $fid )
$page = ($fid/$frames_per_page)+1;
if ( $page < 0 )
$page = 1;
if ( $page > $pages )
$page = $pages;
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_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 )
{
?>
<a href="<?= $PHP_SELF ?>?view=event&mode=still&eid=<?= $eid ?><?= $filter_query ?><?= $sort_query ?>&page=<?= $new_page ?>"><?= $new_page ?></a>&nbsp;
<?php
}
}
?>
-&nbsp;<?= $page ?>&nbsp;-
<?php
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_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 )
{
?>
&nbsp;<a href="<?= $PHP_SELF ?>?view=event&mode=still&eid=<?= $eid ?><?= $filter_query ?><?= $sort_query ?>&page=<?= $new_page ?>"><?= $new_page ?></a>
<?php
}
}
?>
</td></tr>
<?php
}
?>
</table>
<?php
if ( $paged && !empty($page) )
{
$lo_frame_id = (($page-1)*$frames_per_page)+1;
$hi_frame_id = min( $page*$frames_per_page, $event['Frames'] );
}
else
{
$lo_frame_id = 1;
$hi_frame_id = $event['Frames'];
}
$sql = "select * from Frames where EventID = '$eid'";
if ( $paged && !empty($page) )
$sql .= " and FrameId between $lo_frame_id and $hi_frame_id";
$sql .= " order by FrameId";
$result = mysql_query( $sql );
if ( !$result )
die( mysql_error() );
$alarm_frames = array();
while( $row = mysql_fetch_assoc( $result ) )
{
if ( $row['Type'] == 'Alarm' )
{
$alarm_frames[$row['FrameId']] = $row;
}
}
?>
<p>
<?php
$device_width = (isset($device)&&!empty($device['width']))?$device['width']:DEVICE_WIDTH;
$device_height = (isset($device)&&!empty($device['height']))?$device['height']:DEVICE_HEIGHT;
// Allow for margins etc
$device_width -= 16;
$device_height -= 16;
$width_scale = ($device_width*SCALE_SCALE)/$event['Width'];
$height_scale = ($device_height*SCALE_SCALE)/$event['Height'];
$scale = (int)(($width_scale<$height_scale)?$width_scale:$height_scale);
$scale /= 2; // Try and get two pics per line
$count = 0;
$fraction = sprintf( "%.2f", $scale/100 );
$event_path = ZM_DIR_EVENTS.'/'.$event['MonitorName'].'/'.$event['Id'];
for ( $frame_id = $lo_frame_id; $frame_id <= $hi_frame_id; $frame_id++ )
{
$image_path = sprintf( "%s/%0".ZM_EVENT_IMAGE_DIGITS."d-capture.jpg", $event_path, $frame_id );
$capt_image = $image_path;
if ( $scale == 1 || !file_exists( ZM_PATH_NETPBM."/jpegtopnm" ) )
{
$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;
}
}
else
{
$thumb_image = preg_replace( "/capture/", "$scale", $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 );
}
}
$alarm_frame = $alarm_frames[$frame_id];
$img_class = $alarm_frame?"alarm":"normal";
?>
<a href="<?= $PHP_SELF ?>?view=frame&eid=<?= $eid ?>&fid=<?= $frame_id ?>"><img src="<?= $thumb_image ?>" style="border: 0" width="<?= reScale( $event['Width'], $scale ) ?>" height="<?= reScale( $event['Height'], $scale ) ?>" class="<?= $img_class ?>" alt="<?= $frame_id ?>/<?= $alarm_frame?$alarm_frame['Score']:0 ?>"></a>
<?php
}
?>
</p>
</body>
</html>

View File

@ -0,0 +1,236 @@
<?php
//
// 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.
//
if ( !canView( 'Events' ) )
{
$view = "error";
return;
}
$sql = "select * from Monitors";
if ( !($result = mysql_query( $sql )) )
die( mysql_error() );
while( $row = mysql_fetch_assoc( $result ) )
{
$monitors[$row[Id]] = $row;
}
if ( $filter_name )
{
$result = mysql_query( "select * from Filters where Name = '$filter_name'" );
if ( !$result )
die( mysql_error() );
$filter_data = mysql_fetch_assoc( $result );
if ( !empty($filter_data) )
{
foreach( split( '&', $filter_data['Query'] ) as $filter_parm )
{
list( $key, $value ) = split( '=', $filter_parm, 2 );
if ( $key )
{
$$key = $value;
}
}
}
if ( !$sort_field )
{
$sort_field = "DateTime";
}
}
$count_sql = "select count(E.Id) as EventCount from Monitors as M inner join Events as E on (M.Id = E.MonitorId) where";
$events_sql = "select E.Id,E.MonitorId,M.Name As MonitorName,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";
if ( $user['MonitorIds'] )
{
$count_sql .= " M.Id in (".join( ",", preg_split( '/["\'\s]*,["\'\s]*/', $user['MonitorIds'] ) ).")";
$events_sql .= " M.Id in (".join( ",", preg_split( '/["\'\s]*,["\'\s]*/', $user['MonitorIds'] ) ).")";
}
else
{
$count_sql .= " 1";
$events_sql .= " 1";
}
parseSort( true );
parseFilter( true );
if ( $filter_sql )
{
$count_sql .= $filter_sql;
$events_sql .= $filter_sql;
}
$events_sql .= " order by $sort_column $sort_order";
if ( $page )
{
$device_lines = (isset($device)&&!empty($device['lines']))?$device['lines']:DEVICE_LINES;
// Allow for headers etc
$device_lines -= 2;
$limit_start = (($page-1)*$device_lines);
if ( empty( $limit ) )
{
$limit_amount = $device_lines;
}
else
{
$limit_left = $limit - $limit_start;
$limit_amount = ($limit_left>$device_lines)?$device_lines:$limit_left;
}
$events_sql .= " limit $limit_start, $limit_amount";
}
elseif ( !empty( $limit ) )
{
$events_sql .= " limit 0, $limit";
}
?>
<html>
<head>
<title>ZM - <?= $zmSlangEvents ?></title>
<link rel="stylesheet" href="zm_xhtml_styles.css" type="text/css">
<?php
if ( !($result = mysql_query( $count_sql )) )
die( mysql_error() );
$row = mysql_fetch_assoc( $result );
$n_events = $row['EventCount'];
if ( !empty($limit) && $n_events > $limit )
{
$n_events = $limit;
}
?>
</head>
<body>
<table>
<tr>
<td align="left"><?= sprintf( $zmClangEventCount, $n_events, zmVlang( $zmVlangEvent, $n_events ) ) ?></td>
<td align="right"><?= makeLink( "$PHP_SELF?view=filter", empty($filter_data)?$zmSlangChooseFilter:$filter_name, canView( 'Events' ) ) ?></td>
</tr>
</table>
<?php
$pages = (int)ceil($n_events/$device_lines);
if ( $pages > 1 )
{
if ( $page )
{
?>
<p align="center">
<?php
$max_shortcuts = 2;
if ( $page < 0 )
$page = 1;
if ( $page > $pages )
$page = $pages;
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_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 )
{
?>
<a href="<?= $PHP_SELF ?>?view=<?= $view ?>&amp;page=<?= $new_page ?>&amp;limit=<?= $limit ?>"><?= $new_page ?></a>&nbsp;
<?php
}
}
?>
-&nbsp;<?= $page ?>&nbsp;-
<?php
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_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 )
{
?>
&nbsp;<a href="<?= $PHP_SELF ?>?view=<?= $view ?>&amp;page=<?= $new_page ?>&amp;limit=<?= $limit ?>"><?= $new_page ?></a>
<?php
}
}
?>
</p>
<?php
}
}
?>
<table bgcolor="#7F7FB2">
<?php
flush();
$count = 0;
if ( !($result = mysql_query( $events_sql )) )
die( mysql_error() );
while( $event = mysql_fetch_assoc( $result ) )
{
if ( ($count++%$device_lines) == 0 )
{
?>
<tr align="center" bgcolor="#FFFFFF">
<td style="width:45px"><a href="<?= $PHP_SELF ?>?view=<?= $view ?>&page=1&sort_field=Id&sort_asc=<?= $sort_field == 'Id'?!$sort_asc:0 ?>&limit=<?= $limit ?>"><?= substr( $zmSlangId, 0, 5 ) ?><?php if ( $sort_field == "Id" ) if ( $sort_asc ) echo "<small><i>^</i></small>"; else echo "<small><i>v</i></small>"; ?></a></td>
<td style="width:60px"><a href="<?= $PHP_SELF ?>?view=<?= $view ?>&page=1&sort_field=StartTime&sort_asc=<?= $sort_field == 'StartTime'?!$sort_asc:0 ?>&limit=<?= $limit ?>"><?= substr( $zmSlangTime, 0, 5 ) ?><?php if ( $sort_field == "StartTime" ) if ( $sort_asc ) echo "<small><i>^</i></small>"; else echo "<small><i>v</i></small>"; ?></a></td>
<td style="width:35px"><a href="<?= $PHP_SELF ?>?view=<?= $view ?>&page=1&sort_field=Secs&sort_asc=<?= $sort_field == 'Secs'?!$sort_asc:0 ?>&limit=<?= $limit ?>"><?= substr( $zmSlangDuration, 0, 2 ) ?><?php if ( $sort_field == "Secs" ) if ( $sort_asc ) echo "<small><i>^</i></small>"; else echo "<small><i>v</i></small>"; ?></a></td>
<td style="width:30px"><a href="<?= $PHP_SELF ?>?view=<?= $view ?>&page=1&sort_field=AlarmFrames&sort_asc=<?= $sort_field == 'AlarmFrames'?!$sort_asc:0 ?>&limit=<?= $limit ?>"><?= substr( $zmSlangFrames, 0, 2 ) ?><?php if ( $sort_field == "AlarmFrames" ) if ( $sort_asc ) echo "<small><i>^</i></small>"; else echo "<small><i>v</i></small>"; ?></a></td>
<td style="width:30px"><a href="<?= $PHP_SELF ?>?view=<?= $view ?>&page=1&sort_field=TotScore&sort_asc=<?= $sort_field == 'TotScore'?!$sort_asc:0 ?>&limit=<?= $limit ?>"><?= substr( $zmSlangScore, 0, 2 ) ?><?php if ( $sort_field == "TotScore" ) if ( $sort_asc ) echo "<small><i>^</i></small>"; else echo "<small><i>v</i></small>"; ?></a></td>
</tr>
<?php
}
unset( $bgcolor );
?>
<tr<?= ' bgcolor="'.(isset($bgcolor)?$bgcolor:"#FFFFFF").'"' ?> >
<td align="center"><a href="<?= $PHP_SELF ?>?view=eventdetails&eid=<?= $event['Id'] ?>&page=1"><?= $event['Id'] ?><?php if ( $event['Archived'] ) echo "*" ?></a></td>
<td align="center"><?= strftime( "%d %H:%M", strtotime($event['StartTime']) ) ?></td>
<td align="center"><?= sprintf( "%d", $event['Length'] ) ?></td>
<td align="center"><a href="<?= $PHP_SELF ?>?view=event&eid=<?= $event['Id'] ?>&page=1"><?= $event['AlarmFrames'] ?></a></td>
<td align="center"><a href="<?= $PHP_SELF ?>?view=frame&eid=<?= $event['Id'] ?>&fid=0"><?= $event['MaxScore'] ?></a></td>
</tr>
<?php
}
?>
</table>
</body>
</html>

View File

@ -0,0 +1,73 @@
<?php
//
// 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.
//
if ( !canView( 'Events' ) )
{
$view = "error";
return;
}
$filter_names = array();
$result = mysql_query( "select * from Filters order by Name" );
if ( !$result )
die( mysql_error() );
while ( $row = mysql_fetch_assoc( $result ) )
{
$filter_names[$row['Name']] = $row['Name'];
}
?>
<html>
<head>
<title>ZM - <?= $zmSlangEventFilter ?></title>
<link rel="stylesheet" href="zm_html_styles.css" type="text/css">
</head>
<body>
<form method="post" action="<?= $PHP_SELF ?>">
<div style="visibility: hidden">
<fieldset>
<input type="hidden" name="view" value="events">
</fieldset>
</div>
<table>
<?php
if ( count($filter_names) > 0 )
{
?>
<tr>
<td align="center" class="text"><?= $zmSlangUseFilter ?>:&nbsp;<?= buildSelect( "filter_name", $filter_names ); ?></select></td>
</tr>
<tr>
<td align="center"><input type="submit" value="<?= $zmSlangSubmit ?>" class="form"></td>
</tr>
<?php
}
else
{
?>
<tr>
<td align="center" class="text"><?= $zmSlangNoSavedFilters ?></td>
</tr>
<?php
}
?>
</table>
</form>
</body>
</html>

145
web/zm_xhtml_view_frame.php Normal file
View File

@ -0,0 +1,145 @@
<?php
//
// 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() );
$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'];
}
$max_fid = $event['Frames'];
$first_fid = 1;
$prev_fid = $fid-1;
$next_fid = $fid+1;
$last_fid = $max_fid;
$event_path = ZM_DIR_EVENTS.'/'.$event['MonitorName'].'/'.$event['Id'];
$image_path = sprintf( "%s/%0".ZM_EVENT_IMAGE_DIGITS."d-capture.jpg", $event_path, $fid );
$anal_image = preg_replace( "/capture/", "analyse", $image_path );
if ( file_exists( $anal_image ) )
{
$image_path = $anal_image;
}
$alarm_frame = $frame['Type']=='Alarm';
$img_class = $alarm_frame?"alarm":"normal";
$device_width = (isset($device)&&!empty($device['width']))?$device['width']:DEVICE_WIDTH;
$device_height = (isset($device)&&!empty($device['height']))?$device['height']:DEVICE_HEIGHT;
// Allow for margins etc
$device_width -= 16;
$device_height -= 16;
$width_scale = ($device_width*SCALE_SCALE)/$event['Width'];
$height_scale = ($device_height*SCALE_SCALE)/$event['Height'];
$scale = (int)(($width_scale<$height_scale)?$width_scale:$height_scale);
$event_path = ZM_DIR_EVENTS.'/'.$event['MonitorName'].'/'.$event['Id'];
$image_path = sprintf( "%s/%0".ZM_EVENT_IMAGE_DIGITS."d-capture.jpg", $event_path, $fid );
$capt_image = $image_path;
if ( $scale == 100 || !file_exists( ZM_PATH_NETPBM."/jpegtopnm" ) )
{
$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;
}
}
else
{
$thumb_image = preg_replace( "/capture/", "$scale", $capt_image );
if ( !file_exists($thumb_image) || !filesize( $thumb_image ) )
{
$fraction = sprintf( "%.2f", $scale/100 );
$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( $command );
}
}
?>
<html>
<head>
<title>ZM - <?= $zmSlangFrame ?> <?= $eid."-".$fid ?></title>
<link rel="stylesheet" href="zm_html_styles.css" type="text/css">
</head>
<body>
<table>
<tr>
<td class="smallhead"><?= $zmSlangFrame ?> <?= $eid."-".$fid." (".$frame['Score'].")" ?></td>
<!--<td align="center" class="text"><?php if ( canEdit( 'Events' ) ) { ?><a href="javascript: deleteEvent();"><?= $zmSlangDelete ?></a><?php } else { ?>&nbsp<?php } ?></td>-->
</tr>
</table>
<table>
<tr><td><img src="<?= $thumb_image ?>" width="<?= reScale( $event['Width'], $scale ) ?>" height="<?= reScale( $event['Height'], $scale ) ?>" class="<?= $img_class ?>"></td></tr>
</table>
<table>
<tr>
<?php if ( $fid > 1 ) { ?>
<td align="center" class="text"><a href="<?= $PHP_SELF ?>?view=frame&eid=<?= $eid ?>&fid=<?= $first_fid ?>">&lt;&lt;</a></td>
<?php } else { ?>
<td align="center" class="text">&nbsp;</td>
<?php } if ( $fid > 1 ) { ?>
<td align="center" class="text"><a href="<?= $PHP_SELF ?>?view=frame&eid=<?= $eid ?>&fid=<?= $prev_fid ?>">&lt;</a></td>
<?php } else { ?>
<td align="center" class="text">&nbsp;</td>
<?php } if ( $fid < $max_fid ) { ?>
<td align="center" class="text"><a href="<?= $PHP_SELF ?>?view=frame&eid=<?= $eid ?>&fid=<?= $next_fid ?>">&gt;</a></td>
<?php } else { ?>
<td align="center" class="text">&nbsp;</td>
<?php } if ( $fid < $max_fid ) { ?>
<td align="center" class="text"><a href="<?= $PHP_SELF ?>?view=frame&eid=<?= $eid ?>&fid=<?= $last_fid ?>">&gt;&gt;</a></td>
<?php } else { ?>
<td align="center" class="text">&nbsp;</td>
<?php } ?>
</tr>
</table>
</body>
</html>

View File

@ -0,0 +1,115 @@
<?php
//
// 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;
}
$sql = "select E.*,M.Name as MonitorName,M.Width,M.Height from Events as E inner join Monitors as M on E.MonitorId = M.Id where E.Id = '$eid'";
$result = mysql_query( $sql );
if ( !$result )
die( mysql_error() );
$event = mysql_fetch_assoc( $result );
$sql = "select *, unix_timestamp( TimeStamp ) as UnixTimeStamp from Frames where EventID = '$eid' order by FrameId";
$result = mysql_query( $sql );
if ( !$result )
die( mysql_error() );
while ( $row = mysql_fetch_assoc( $result ) )
{
$frames[] = $row;
}
?>
<html>
<head>
<title>ZM - <?= $zmSlangFrames ?> <?= $eid ?></title>
<link rel="stylesheet" href="zm_html_styles.css" type="text/css">
<script language="JavaScript">
window.focus();
function newWindow(Url,Name,Width,Height)
{
var Name = window.open(Url,Name,"resizable,scrollbars,width="+Width+",height="+Height);
}
function closeWindow()
{
window.close();
}
</script>
</head>
<body>
<table width="96%" border="0">
<tr>
<td align="left" class="smallhead"><b><?= $zmSlangEvent ?> <?= $eid ?></b></td>
<td align="right" class="text"><a href="javascript: closeWindow();"><?= $zmSlangClose ?></a></td>
</tr>
<tr><td colspan="2"><table width="100%" border="0" bgcolor="#7F7FB2" cellpadding="3" cellspacing="1"><tr bgcolor="#FFFFFF">
<td class="smallhead" align="center"><?= $zmSlangFrameId ?></td>
<td class="smallhead" align="center"><?= $zmSlangAlarmFrame ?></td>
<td class="smallhead" align="center"><?= $zmSlangTimeStamp ?></td>
<td class="smallhead" align="center"><?= $zmSlangTimeDelta ?></td>
<td class="smallhead" align="center"><?= $zmSlangScore ?></td>
</tr>
<?php
if ( count($frames) )
{
foreach ( $frames as $frame )
{
$alarm_frame = $frame['Type']=='Alarm';
$bgcolor = $alarm_frame?'#FA8072':($frame['Type']=='Bulk'?'#CCCCCC':'#FFFFFF');
?>
<tr bgcolor="<?= $bgcolor ?>">
<td class="text" align="center"><a href="javascript: newWindow( '<?= $PHP_SELF ?>?view=frame&eid=<?= $eid ?>&fid=<?= $frame['FrameId'] ?>', 'zmImage', <?= $event['Width']+$jws['image']['w'] ?>, <?= $event['Height']+$jws['image']['h'] ?> );"><?= $frame['FrameId'] ?></a></td>
<td class="text" align="center"><?= $alarm_frame?$zmSlangYes:$zmSlangNo ?></td>
<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 && $alarm_frame )
{
?>
<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
{
?>
<td class="text" align="center"><?= $frame['Score'] ?></td>
<?php
}
?>
</tr>
<?php
}
}
else
{
?>
<tr bgcolor="#FFFFFF">
<td class="text" colspan="8" align="center"><br><?= $zmSlangNoFramesRecorded ?><br><br></td>
</tr>
<?php
}
?>
</table></td>
</tr>
</table>
</body>
</html>

View File

@ -0,0 +1,68 @@
<?php
//
// 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>
<title>ZM - <?= $zmSlangFunction ?> - <?= $monitor['Name'] ?></title>
<link rel="stylesheet" href="zm_html_styles.css" type="text/css">
</head>
<body>
<form method="post" action="<?= $PHP_SELF ?>">
<div style="visibility: hidden">
<fieldset>
<input type="hidden" name="view" value="console"/>
<input type="hidden" name="action" value="function"/>
<input type="hidden" name="mid" value="<?= $mid ?>"/>
</fieldset>
</div>
<table>
<tr>
<td align="center" class="smallhead"><?= sprintf( $zmClangMonitorFunction, $monitor['Name'] ) ?></td>
</tr>
<tr>
<td align="center"><select name="new_function" class="form">
<?php
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>
<tr>
<td align="center"><input type="submit" value="<?= $zmSlangSave ?>" class="form"></td>
</tr>
</table>
</form>
</body>
</html>

View File

@ -0,0 +1,44 @@
<?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>
<link rel="stylesheet" href="zm_xhtml_styles.css" type="text/css"/>
</head>
<body>
<form method="post" action="<?= $PHP_SELF ?>">
<div style="visibility: hidden">
<fieldset>
<input type="hidden" name="action" value="login"/>
<input type="hidden" name="view" value="console"/>
</fieldset>
</div>
<table>
<tr><td colspan="2" class="smallhead" align="center">ZoneMinder <?= $zmSlangLogin ?>
</td></tr>
<tr><td class="text" align="right"><?= $zmSlangUsername ?></td><td align="left" class="text"><input type="text" class="form" name="username" value="<?= isset($username)?$username:"" ?>" size="12"/></td></tr>
<tr><td class="text" align="right"><?= $zmSlangPassword ?></td><td align="left" class="text"><input type="password" class="form" name="password" value="" size="12"/></td></tr>
<tr><td colspan="2" align="center"><input type="submit" value="<?= $zmSlangLogin ?>" class="form"/></td></tr>
</table>
</form>
</body>
</html>

View File

@ -0,0 +1,67 @@
<?php
//
// 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.
//
$result = mysql_query( "select * from Monitors where Function != 'None' order by Id" );
$monitors = array();
$max_width = 0;
$max_height = 0;
while( $row = mysql_fetch_assoc( $result ) )
{
if ( !visibleMonitor( $row['Id'] ) )
{
continue;
}
if ( $max_width < $row['Width'] ) $max_width = $row['Width'];
if ( $max_height < $row['Height'] ) $max_height = $row['Height'];
$monitors[] = $row;
}
?>
<html>
<head>
<title>ZM - <?= $zmSlangMontage ?></title>
<link rel="stylesheet" href="zm_xhtml_styles.css" type="text/css">
</head>
<body>
<p align="center">
<?php
$device_width = (isset($device)&&!empty($device['width']))?$device['width']:DEVICE_WIDTH;
$device_height = (isset($device)&&!empty($device['height']))?$device['height']:DEVICE_HEIGHT;
// Allow for margins etc
$device_width -= 16;
$device_height -= 16;
foreach( $monitors as $monitor )
{
$width_scale = ($device_width*SCALE_SCALE)/$monitor['Width'];
$height_scale = ($device_height*SCALE_SCALE)/$monitor['Height'];
$scale = (int)(($width_scale<$height_scale)?$width_scale:$height_scale);
$scale /= 2; // Try and get two pics per line
$image_src = ZM_PATH_ZMS."?mode=single&monitor=".$monitor['Id']."&scale=".$scale;
?>
<a href="<?= $PHP_SELF ?>?view=watch&amp;mid=<?= $monitor['Id'] ?>"><img src="<?= $image_src ?>" style="border: 0" width="<?= reScale( $monitor['Width'], $scale ) ?>" height="<?= reScale( $monitor['Height'], $scale ) ?>" alt="<?= $monitor['Name'] ?>"></a>
<?php
}
?>
</p>
</body>
</html>

View File

@ -0,0 +1,87 @@
<?php
//
// 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;
}
?>
<html>
<head>
<title>ZM - <?= $zmSlangState ?></title>
<link rel="stylesheet" href="zm_html_styles.css" type="text/css">
</head>
<body>
<form method="post" action="<?= $PHP_SELF ?>">
<div style="visibility: hidden">
<fieldset>
<input type="hidden" name="view" value="console"/>
<input type="hidden" name="action" value="state">
</fieldset>
</div>
<table>
<tr>
<td align="center" class="head">ZoneMinder - <?= $zmSlangRunState ?></td>
</tr>
<tr>
<td align="center"><select name="run_state" class="form">
<?php
if ( $running )
{
?>
<option value="stop" selected><?= $zmSlangStop ?></option>
<option value="restart"><?= $zmSlangRestart ?></option>
<?php
}
else
{
?>
<option value="start" selected><?= $zmSlangStart ?></option>
<?php
}
?>
<?php
foreach ( $states as $state )
{
?>
<option value="<?= $state['Name'] ?>"><?= $state['Name'] ?></option>
<?php
}
?>
</select></td>
</tr>
<tr>
<td align="center"><input type="submit" value="<?= $zmSlangApply ?>" class="form"></td>
</tr>
</table>
</form>
</body>
</html>

122
web/zm_xhtml_view_watch.php Normal file
View File

@ -0,0 +1,122 @@
<?php
//
// 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 );
if ( !isset($scale) )
$scale = ZM_WEB_DEFAULT_SCALE;
$width_scale = ($scale<SCALE_SCALE)?SCALE_SCALE:$scale;
$height_scale = $scale;
$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 && $last_status == 0 );
$old_alarm = ( $status == 0 && $last_status > 0 );
$result = mysql_query( "select * from Monitors where Function != 'None' order by Id" );
$monitors = array();
$mon_idx = 0;
$max_width = 0;
$max_height = 0;
while( $row = mysql_fetch_assoc( $result ) )
{
if ( !visibleMonitor( $row['Id'] ) )
{
continue;
}
if ( isset($mid) && $row['Id'] == $mid )
$mon_idx = count($monitors);
if ( $max_width < $row['Width'] ) $max_width = $row['Width'];
if ( $max_height < $row['Height'] ) $max_height = $row['Height'];
$monitors[] = $row;
}
//$monitor = $monitors[$mon_idx];
$next_mid = $mon_idx==(count($monitors)-1)?$monitors[0]['Id']:$monitors[$mon_idx+1]['Id'];
$prev_mid = $mon_idx==0?$mon_index[(count($monitors)-1)]['Id']:$monitors[$mon_idx-1]['Id'];
$device_width = (isset($device)&&!empty($device['width']))?$device['width']:DEVICE_WIDTH;
$device_height = (isset($device)&&!empty($device['height']))?$device['height']:DEVICE_HEIGHT;
// Allow for margins etc
$device_width -= 16;
$device_height -= 16;
$width_scale = ($device_width*SCALE_SCALE)/$monitor['Width'];
$height_scale = ($device_height*SCALE_SCALE)/$monitor['Height'];
$scale = (int)(($width_scale<$height_scale)?$width_scale:$height_scale);
$image_src = ZM_PATH_ZMS."?mode=single&monitor=".$monitor['Id']."&scale=".$scale;
?>
<html>
<head>
<title>ZM - <?= $monitor['Name'] ?> - <?= $zmSlangWatch ?></title>
<link rel="stylesheet" href="zm_xhtml_styles.css" type="text/css">
</head>
<body>
<p class="<?= $class ?>" align="center"><?= makeLink( "$PHP_SELF?view=events&amp;page=1&amp;filter=1&amp;trms=1&amp;attr1=MonitorId&amp;op1=%3d&amp;val1=".$monitor['Id']."&amp;&sort_field=Id&amp;sort_desc=1", $monitor['Name'], canView( 'Events' ) ) ?>:&nbsp;<?= $status_string ?>&nbsp;-&nbsp;<?= $fps_string ?>&nbsp;fps</p>
<p align="center"><a href="<?= $PHP_SELF ?>?view=<?= $view ?>&amp;mid=<?= $monitor['Id'] ?>"><img src="<?= $image_src ?>" style="border: 0" width="<?= reScale( $monitor['Width'], $scale ) ?>" height="<?= reScale( $monitor['Height'], $scale ) ?>" alt="<?= $monitor['Name'] ?>"></a></p>
<?php
if ( $next_mod != $mid || $prev_mid != $mid )
{
?>
<table>
<tr>
<td align="left"><a href="<?= $PHP_SELF ?>?view=<?= $view ?>&amp;mid=<?= $prev_mid ?>"><?= $zmSlangPrev ?></a></td>
<td align="center"><a href="<?= $PHP_SELF ?>?view=console"><?= $zmSlangConsole ?></a></td>
<td align="right"><a href="<?= $PHP_SELF ?>?view=<?= $view ?>&amp;mid=<?= $next_mid ?>"><?= $zmSlangNext ?></a></td>
</tr>
</table>
<?php
}
?>
</body>
</html>