2003-07-11 17:27:56 +08:00
< ? php
2004-01-08 19:45:57 +08:00
//
// ZoneMinder web console file, $Date$, $Revision$
2005-02-24 22:40:14 +08:00
// Copyright (C) 2003, 2004, 2005 Philip Coombes
2004-01-08 19:45:57 +08:00
//
// 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.
//
2003-07-11 17:27:56 +08:00
2004-01-08 19:45:57 +08:00
$running = daemonCheck ();
$status = $running ? $zmSlangRunning : $zmSlangStopped ;
2003-07-11 17:27:56 +08:00
2004-10-13 17:49:11 +08:00
if ( ! isset ( $cgroup ) )
{
$cgroup = 0 ;
}
$sql = " select * from Groups where Id = ' $cgroup ' " ;
$result = mysql_query ( $sql );
if ( ! $result )
echo mysql_error ();
$group = mysql_fetch_assoc ( $result );
2004-01-08 19:45:57 +08:00
if ( ZM_WEB_REFRESH_METHOD == " http " )
2004-04-19 19:23:40 +08:00
header ( " Refresh: " . ZM_WEB_REFRESH_MAIN . " ; URL= $PHP_SELF " );
2004-01-08 19:45:57 +08:00
header ( " Expires: Mon, 26 Jul 1997 05:00:00 GMT " ); // Date in the past
header ( " Last-Modified: " . gmdate ( " D, d M Y H:i:s " ) . " GMT " ); // always modified
header ( " Cache-Control: no-store, no-cache, must-revalidate " ); // HTTP/1.1
header ( " Cache-Control: post-check=0, pre-check=0 " , false );
header ( " Pragma: no-cache " ); // HTTP/1.0
$db_now = strftime ( " %Y-%m-%d %H:%M:%S " );
2005-10-17 18:12:53 +08:00
$sql = " select * from Monitors order by Sequence asc " ;
2004-01-08 19:45:57 +08:00
$result = mysql_query ( $sql );
if ( ! $result )
echo mysql_error ();
$monitors = array ();
$max_width = 0 ;
$max_height = 0 ;
$cycle_count = 0 ;
2005-10-17 18:12:53 +08:00
$min_sequence = 0 ;
$max_sequence = 1 ;
$seq_id_list = array ();
2004-01-08 19:45:57 +08:00
while ( $row = mysql_fetch_assoc ( $result ) )
{
if ( ! visibleMonitor ( $row [ 'Id' ] ) )
{
continue ;
}
2004-10-13 17:42:42 +08:00
if ( $group && $group [ 'MonitorIds' ] && ! in_array ( $row [ 'Id' ], split ( ',' , $group [ 'MonitorIds' ] ) ) )
{
continue ;
}
2005-10-17 18:12:53 +08:00
if ( empty ( $min_sequence ) || ( $row [ 'Sequence' ] < $min_sequence ) )
{
$min_sequence = $row [ 'Sequence' ];
}
if ( $row [ 'Sequence' ] > $max_sequence )
{
$max_sequence = $row [ 'Sequence' ];
}
2005-10-02 00:13:48 +08:00
$row [ 'zmc' ] = zmcStatus ( $row );
$row [ 'zma' ] = zmaStatus ( $row );
2004-01-08 19:45:57 +08:00
$sql = " select count(Id) as ZoneCount from Zones where MonitorId = ' " . $row [ 'Id' ] . " ' " ;
$result2 = mysql_query ( $sql );
if ( ! $result2 )
2003-07-11 17:27:56 +08:00
echo mysql_error ();
2004-01-08 19:45:57 +08:00
$row2 = mysql_fetch_assoc ( $result2 );
2004-10-13 17:42:42 +08:00
$sql = " select count(if(Archived=0,1,NULL)) as EventCount, count(if(Archived,1,NULL)) as ArchEventCount, count(if(StartTime>' $db_now ' - INTERVAL 1 HOUR && Archived = 0,1,NULL)) as HourEventCount, count(if(StartTime>' $db_now ' - INTERVAL 1 DAY && Archived = 0,1,NULL)) as DayEventCount, count(if(StartTime>' $db_now ' - INTERVAL 7 DAY && Archived = 0,1,NULL)) as WeekEventCount, count(if(StartTime>' $db_now ' - INTERVAL 1 MONTH && Archived = 0,1,NULL)) as MonthEventCount from Events as E where MonitorId = ' " . $row [ 'Id' ] . " ' " ;
$result3 = mysql_query ( $sql );
if ( ! $result3 )
echo mysql_error ();
$row3 = mysql_fetch_assoc ( $result3 );
2004-01-08 19:45:57 +08:00
if ( $row [ 'Function' ] != 'None' )
2003-07-11 17:27:56 +08:00
{
2004-01-08 19:45:57 +08:00
$cycle_count ++ ;
2005-10-20 00:52:28 +08:00
$scale_width = reScale ( $row [ 'Width' ], $row [ 'DefaultScale' ], ZM_WEB_DEFAULT_SCALE );
$scale_height = reScale ( $row [ 'Height' ], $row [ 'DefaultScale' ], ZM_WEB_DEFAULT_SCALE );
if ( $max_width < $scale_width ) $max_width = $scale_width ;
if ( $max_height < $scale_height ) $max_height = $scale_height ;
2003-07-11 17:27:56 +08:00
}
2004-10-13 17:42:42 +08:00
$monitors [] = $row = array_merge ( $row , $row2 , $row3 );
2005-10-17 18:12:53 +08:00
$seq_id_list [] = $row [ 'Id' ];
}
$last_id = 0 ;
$seq_id_u_list = array ();
foreach ( $seq_id_list as $seq_id )
{
if ( ! empty ( $last_id ) )
{
$seq_id_u_list [ $seq_id ] = $last_id ;
}
$last_id = $seq_id ;
}
$last_id = 0 ;
$seq_id_d_list = array ();
foreach ( array_reverse ( $seq_id_list ) as $seq_id )
{
if ( ! empty ( $last_id ) )
{
$seq_id_d_list [ $seq_id ] = $last_id ;
}
$last_id = $seq_id ;
2004-01-08 19:45:57 +08:00
}
2005-03-14 04:54:37 +08:00
2005-06-22 17:51:32 +08:00
if ( $cycle_count )
{
$montage_rows = intval ((( $cycle_count - 1 ) / ZM_WEB_MONTAGE_MAX_COLS ) + 1 );
$montage_cols = intval ( ceil ( $cycle_count / $montage_rows ));
}
else
{
$montage_rows = 0 ;
$montage_cols = 0 ;
}
2004-02-16 03:47:23 +08:00
$montage_width = ZM_WEB_MONTAGE_WIDTH ? ZM_WEB_MONTAGE_WIDTH : $max_width ;
$montage_height = ZM_WEB_MONTAGE_HEIGHT ? ZM_WEB_MONTAGE_HEIGHT : $max_height ;
2003-07-11 17:27:56 +08:00
?>
2004-12-29 03:22:23 +08:00
<! DOCTYPE HTML PUBLIC " -//W3C//DTD HTML 4.01 Transitional//EN " >
2003-07-11 17:27:56 +08:00
< html >
< head >
2005-05-06 20:24:57 +08:00
< title >< ? = ZM_WEB_TITLE_PREFIX ?> - <?= $zmSlangConsole ?></title>
2004-12-29 02:20:11 +08:00
< link rel = " stylesheet " href = " zm_html_styles.css " type = " text/css " >
2004-01-25 23:43:11 +08:00
< link rel = " shortcut icon " href = " favicon.ico " >
< link rel = " icon " type = " image/ico " href = " favicon.ico " >
2004-12-29 03:29:43 +08:00
< script type = " text/javascript " >
2005-05-06 17:57:11 +08:00
< ? php
if ( ZM_WEB_RESIZE_CONSOLE )
{
?>
2005-02-02 08:10:04 +08:00
window . resizeTo ( < ? = $jws [ 'console' ][ 'w' ] ?> , <?= $jws['console']['h']+(25*(count($monitors)>6?count($monitors):6)) ?> );
2005-05-06 17:57:11 +08:00
< ? php
}
?>
2003-07-11 17:27:56 +08:00
function newWindow ( Url , Name , Width , Height )
{
2005-10-02 00:13:48 +08:00
var Win = window . open ( Url , Name , " resizable,width= " + Width + " ,height= " + Height );
2003-07-11 17:27:56 +08:00
}
function scrollWindow ( Url , Name , Width , Height )
{
2005-10-02 00:13:48 +08:00
var Win = window . open ( Url , Name , " resizable,scrollbars,width= " + Width + " ,height= " + Height );
2003-07-11 17:27:56 +08:00
}
2005-11-07 05:11:30 +08:00
function filterWindow ( Url , Name )
{
var Win = window . open ( Url , Name , " resizable,scrollbars,width=<?= $jws['filter'] ['w'] ?>,height=<?= $jws['filter'] ['h'] ?> " );
}
2003-07-11 17:27:56 +08:00
function configureButton ( form , name )
{
var checked = false ;
for ( var i = 0 ; i < form . elements . length ; i ++ )
{
if ( form . elements [ i ] . name . indexOf ( name ) == 0 )
{
if ( form . elements [ i ] . checked )
{
checked = true ;
break ;
}
}
}
form . delete_btn . disabled = ! checked ;
}
function confirmDelete ()
{
return ( confirm ( 'Warning, deleting a monitor also deletes all events and database entries associated with it.\nAre you sure you wish to delete?' ) );
}
< ? php
2004-01-08 19:45:57 +08:00
if ( ZM_WEB_REFRESH_METHOD == " javascript " )
{
2003-07-11 17:27:56 +08:00
?>
2004-12-29 02:20:11 +08:00
window . setTimeout ( " window.location.replace('<?= $PHP_SELF ?>') " , < ? = ( ZM_WEB_REFRESH_MAIN * 1000 ) ?> );
2003-07-11 17:27:56 +08:00
< ? php
2004-01-08 19:45:57 +08:00
}
2003-07-11 17:27:56 +08:00
?>
2004-01-27 18:17:23 +08:00
< ? php
2005-10-04 18:58:55 +08:00
if ( ZM_CHECK_FOR_UPDATES && canEdit ( 'System' ) && ZM_DYN_LAST_VERSION && ( verNum ( ZM_VERSION ) < verNum ( ZM_DYN_LAST_VERSION ) ) && ( verNum ( ZM_DYN_CURR_VERSION ) < verNum ( ZM_DYN_LAST_VERSION ) ) && ( ZM_DYN_NEXT_REMINDER < time () ) )
2004-01-27 18:17:23 +08:00
{
?>
newWindow ( '<?= $PHP_SELF ?>?view=version' , 'zmVersion' , < ? = $jws [ 'version' ][ 'w' ] ?> , <?= $jws['version']['h'] ?> );
< ? php
}
2005-10-04 18:58:55 +08:00
elseif ( ZM_DYN_SHOW_DONATE_REMINDER && canEdit ( 'System' ) && ( ZM_DYN_DONATE_REMINDER_TIME < time () ) )
{
?>
newWindow ( '<?= $PHP_SELF ?>?view=donate' , 'zmDonate' , < ? = $jws [ 'donate' ][ 'w' ] ?> , <?= $jws['donate']['h'] ?> );
< ? php
}
2004-01-27 18:17:23 +08:00
?>
2003-07-11 17:27:56 +08:00
</ script >
</ head >
2003-12-16 22:56:36 +08:00
< body scroll = " auto " >
2003-07-11 17:27:56 +08:00
< table align = " center " border = " 0 " cellspacing = " 2 " cellpadding = " 2 " width = " 96% " >
2004-10-13 17:49:11 +08:00
< form name = " monitor_form " method = " get " action = " <?= $PHP_SELF ?> " onSubmit = " return(confirmDelete()); " >
< input type = " hidden " name = " view " value = " <?= $view ?> " >
< input type = " hidden " name = " action " value = " delete " >
2003-07-11 17:27:56 +08:00
< tr >
< td class = " smallhead " align = " left " >< ? = date ( " D jS M, g:ia " ) ?> </td>
2004-01-27 18:17:23 +08:00
< td class = " bighead " align = " center " >< strong >< a href = " http://www.zoneminder.com " target = " ZoneMinder " > ZoneMinder </ a > < ? = $zmSlangConsole ?> - <?php if ( canEdit( 'System' ) ) { ?><a href="javascript: newWindow( '<?= $PHP_SELF ?>?view=state', 'zmState', <?= $jws['state']['w'] ?>, <?= $jws['state']['h'] ?> );"><?= $status ?></a> - <?php } ?><?= makeLink( "javascript: newWindow( '$PHP_SELF?view=version', 'zmVersion', ".$jws['version']['w'].", ".$jws['version']['h']." );", "v".ZM_VERSION, canEdit( 'System' ) ) ?></strong></td>
2004-04-21 17:20:28 +08:00
< td class = " smallhead " align = " right " >< ? = $zmSlangLoad ?> : <?= getLoad() ?> / <?= $zmSlangDisk ?>: <?= getDiskPercent() ?>%</td>
2003-07-11 17:27:56 +08:00
</ tr >
< tr >
< td class = " smallhead " align = " left " >
< ? php
2004-10-13 17:49:11 +08:00
if ( canView ( 'System' ) )
2004-01-08 19:45:57 +08:00
{
2003-07-11 17:27:56 +08:00
?>
2004-12-28 23:48:45 +08:00
< a href = " javascript: newWindow( '<?= $PHP_SELF ?>?view=groups', 'zmGroups', <?= $jws['groups'] ['w'] ?>, <?= $jws['groups'] ['h'] ?> ); " >< ? = sprintf ( $zmClangMonitorCount , count ( $monitors ), zmVlang ( $zmVlangMonitor , count ( $monitors ) ) ) . ( $group ? ' (' . $group [ 'Name' ] . ')' : '' ) ?> </a>
2003-07-11 17:27:56 +08:00
< ? php
2004-01-08 19:45:57 +08:00
}
else
{
2003-07-11 17:27:56 +08:00
?>
2004-01-07 20:57:07 +08:00
< ? = sprintf ( $zmClangMonitorCount , count ( $monitors ), zmVlang ( $zmVlangMonitor , count ( $monitors ) ) ) ?>
2003-07-11 17:27:56 +08:00
< ? php
2004-01-08 19:45:57 +08:00
}
2003-07-11 17:27:56 +08:00
?>
</ td >
< ? php
2004-01-08 19:45:57 +08:00
if ( ZM_OPT_USE_AUTH )
{
2003-07-11 17:27:56 +08:00
?>
2005-10-20 23:42:41 +08:00
< td class = " smallhead " align = " center " >< ? = $zmSlangLoggedInAs ?> <?= makeLink( "javascript: newWindow( '$PHP_SELF?view=logout', 'zmLogout', ".$jws['logout']['w'].", ".$jws['logout']['h'].");", $user['Username'], (ZM_AUTH_TYPE == "builtin") ) ?>, <?= strtolower( $zmSlangConfiguredFor ) ?>
2003-07-11 17:27:56 +08:00
< ? php
2004-01-08 19:45:57 +08:00
}
else
{
2003-07-11 17:27:56 +08:00
?>
2004-01-07 20:57:07 +08:00
< td class = " smallhead " align = " center " >< ? = $zmSlangConfiguredFor ?>
2003-07-11 17:27:56 +08:00
< ? php
2004-01-08 19:45:57 +08:00
}
2003-07-11 17:27:56 +08:00
?>
2005-10-21 01:02:45 +08:00
& nbsp ; < ? = makeLink ( " javascript: newWindow( ' $PHP_SELF ?view=bandwidth', 'zmBandwidth', " . $jws [ 'bandwidth' ][ 'w' ] . " , " . $jws [ 'bandwidth' ][ 'h' ] . " ); " , strtolower ( $bw_array [ $bandwidth ] ), ( $user && $user [ 'MaxBandwidth' ] != 'low' ) ) ?> <?= strtolower( $zmSlangBandwidth ) ?></td>
2004-10-13 17:49:11 +08:00
< td class = " smallhead " align = " right " >< table width = " 100% " border = " 0 " cellpadding = " 0 " cellspacing = " 0 " >< tr >< td class = " smallhead " align = " left " >
< ? php
if ( canView ( 'Stream' ) && $cycle_count > 1 )
{
?>
2005-11-22 23:18:57 +08:00
< ? = makeLink ( " javascript: newWindow( ' $PHP_SELF ?view=cycle&group= $cgroup ', 'zmCycle $cgroup ', " . ( $montage_width + $jws [ 'cycle' ][ 'w' ]) . " , " . ( $montage_height + $jws [ 'cycle' ][ 'h' ]) . " ); " , $zmSlangCycle , $running ) ?> / <?= makeLink( "javascript: newWindow( '$PHP_SELF?view=montage&group=$cgroup', 'zmMontage$cgroup', ".(($montage_cols*$montage_width)+$jws['montage']['w']).", ".(($montage_rows*((ZM_WEB_COMPACT_MONTAGE?4:40)+$montage_height))+$jws['montage']['h'])." );", $zmSlangMontage, $running ) ?>
2004-10-13 17:49:11 +08:00
< ? php
}
else
{
?>
& nbsp ;
< ? php
}
?>
2005-03-21 03:47:04 +08:00
</ td >< td align = " right " class = " smallhead " >< ? php if ( canView ( 'System' ) ) { ?> <a href="javascript: newWindow( '<?= $PHP_SELF ?>?view=options', 'zmOptions', <?= $jws['options']['w'] ?>, <?= $jws['options']['h'] ?> );"><?= $zmSlangOptions ?></a><?php } else { ?> <?php } ?></td></tr></table></td>
2003-07-11 17:27:56 +08:00
</ tr >
</ table >
< table align = " center " border = " 0 " cellspacing = " 2 " cellpadding = " 2 " width = " 96% " >
2004-01-07 20:57:07 +08:00
< tr >< td align = " left " class = " smallhead " >< ? = $zmSlangId ?> </td>
< td align = " left " class = " smallhead " >< ? = $zmSlangName ?> </td>
< td align = " left " class = " smallhead " >< ? = $zmSlangFunction ?> </td>
< td align = " left " class = " smallhead " >< ? = $zmSlangSource ?> </td>
< td align = " right " class = " smallhead " >< ? = $zmSlangEvents ?> </td>
< td align = " right " class = " smallhead " >< ? = $zmSlangHour ?> </td>
< td align = " right " class = " smallhead " >< ? = $zmSlangDay ?> </td>
< td align = " right " class = " smallhead " >< ? = $zmSlangWeek ?> </td>
< td align = " right " class = " smallhead " >< ? = $zmSlangMonth ?> </td>
< td align = " right " class = " smallhead " >< ? = $zmSlangArchive ?> </td>
< td align = " right " class = " smallhead " >< ? = $zmSlangZones ?> </td>
2005-10-17 18:12:53 +08:00
< ? php
if ( canEdit ( 'Monitors' ) )
{
?>
< td align = " center " class = " smallhead " >< ? = $zmSlangOrder ?> </td>
< ? php
}
?>
2004-01-07 20:57:07 +08:00
< td align = " center " class = " smallhead " >< ? = $zmSlangMark ?> </td>
2003-07-11 17:27:56 +08:00
</ tr >
< ? php
2005-10-17 05:24:52 +08:00
$events_view = ZM_WEB_EVENTS_VIEW ;
$events_window = 'zm' . ucfirst ( ZM_WEB_EVENTS_VIEW );
2004-01-08 19:45:57 +08:00
$event_count = 0 ;
$hour_event_count = 0 ;
$day_event_count = 0 ;
$week_event_count = 0 ;
$month_event_count = 0 ;
$arch_event_count = 0 ;
$zone_count = 0 ;
foreach ( $monitors as $monitor )
{
$event_count += $monitor [ 'EventCount' ];
$hour_event_count += $monitor [ 'HourEventCount' ];
$day_event_count += $monitor [ 'DayEventCount' ];
$week_event_count += $monitor [ 'WeekEventCount' ];
$month_event_count += $monitor [ 'MonthEventCount' ];
$arch_event_count += $monitor [ 'ArchEventCount' ];
$zone_count += $monitor [ 'ZoneCount' ];
2003-07-11 17:27:56 +08:00
?>
< tr >
2004-01-08 18:09:35 +08:00
< td align = " center " class = " text " >< ? = makeLink ( " javascript: newWindow( ' $PHP_SELF ?view=monitor&mid= " . $monitor [ 'Id' ] . " ', 'zmMonitor', " . $jws [ 'monitor' ][ 'w' ] . " , " . $jws [ 'monitor' ][ 'h' ] . " ); " , $monitor [ 'Id' ] . '.' , canView ( 'Monitors' ) ) ?> </td>
2003-07-11 17:27:56 +08:00
< ? php
2004-01-08 19:45:57 +08:00
if ( ! $monitor [ 'zmc' ] )
{
$dclass = " redtext " ;
}
else
{
if ( ! $monitor [ 'zma' ] )
2003-07-11 17:27:56 +08:00
{
2004-01-08 19:45:57 +08:00
$dclass = " ambtext " ;
2003-07-11 17:27:56 +08:00
}
else
{
2004-01-08 19:45:57 +08:00
$dclass = " gretext " ;
2003-10-08 22:48:35 +08:00
}
2004-01-08 19:45:57 +08:00
}
if ( $monitor [ 'Function' ] == 'None' )
{
$fclass = " redtext " ;
}
elseif ( $monitor [ 'Function' ] == 'Monitor' )
{
$fclass = " ambtext " ;
}
else
{
$fclass = " gretext " ;
}
if ( $monitor [ 'RunMode' ] == 'Triggered' )
{
$fclass .= " em " ;
}
2005-10-20 00:52:28 +08:00
$scale = max ( reScale ( SCALE_SCALE , $monitor [ 'DefaultScale' ], ZM_WEB_DEFAULT_SCALE ), SCALE_SCALE );
2003-07-11 17:27:56 +08:00
?>
2005-11-22 23:18:57 +08:00
< td align = " left " class = " text " >< ? = makeLink ( " javascript: newWindow( ' $PHP_SELF ?view=watch&mid= " . $monitor [ 'Id' ] . " ', 'zmWatch " . $monitor [ 'Id' ] . " ', " . ( reScale ( $monitor [ 'Width' ], $scale ) + $jws [ 'watch' ][ 'w' ]) . " , " . ( reScale ( $monitor [ 'Height' ], $scale ) + $jws [ 'watch' ][ 'h' ]) . " ); " , $monitor [ 'Name' ], $running && ( $monitor [ 'Function' ] != 'None' ) && canView ( 'Stream' ) ) ?> </td>
2004-01-08 18:09:35 +08:00
< td align = " left " class = " text " >< ? = makeLink ( " javascript: newWindow( ' $PHP_SELF ?view=function&mid= " . $monitor [ 'Id' ] . " ', 'zmFunction', " . $jws [ 'function' ][ 'w' ] . " , " . $jws [ 'function' ][ 'h' ] . " ); " , " <span class= \" $fclass\ " > " . $monitor['Function'] . " </ span > " , canEdit( 'Monitors' ) ) ?></td>
< ? php if ( $monitor [ 'Type' ] == " Local " ) { ?>
2005-10-17 18:58:25 +08:00
< td align = " left " class = " text " >< ? = makeLink ( " javascript: newWindow( ' $PHP_SELF ?view=monitor&mid= " . $monitor [ 'Id' ] . " ', 'zmMonitor', " . $jws [ 'monitor' ][ 'w' ] . " , " . $jws [ 'monitor' ][ 'h' ] . " ); " , " <span class= \" $dclass\ " > " . $monitor['Device'] . " ( " . $monitor['Channel'] . " ) </ span > " , canEdit( 'Monitors' ) ) ?></td>
2005-10-18 05:55:02 +08:00
< ? php } elseif ( $monitor [ 'Type' ] == " Remote " ) { ?>
2004-02-16 03:17:38 +08:00
< td align = " left " class = " text " >< ? = makeLink ( " javascript: newWindow( ' $PHP_SELF ?view=monitor&mid= " . $monitor [ 'Id' ] . " ', 'zmMonitor', " . $jws [ 'monitor' ][ 'w' ] . " , " . $jws [ 'monitor' ][ 'h' ] . " ); " , " <span class= \" $dclass\ " > " .preg_replace( '/^.*@/', '', $monitor['Host'] ). " </ span > " , canEdit( 'Monitors' ) ) ?></td>
2005-10-18 05:55:02 +08:00
< ? php } elseif ( $monitor [ 'Type' ] == " File " ) { ?>
< td align = " left " class = " text " >< ? = makeLink ( " javascript: newWindow( ' $PHP_SELF ?view=monitor&mid= " . $monitor [ 'Id' ] . " ', 'zmMonitor', " . $jws [ 'monitor' ][ 'w' ] . " , " . $jws [ 'monitor' ][ 'h' ] . " ); " , " <span class= \" $dclass\ " > " .preg_replace( '/^.* \ //', '', $monitor['Path'] ). " </ span > " , canEdit( 'Monitors' ) ) ?></td>
< ? php } else { ?>
< td align = " left " class = " text " >& nbsp ; </ td >
2003-07-11 17:27:56 +08:00
< ? php } ?>
2005-11-05 01:04:01 +08:00
< td align = " right " class = " text " >< ? = makeLink ( " javascript: scrollWindow( ' $PHP_SELF ?view= $events_view &page=1&filter=1&trms=2&attr1=MonitorId&op1=%3d&val1= " . $monitor [ 'Id' ] . " &cnj2=and&attr2=Archived&op2=%3d&val2=0', ' $events_window ', " . $jws [ $events_view ][ 'w' ] . " , " . $jws [ $events_view ][ 'h' ] . " ); " , $monitor [ 'EventCount' ], canView ( 'Events' ) ) ?> </td>
< td align = " right " class = " text " >< ? = makeLink ( " javascript: scrollWindow( ' $PHP_SELF ?view= $events_view &page=1&filter=1&trms=3&attr1=MonitorId&op1=%3d&val1= " . $monitor [ 'Id' ] . " &cnj2=and&attr2=Archived&op2=%3d&val2=0&cnj3=and&attr3=DateTime&op3=%3e%3d&val3=-1+hour', ' $events_window ', " . $jws [ $events_view ][ 'w' ] . " , " . $jws [ $events_view ][ 'h' ] . " ); " , $monitor [ 'HourEventCount' ], canView ( 'Events' ) ) ?> </td>
< td align = " right " class = " text " >< ? = makeLink ( " javascript: scrollWindow( ' $PHP_SELF ?view= $events_view &page=1&filter=1&trms=3&attr1=MonitorId&op1=%3d&val1= " . $monitor [ 'Id' ] . " &cnj2=and&attr2=Archived&op2=%3d&val2=0&cnj3=and&attr3=DateTime&op3=%3e%3d&val3=-1+day', ' $events_window ', " . $jws [ $events_view ][ 'w' ] . " , " . $jws [ $events_view ][ 'h' ] . " ); " , $monitor [ 'DayEventCount' ], canView ( 'Events' ) ) ?> </td>
< td align = " right " class = " text " >< ? = makeLink ( " javascript: scrollWindow( ' $PHP_SELF ?view= $events_view &page=1&filter=1&trms=3&attr1=MonitorId&op1=%3d&val1= " . $monitor [ 'Id' ] . " &cnj2=and&attr2=Archived&op2=%3d&val2=0&cnj3=and&attr3=DateTime&op3=%3e%3d&val3=-1+week', ' $events_window ', " . $jws [ $events_view ][ 'w' ] . " , " . $jws [ $events_view ][ 'h' ] . " ); " , $monitor [ 'WeekEventCount' ], canView ( 'Events' ) ) ?> </td>
< td align = " right " class = " text " >< ? = makeLink ( " javascript: scrollWindow( ' $PHP_SELF ?view= $events_view &page=1&filter=1&trms=3&attr1=MonitorId&op1=%3d&val1= " . $monitor [ 'Id' ] . " &cnj2=and&attr2=Archived&op2=%3d&val2=0&cnj3=and&attr3=DateTime&op3=%3e%3d&val3=-1+month', ' $events_window ', " . $jws [ $events_view ][ 'w' ] . " , " . $jws [ $events_view ][ 'h' ] . " ); " , $monitor [ 'MonthEventCount' ], canView ( 'Events' ) ) ?> </td>
< td align = " right " class = " text " >< ? = makeLink ( " javascript: scrollWindow( ' $PHP_SELF ?view= $events_view &page=1&filter=1&trms=2&attr1=MonitorId&op1=%3d&val1= " . $monitor [ 'Id' ] . " &cnj2=and&attr2=Archived&op2=%3d&val2=1', ' $events_window ', " . $jws [ $events_view ][ 'w' ] . " , " . $jws [ $events_view ][ 'h' ] . " ); " , $monitor [ 'ArchEventCount' ], canView ( 'Events' ) ) ?> </td>
2004-01-08 18:09:35 +08:00
< td align = " right " class = " text " >< ? = makeLink ( " javascript: newWindow( ' $PHP_SELF ?view=zones&mid= " . $monitor [ 'Id' ] . " ', 'zmZones', " . ( $monitor [ 'Width' ] + $jws [ 'zones' ][ 'w' ]) . " , " . ( $monitor [ 'Height' ] + $jws [ 'zones' ][ 'h' ]) . " ); " , $monitor [ 'ZoneCount' ], canView ( 'Monitors' ) ) ?> </td>
2005-10-17 18:12:53 +08:00
< ? php
if ( canEdit ( 'Monitors' ) )
{
?>
< td align = " right " class = " text " >< ? = makeLink ( " $PHP_SELF ?view= $view &action=sequence&mid= " . $monitor [ 'Id' ] . " &smid= " . $seq_id_u_list [ $monitor [ 'Id' ]], '<img src="graphics/seq-u.gif" alt="" width="12" height="11" border="0">' , $monitor [ 'Sequence' ] > $min_sequence ) ?> <?= makeLink( "$PHP_SELF?view=$view&action=sequence&mid=".$monitor['Id']."&smid=".$seq_id_d_list[$monitor['Id']], '<img src="graphics/seq-d.gif" alt="" width="12" height="11" border="0">', $monitor['Sequence']<$max_sequence ) ?></td>
< ? php
}
?>
2005-01-19 06:27:25 +08:00
< td align = " center " class = " text " >< input type = " checkbox " name = " mark_mids[] " value = " <?= $monitor['Id'] ?> " onClick = " configureButton( document.monitor_form, 'mark_mids' ); " < ? php if ( ! canEdit ( 'Monitors' ) || $user [ 'MonitorIds' ] ) { ?> disabled<?php } ?>></td>
2003-07-11 17:27:56 +08:00
</ tr >
< ? php
2004-01-08 19:45:57 +08:00
}
2003-07-11 17:27:56 +08:00
?>
< tr >
2005-11-07 05:11:30 +08:00
< td colspan = " 4 " align = " center " >
< table align = " center " border = " 0 " cellspacing = " 0 " cellpadding = " 0 " width = " 100% " >
< tr >
< td align = " center " >< input type = " button " value = " <?= $zmSlangRefresh ?> " class = " form " onClick = " javascript: location.reload(true); " ></ td >
< td align = " center " >< input type = " button " value = " <?= $zmSlangAddNewMonitor ?> " class = " form " onClick = " javascript: newWindow( '<?= $PHP_SELF ?>?view=monitor', 'zmMonitor', <?= $jws['monitor'] ['w'] ?>, <?= $jws['monitor'] ['h'] ?>); " < ? php if ( ! canEdit ( 'Monitors' ) || $user [ 'MonitorIds' ] ) { ?> disabled<?php } ?>></td>
< td align = " center " >< input type = " button " value = " <?= $zmSlangFilters ?> " class = " form " onClick = " javascript: scrollWindow( '<?= $PHP_SELF ?>?view=events&page=1&filter=1&trms=1&attr1=DateTime&op1=%3c&val1=now', 'zmEvents', <?= $jws['events'] ['w'] ?>, <?= $jws['events'] ['h'] ?> ); " < ? php if ( ! canView ( 'Events' ) ) { ?> disabled<?php } ?>></td>
</ tr >
</ table >
2003-07-11 17:27:56 +08:00
</ td >
2005-11-05 01:04:01 +08:00
< td align = " right " class = " text " >< ? = makeLink ( " javascript: scrollWindow( ' $PHP_SELF ?view= $events_view &page=1&filter=1&trms=1&attr1=Archived&op1=%3d&val1=0', ' $events_window ', " . $jws [ $events_view ][ 'w' ] . " , " . $jws [ $events_view ][ 'h' ] . " ); " , $event_count , canView ( 'Events' ) ) ?> </td>
< td align = " right " class = " text " >< ? = makeLink ( " javascript: scrollWindow( ' $PHP_SELF ?view= $events_view &page=1&filter=1&trms=2&attr1=Archived&op1=%3d&val1=0&cnj2=and&attr2=DateTime&op2=%3e%3d&val2=-1+hour', ' $events_window ', " . $jws [ $events_view ][ 'w' ] . " , " . $jws [ $events_view ][ 'h' ] . " ); " , $hour_event_count , canView ( 'Events' ) ) ?> </td>
< td align = " right " class = " text " >< ? = makeLink ( " javascript: scrollWindow( ' $PHP_SELF ?view= $events_view &page=1&filter=1&trms=2&attr1=Archived&op1=%3d&val1=0&cnj2=and&attr2=DateTime&op2=%3e%3d&val2=-1+day', ' $events_window ', " . $jws [ $events_view ][ 'w' ] . " , " . $jws [ $events_view ][ 'h' ] . " ); " , $day_event_count , canView ( 'Events' ) ) ?> </td>
< td align = " right " class = " text " >< ? = makeLink ( " javascript: scrollWindow( ' $PHP_SELF ?view= $events_view &page=1&filter=1&trms=2&attr1=Archived&op1=%3d&val1=0&cnj2=and&attr2=DateTime&op2=%3e%3d&val2=-1+week', ' $events_window ', " . $jws [ $events_view ][ 'w' ] . " , " . $jws [ $events_view ][ 'h' ] . " ); " , $week_event_count , canView ( 'Events' ) ) ?> </td>
< td align = " right " class = " text " >< ? = makeLink ( " javascript: scrollWindow( ' $PHP_SELF ?view= $events_view &page=1&filter=1&trms=2&attr1=Archived&op1=%3d&val1=0&cnj2=and&attr2=DateTime&op2=%3e%3d&val2=-1+month', ' $events_window ', " . $jws [ $events_view ][ 'w' ] . " , " . $jws [ $events_view ][ 'h' ] . " ); " , $month_event_count , canView ( 'Events' ) ) ?> </td>
< td align = " right " class = " text " >< ? = makeLink ( " javascript: scrollWindow( ' $PHP_SELF ?view= $events_view &page=1&filter=1&trms=1&attr1=Archived&op1=%3d&val1=1', ' $events_window ', " . $jws [ $events_view ][ 'w' ] . " , " . $jws [ $events_view ][ 'h' ] . " ); " , $arch_event_count , canView ( 'Events' ) ) ?> </td>
2003-07-11 17:27:56 +08:00
< td align = " right " class = " text " >< ? = $zone_count ?> </td>
2005-10-17 18:12:53 +08:00
< td align = " center " colspan = " <?= canEdit('Monitors')?2:1 ?> " >< input type = " submit " name = " delete_btn " value = " <?= $zmSlangDelete ?> " class = " form " disabled ></ td >
2003-07-11 17:27:56 +08:00
</ tr >
</ form >
</ table >
</ body >
</ html >