Initial implementation of auto-learning.
git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@120 e3e1d417-86f3-4887-817a-d78f3d33393f
This commit is contained in:
parent
8e9a8b421f
commit
cdefac9af9
|
@ -41,31 +41,34 @@ if ( $action )
|
||||||
}
|
}
|
||||||
elseif ( $action == "delete" )
|
elseif ( $action == "delete" )
|
||||||
{
|
{
|
||||||
if ( !$delete_eids && $delete_eid )
|
if ( !$mark_eids && $mark_eid )
|
||||||
{
|
{
|
||||||
$delete_eids[] = $delete_eid;
|
$mark_eids[] = $mark_eid;
|
||||||
$refresh_parent = true;
|
$refresh_parent = true;
|
||||||
}
|
}
|
||||||
if ( $delete_eids )
|
if ( $mark_eids )
|
||||||
{
|
{
|
||||||
foreach( $delete_eids as $delete_eid )
|
foreach( $mark_eids as $mark_eid )
|
||||||
{
|
{
|
||||||
$result = mysql_query( "delete from Frames where EventId = '$delete_eid'" );
|
$result = mysql_query( "delete from Stats where EventId = '$mark_eid'" );
|
||||||
if ( !$result )
|
if ( !$result )
|
||||||
die( mysql_error() );
|
die( mysql_error() );
|
||||||
$result = mysql_query( "delete from Events where Id = '$delete_eid'" );
|
$result = mysql_query( "delete from Frames where EventId = '$mark_eid'" );
|
||||||
if ( !$result )
|
if ( !$result )
|
||||||
die( mysql_error() );
|
die( mysql_error() );
|
||||||
if ( $delete_eid )
|
$result = mysql_query( "delete from Events where Id = '$mark_eid'" );
|
||||||
system( escapeshellcmd( "rm -rf ".EVENT_PATH."/*/".sprintf( "%04d", $delete_eid ) ) );
|
if ( !$result )
|
||||||
|
die( mysql_error() );
|
||||||
|
if ( $mark_eid )
|
||||||
|
system( escapeshellcmd( "rm -rf ".EVENT_PATH."/*/".sprintf( "%04d", $mark_eid ) ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif ( $delete_zids )
|
elseif ( $mark_zids )
|
||||||
{
|
{
|
||||||
$deleted_zid = 0;
|
$deleted_zid = 0;
|
||||||
foreach( $delete_zids as $delete_zid )
|
foreach( $mark_zids as $mark_zid )
|
||||||
{
|
{
|
||||||
$result = mysql_query( "delete from Zones where Id = '$delete_zid'" );
|
$result = mysql_query( "delete from Zones where Id = '$mark_zid'" );
|
||||||
if ( !$result )
|
if ( !$result )
|
||||||
die( mysql_error() );
|
die( mysql_error() );
|
||||||
$deleted_zid = 1;
|
$deleted_zid = 1;
|
||||||
|
@ -76,11 +79,11 @@ if ( $action )
|
||||||
$refresh_parent = true;
|
$refresh_parent = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif ( $delete_mids )
|
elseif ( $mark_mids )
|
||||||
{
|
{
|
||||||
foreach( $delete_mids as $delete_mid )
|
foreach( $mark_mids as $mark_mid )
|
||||||
{
|
{
|
||||||
$sql = "select * from Monitors where Id = '$delete_mid'";
|
$sql = "select * from Monitors where Id = '$mark_mid'";
|
||||||
$result = mysql_query( $sql );
|
$result = mysql_query( $sql );
|
||||||
if ( !$result )
|
if ( !$result )
|
||||||
die( mysql_error() );
|
die( mysql_error() );
|
||||||
|
@ -89,33 +92,53 @@ if ( $action )
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = "select Id from Events where MonitorId = '$delete_mid'";
|
$sql = "select Id from Events where MonitorId = '$mark_mid'";
|
||||||
$result = mysql_query( $sql );
|
$result = mysql_query( $sql );
|
||||||
if ( !$result )
|
if ( !$result )
|
||||||
die( mysql_error() );
|
die( mysql_error() );
|
||||||
|
|
||||||
$delete_eids = array();
|
$mark_eids = array();
|
||||||
while( $row = mysql_fetch_assoc( $result ) )
|
while( $row = mysql_fetch_assoc( $result ) )
|
||||||
{
|
{
|
||||||
$delete_eids[] = $row[Id];
|
$mark_eids[] = $row[Id];
|
||||||
}
|
}
|
||||||
foreach( $delete_eids as $delete_eid )
|
foreach( $mark_eids as $mark_eid )
|
||||||
{
|
{
|
||||||
$result = mysql_query( "delete from Frames where EventId = '$delete_eid'" );
|
$result = mysql_query( "delete from Stats where EventId = '$mark_eid'" );
|
||||||
if ( !$result )
|
if ( !$result )
|
||||||
die( mysql_error() );
|
die( mysql_error() );
|
||||||
$result = mysql_query( "delete from Events where Id = '$delete_eid'" );
|
$result = mysql_query( "delete from Frames where EventId = '$mark_eid'" );
|
||||||
if ( !$result )
|
if ( !$result )
|
||||||
die( mysql_error() );
|
die( mysql_error() );
|
||||||
if ( $delete_eid )
|
$result = mysql_query( "delete from Events where Id = '$mark_eid'" );
|
||||||
system( "rm -rf ".EVENT_PATH."/*/".sprintf( "%04d", $delete_eid ) );
|
if ( !$result )
|
||||||
|
die( mysql_error() );
|
||||||
|
if ( $mark_eid )
|
||||||
|
system( "rm -rf ".EVENT_PATH."/*/".sprintf( "%04d", $mark_eid ) );
|
||||||
}
|
}
|
||||||
system( "rm -rf ".EVENT_PATH."/".$monitor[Name] );
|
system( "rm -rf ".EVENT_PATH."/".$monitor[Name] );
|
||||||
|
|
||||||
$result = mysql_query( "delete from Zones where MonitorId = '$delete_mid'" );
|
$result = mysql_query( "delete from Zones where MonitorId = '$mark_mid'" );
|
||||||
if ( !$result )
|
if ( !$result )
|
||||||
die( mysql_error() );
|
die( mysql_error() );
|
||||||
$result = mysql_query( "delete from Monitors where Id = '$delete_mid'" );
|
$result = mysql_query( "delete from Monitors where Id = '$mark_mid'" );
|
||||||
|
if ( !$result )
|
||||||
|
die( mysql_error() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
elseif ( $action == "learn" )
|
||||||
|
{
|
||||||
|
if ( !$mark_eids && $mark_eid )
|
||||||
|
{
|
||||||
|
$mark_eids[] = $mark_eid;
|
||||||
|
$refresh_parent = true;
|
||||||
|
}
|
||||||
|
if ( $mark_eids )
|
||||||
|
{
|
||||||
|
foreach( $mark_eids as $mark_eid )
|
||||||
|
{
|
||||||
|
$result = mysql_query( "update Events set LearnState = '$learn_state' where Id = '$mark_eid'" );
|
||||||
if ( !$result )
|
if ( !$result )
|
||||||
die( mysql_error() );
|
die( mysql_error() );
|
||||||
}
|
}
|
||||||
|
|
|
@ -196,7 +196,7 @@ function configureButton(form,name)
|
||||||
<td align="right" class="text"><a href="javascript: newWindow( '<?php echo $PHP_SELF ?>?view=events&mid=<?php echo $monitor[Id] ?>&filter=1&trms=2&attr1=DateTime&op1=%3e%3d&val1=last+month&cnj2=and&attr2=Archived&val2=0', 'zmEvents<?php echo $monitor[Name] ?>', <?php echo $jws['events']['w'] ?>, <?php echo $jws['events']['h'] ?> );"><?php echo $monitor[MonthEventCount] ?></a></td>
|
<td align="right" class="text"><a href="javascript: newWindow( '<?php echo $PHP_SELF ?>?view=events&mid=<?php echo $monitor[Id] ?>&filter=1&trms=2&attr1=DateTime&op1=%3e%3d&val1=last+month&cnj2=and&attr2=Archived&val2=0', 'zmEvents<?php echo $monitor[Name] ?>', <?php echo $jws['events']['w'] ?>, <?php echo $jws['events']['h'] ?> );"><?php echo $monitor[MonthEventCount] ?></a></td>
|
||||||
<td align="right" class="text"><a href="javascript: newWindow( '<?php echo $PHP_SELF ?>?view=events&mid=<?php echo $monitor[Id] ?>&filter=1&trms=1&attr1=Archived&val1=1', 'zmEvents<?php echo $monitor[Name] ?>', <?php echo $jws['events']['w'] ?>, <?php echo $jws['events']['h'] ?> );"><?php echo $monitor[ArchEventCount] ?></a></td>
|
<td align="right" class="text"><a href="javascript: newWindow( '<?php echo $PHP_SELF ?>?view=events&mid=<?php echo $monitor[Id] ?>&filter=1&trms=1&attr1=Archived&val1=1', 'zmEvents<?php echo $monitor[Name] ?>', <?php echo $jws['events']['w'] ?>, <?php echo $jws['events']['h'] ?> );"><?php echo $monitor[ArchEventCount] ?></a></td>
|
||||||
<td align="right" class="text"><a href="javascript: newWindow( '<?php echo $PHP_SELF ?>?view=zones&mid=<?php echo $monitor[Id] ?>', 'zmZones', <?php echo $monitor[Width]+$jws['zones']['w'] ?>, <?php echo $monitor[Height]+$jws['zones']['h'] ?> );"><?php echo $monitor[ZoneCount] ?></a></td>
|
<td align="right" class="text"><a href="javascript: newWindow( '<?php echo $PHP_SELF ?>?view=zones&mid=<?php echo $monitor[Id] ?>', 'zmZones', <?php echo $monitor[Width]+$jws['zones']['w'] ?>, <?php echo $monitor[Height]+$jws['zones']['h'] ?> );"><?php echo $monitor[ZoneCount] ?></a></td>
|
||||||
<td align="center" class="text"><input type="checkbox" name="delete_mids[]" value="<?php echo $monitor[Id] ?>" onClick="configureButton( monitor_form, 'delete_mids' );"></td>
|
<td align="center" class="text"><input type="checkbox" name="mark_mids[]" value="<?php echo $monitor[Id] ?>" onClick="configureButton( monitor_form, 'mark_mids' );"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
@ -522,7 +522,7 @@ function configureButton(form,name)
|
||||||
<td class="text"><b>Last <?php echo $n_rows ?> events</b></td>
|
<td class="text"><b>Last <?php echo $n_rows ?> events</b></td>
|
||||||
<td align="center" class="text"><a href="javascript: newWindow( '<?php echo $PHP_SELF ?>?view=events&mid=<?php echo $monitor[Id] ?>&filter=1&trms=0', 'zmEvents<?php echo $monitor[Name] ?>', <?php echo $jws['events']['w'] ?>, <?php echo $jws['events']['h'] ?> );">All</a></td>
|
<td align="center" class="text"><a href="javascript: newWindow( '<?php echo $PHP_SELF ?>?view=events&mid=<?php echo $monitor[Id] ?>&filter=1&trms=0', 'zmEvents<?php echo $monitor[Name] ?>', <?php echo $jws['events']['w'] ?>, <?php echo $jws['events']['h'] ?> );">All</a></td>
|
||||||
<td align="center" class="text"><a href="javascript: newWindow( '<?php echo $PHP_SELF ?>?view=events&mid=<?php echo $monitor[Id] ?>&filter=1&trms=1&attr1=Archived&val1=1', 'zmEvents<?php echo $monitor[Name] ?>', <?php echo $jws['events']['w'] ?>, <?php echo $jws['events']['h'] ?> );">Archive</a></td>
|
<td align="center" class="text"><a href="javascript: newWindow( '<?php echo $PHP_SELF ?>?view=events&mid=<?php echo $monitor[Id] ?>&filter=1&trms=1&attr1=Archived&val1=1', 'zmEvents<?php echo $monitor[Name] ?>', <?php echo $jws['events']['w'] ?>, <?php echo $jws['events']['h'] ?> );">Archive</a></td>
|
||||||
<td align="right" class="text"><a href="javascript: checkAll( event_form, 'delete_eids' );">Check All</a></td>
|
<td align="right" class="text"><a href="javascript: checkAll( event_form, 'mark_eids' );">Check All</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr><td colspan="5" class="text"> </td></tr>
|
<tr><td colspan="5" class="text"> </td></tr>
|
||||||
<tr><td colspan="5"><table border="0" cellspacing="0" cellpadding="0" width="100%">
|
<tr><td colspan="5"><table border="0" cellspacing="0" cellpadding="0" width="100%">
|
||||||
|
@ -546,7 +546,7 @@ function configureButton(form,name)
|
||||||
<td align="center" class="text"><?php echo $row[Length] ?></td>
|
<td align="center" class="text"><?php echo $row[Length] ?></td>
|
||||||
<td align="center" class="text"><?php echo $row[Frames] ?> (<?php echo $row[AlarmFrames] ?>)</td>
|
<td align="center" class="text"><?php echo $row[Frames] ?> (<?php echo $row[AlarmFrames] ?>)</td>
|
||||||
<td align="center" class="text"><?php echo $row[AvgScore] ?> (<?php echo $row[MaxScore] ?>)</td>
|
<td align="center" class="text"><?php echo $row[AvgScore] ?> (<?php echo $row[MaxScore] ?>)</td>
|
||||||
<td align="center" class="text"><input type="checkbox" name="delete_eids[]" value="<?php echo $row[Id] ?>" onClick="configureButton( event_form, 'delete_eids' );"></td>
|
<td align="center" class="text"><input type="checkbox" name="mark_eids[]" value="<?php echo $row[Id] ?>" onClick="configureButton( event_form, 'mark_eids' );"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
@ -604,7 +604,7 @@ function configureButton(form,name)
|
||||||
$monitor = mysql_fetch_assoc( $result );
|
$monitor = mysql_fetch_assoc( $result );
|
||||||
|
|
||||||
// XXX
|
// XXX
|
||||||
$sql = "select E.Id, E.Name,unix_timestamp(E.StartTime) as Time,E.Length,E.Frames,E.AlarmFrames,E.AvgScore,E.MaxScore,E.Archived from Monitors as M, Events as E where M.Id = '$mid' and M.Id = E.MonitorId";
|
$sql = "select E.Id, E.Name,unix_timestamp(E.StartTime) as Time,E.Length,E.Frames,E.AlarmFrames,E.AvgScore,E.MaxScore,E.Archived,E.LearnState from Monitors as M, Events as E where M.Id = '$mid' and M.Id = E.MonitorId";
|
||||||
$filter_query = '';
|
$filter_query = '';
|
||||||
$filter_sql = '';
|
$filter_sql = '';
|
||||||
$filter_fields = '';
|
$filter_fields = '';
|
||||||
|
@ -726,6 +726,8 @@ function checkAll(form,name){
|
||||||
if (form.elements[i].name.indexOf(name) == 0)
|
if (form.elements[i].name.indexOf(name) == 0)
|
||||||
form.elements[i].checked = 1;
|
form.elements[i].checked = 1;
|
||||||
form.delete_btn.disabled = false;
|
form.delete_btn.disabled = false;
|
||||||
|
form.learn_btn.disabled = false;
|
||||||
|
form.learn_state.disabled = false;
|
||||||
}
|
}
|
||||||
function configureButton(form,name)
|
function configureButton(form,name)
|
||||||
{
|
{
|
||||||
|
@ -742,10 +744,14 @@ function configureButton(form,name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
form.delete_btn.disabled = !checked;
|
form.delete_btn.disabled = !checked;
|
||||||
|
form.learn_btn.disabled = !checked;
|
||||||
|
form.learn_state.disabled = !checked;
|
||||||
}
|
}
|
||||||
window.focus();
|
window.focus();
|
||||||
<?php if ( $filter ) { ?>
|
<?php if ( $filter ) { ?>
|
||||||
|
opener.location.reload();
|
||||||
filterWindow( '<?php echo $PHP_SELF ?>?view=filter&mid=<?php echo $mid ?><?php echo $filter_query ?>', 'zmFilter<?php echo $monitor[Name] ?>' );
|
filterWindow( '<?php echo $PHP_SELF ?>?view=filter&mid=<?php echo $mid ?><?php echo $filter_query ?>', 'zmFilter<?php echo $monitor[Name] ?>' );
|
||||||
|
location.href = '<?php echo $PHP_SELF ?>?view=events&mid=<?php echo $mid ?><?php echo $filter_query ?>';
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
|
@ -767,7 +773,7 @@ filterWindow( '<?php echo $PHP_SELF ?>?view=filter&mid=<?php echo $mid ?><?php e
|
||||||
<tr>
|
<tr>
|
||||||
<td align="right" class="text"><a href="javascript: location.reload();">Refresh</td>
|
<td align="right" class="text"><a href="javascript: location.reload();">Refresh</td>
|
||||||
<td align="right" class="text"><a href="javascript: filterWindow( '<?php echo $PHP_SELF ?>?view=filter&mid=<?php echo $mid ?><?php echo $filter_query ?>', 'zmFilter<?php echo $monitor[Name] ?>' );">Filter</a></td>
|
<td align="right" class="text"><a href="javascript: filterWindow( '<?php echo $PHP_SELF ?>?view=filter&mid=<?php echo $mid ?><?php echo $filter_query ?>', 'zmFilter<?php echo $monitor[Name] ?>' );">Filter</a></td>
|
||||||
<td align="right" class="text"><a href="javascript: checkAll( event_form, 'delete_eids' );">Check All</a></td>
|
<td align="right" class="text"><a href="javascript: checkAll( event_form, 'mark_eids' );">Check All</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr><td colspan="3" class="text"> </td></tr>
|
<tr><td colspan="3" class="text"> </td></tr>
|
||||||
<tr><td colspan="3"><table border="0" cellspacing="0" cellpadding="0" width="100%">
|
<tr><td colspan="3"><table border="0" cellspacing="0" cellpadding="0" width="100%">
|
||||||
|
@ -785,17 +791,23 @@ filterWindow( '<?php echo $PHP_SELF ?>?view=filter&mid=<?php echo $mid ?><?php e
|
||||||
<?php
|
<?php
|
||||||
while( $row = mysql_fetch_assoc( $result ) )
|
while( $row = mysql_fetch_assoc( $result ) )
|
||||||
{
|
{
|
||||||
|
if ( $row[LearnState] == '+' )
|
||||||
|
$bgcolor = "#98FB98";
|
||||||
|
elseif ( $row[LearnState] == '-' )
|
||||||
|
$bgcolor = "#FFC0CB";
|
||||||
|
else
|
||||||
|
unset( $bgcolor );
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr<?php if ( $bgcolor ) echo ' bgcolor="'.$bgcolor.'"'; ?> >
|
||||||
<td align="center" class="text"><a href="javascript: eventWindow( '<?php echo $PHP_SELF ?>?view=event&eid=<?php echo $row[Id] ?>', 'zmEvent' );"><?php echo $row[Id] ?><?php if ( $row[Archived] ) echo "*" ?></a></td>
|
<td align="center" class="text"><a href="javascript: eventWindow( '<?php echo $PHP_SELF ?>?view=event&eid=<?php echo $row[Id] ?>', 'zmEvent' );"><span class="<?php echo $textclass ?>"><?php echo "$row[Id]" ?><?php if ( $row[Archived] ) echo "*" ?></span></a></td>
|
||||||
<td align="center" class="text"><a href="javascript: eventWindow( '<?php echo $PHP_SELF ?>?view=event&eid=<?php echo $row[Id] ?>', 'zmEvent' );"><?php echo $row[Name] ?><?php if ( $row[Archived] ) echo "*" ?></a></td>
|
<td align="center" class="text"><a href="javascript: eventWindow( '<?php echo $PHP_SELF ?>?view=event&eid=<?php echo $row[Id] ?>', 'zmEvent' );"><span class="<?php echo $textclass ?>"><?php echo "$row[Name]" ?><?php if ( $row[Archived] ) echo "*" ?></span></a></td>
|
||||||
<td align="center" class="text"><?php echo strftime( "%m/%d %H:%M:%S", $row[Time] ) ?></td>
|
<td align="center" class="text"><?php echo strftime( "%m/%d %H:%M:%S", $row[Time] ) ?></td>
|
||||||
<td align="center" class="text"><?php echo $row[Length] ?></td>
|
<td align="center" class="text"><?php echo $row[Length] ?></td>
|
||||||
<td align="center" class="text"><?php echo $row[Frames] ?></td>
|
<td align="center" class="text"><?php echo $row[Frames] ?></td>
|
||||||
<td align="center" class="text"><?php echo $row[AlarmFrames] ?></td>
|
<td align="center" class="text"><?php echo $row[AlarmFrames] ?></td>
|
||||||
<td align="center" class="text"><?php echo $row[AvgScore] ?></td>
|
<td align="center" class="text"><?php echo $row[AvgScore] ?></td>
|
||||||
<td align="center" class="text"><?php echo $row[MaxScore] ?></td>
|
<td align="center" class="text"><?php echo $row[MaxScore] ?></td>
|
||||||
<td align="center" class="text"><input type="checkbox" name="delete_eids[]" value="<?php echo $row[Id] ?>" onClick="configureButton( event_form, 'delete_eids' );"></td>
|
<td align="center" class="text"><input type="checkbox" name="mark_eids[]" value="<?php echo $row[Id] ?>" onClick="configureButton( event_form, 'mark_eids' );"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
@ -803,7 +815,7 @@ filterWindow( '<?php echo $PHP_SELF ?>?view=filter&mid=<?php echo $mid ?><?php e
|
||||||
</table></td></tr>
|
</table></td></tr>
|
||||||
</table></td>
|
</table></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr><td align="right"><input type="button" name="delete_btn" value="Delete" class="form" onClick="event_form.action.value = 'delete'; event_form.submit();" disabled></td></tr>
|
<tr><td align="right"><select name="learn_state" class="form" disabled><option value="">Ignore</option><option value="-">Exclude</option><option value="+">Include</option></select> <input type="button" name="learn_btn" value="Set Learn Prefs" class="form" onClick="event_form.action.value = 'learn'; event_form.submit();" disabled> <input type="button" name="delete_btn" value="Delete" class="form" onClick="event_form.action.value = 'delete'; event_form.submit();" disabled></td></tr>
|
||||||
</table></center>
|
</table></center>
|
||||||
</form>
|
</form>
|
||||||
</body>
|
</body>
|
||||||
|
@ -835,6 +847,10 @@ filterWindow( '<?php echo $PHP_SELF ?>?view=filter&mid=<?php echo $mid ?><?php e
|
||||||
<title>ZM - <?php echo $monitor[Name] ?> - Event Filter</title>
|
<title>ZM - <?php echo $monitor[Name] ?> - Event Filter</title>
|
||||||
<link rel="stylesheet" href="zmstyles.css" type="text/css">
|
<link rel="stylesheet" href="zmstyles.css" type="text/css">
|
||||||
<script language="JavaScript">
|
<script language="JavaScript">
|
||||||
|
function newWindow(Url,Name,Width,Height)
|
||||||
|
{
|
||||||
|
var Name = window.open(Url,Name,"resizable,scrollbars,width="+Width+",height="+Height);
|
||||||
|
}
|
||||||
function closeWindow()
|
function closeWindow()
|
||||||
{
|
{
|
||||||
top.window.close();
|
top.window.close();
|
||||||
|
@ -885,7 +901,14 @@ function submitToFilter( form )
|
||||||
}
|
}
|
||||||
function submitToEvents( form )
|
function submitToEvents( form )
|
||||||
{
|
{
|
||||||
form.target = 'zmEvents<?php echo $monitor[Name] ?>';
|
var Url = '<?php echo $PHP_SELF ?>';
|
||||||
|
var Name = 'zmEvents<?php echo $monitor[Name] ?>';
|
||||||
|
var Width = <?php echo $jws['events']['w'] ?>;
|
||||||
|
var Height = <?php echo $jws['events']['h'] ?>;
|
||||||
|
var Options = 'resizable,scrollbars,width='+Width+',height='+Height;
|
||||||
|
|
||||||
|
window.open( Url, Name, Options );
|
||||||
|
form.target = Name;
|
||||||
form.view.value = 'events';
|
form.view.value = 'events';
|
||||||
form.submit();
|
form.submit();
|
||||||
}
|
}
|
||||||
|
@ -1011,7 +1034,7 @@ function closeWindow()
|
||||||
}
|
}
|
||||||
function deleteEvent()
|
function deleteEvent()
|
||||||
{
|
{
|
||||||
opener.location.href = "<?php echo $PHP_SELF ?>?view=none&action=delete&delete_eid=<?php echo $eid ?>";
|
opener.location.href = "<?php echo $PHP_SELF ?>?view=none&action=delete&mark_eid=<?php echo $eid ?>";
|
||||||
window.close();
|
window.close();
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -1068,7 +1091,14 @@ function deleteEvent()
|
||||||
<title>ZM - Event - <?php echo $event[Name] ?></title>
|
<title>ZM - Event - <?php echo $event[Name] ?></title>
|
||||||
<link rel="stylesheet" href="zmstyles.css" type="text/css">
|
<link rel="stylesheet" href="zmstyles.css" type="text/css">
|
||||||
<script language="JavaScript">
|
<script language="JavaScript">
|
||||||
//opener.location.reload();
|
<?php
|
||||||
|
if ( $refresh_parent )
|
||||||
|
{
|
||||||
|
?>
|
||||||
|
opener.location.reload();
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
window.focus();
|
window.focus();
|
||||||
function refreshWindow()
|
function refreshWindow()
|
||||||
{
|
{
|
||||||
|
@ -1087,21 +1117,29 @@ function newWindow(Url,Name,Width,Height)
|
||||||
<body>
|
<body>
|
||||||
<table border="0" cellspacing="0" cellpadding="4" width="100%">
|
<table border="0" cellspacing="0" cellpadding="4" width="100%">
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="6" align="left" class="text">
|
<td colspan="3" align="left" class="text">
|
||||||
<form method="get" action="<?php echo $PHP_SELF ?>">
|
<form name="rename_form" method="get" action="<?php echo $PHP_SELF ?>">
|
||||||
<input type="hidden" name="view" value="<?php echo $view ?>">
|
<input type="hidden" name="view" value="<?php echo $view ?>">
|
||||||
<input type="hidden" name="action" value="rename">
|
<input type="hidden" name="action" value="rename">
|
||||||
<input type="hidden" name="eid" value="<?php echo $eid ?>">
|
<input type="hidden" name="eid" value="<?php echo $eid ?>">
|
||||||
<input type="text" size="16" name="event_name" value="<?php echo $event[Name] ?>" class="form">
|
<input type="text" size="16" name="event_name" value="<?php echo $event[Name] ?>" class="form">
|
||||||
<input type="submit" value="Rename" class="form"></td>
|
<input type="submit" value="Rename" class="form"></form></td>
|
||||||
|
<td colspan="3" align="right" class="text">
|
||||||
|
<form name="learn_form" method="get" action="<?php echo $PHP_SELF ?>">
|
||||||
|
<input type="hidden" name="view" value="<?php echo $view ?>">
|
||||||
|
<input type="hidden" name="action" value="learn">
|
||||||
|
<input type="hidden" name="eid" value="<?php echo $eid ?>">
|
||||||
|
<input type="hidden" name="mark_eid" value="<?php echo $eid ?>">
|
||||||
|
Learn Pref: <select name="learn_state" class="form" onChange="learn_form.submit();"><option value=""<?php if ( !$event[LearnState] ) echo " selected" ?>>Ignore</option><option value="-"<?php if ( $event[LearnState]=='-' ) echo " selected" ?>>Exclude</option><option value="+"<?php if ( $event[LearnState]=='+' ) echo " selected" ?>>Include</option></select>
|
||||||
|
</form></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="center" class="text"><a href="javascript: refreshWindow();">Refresh</a></td>
|
<td align="center" class="text"><a href="javascript: refreshWindow();">Refresh</a></td>
|
||||||
<td align="center" class="text"><a href="<?php echo $PHP_SELF ?>?view=none&action=delete&delete_eid=<?php echo $eid ?>">Delete</a></td>
|
<td align="center" class="text"><a href="<?php echo $PHP_SELF ?>?view=none&action=delete&mark_eid=<?php echo $eid ?>">Delete</a></td>
|
||||||
<?php if ( $event[Archived] ) { ?>
|
<?php if ( $event[Archived] ) { ?>
|
||||||
<td align="center" class="text"><a href="<?php echo $PHP_SELF ?>?view=<?php echo $view ?>&action=unarchive&mid=<?php echo $event[MonitorName] ?>&eid=<?php echo $eid ?>">Unarchive</a></td>
|
<td align="center" class="text"><a href="<?php echo $PHP_SELF ?>?view=<?php echo $view ?>&action=unarchive&eid=<?php echo $eid ?>">Unarchive</a></td>
|
||||||
<?php } else { ?>
|
<?php } else { ?>
|
||||||
<td align="center" class="text"><a href="<?php echo $PHP_SELF ?>?view=<?php echo $view ?>&action=archive&mid=<?php echo $event[MonitorName] ?>&eid=<?php echo $eid ?>">Archive</a></td>
|
<td align="center" class="text"><a href="<?php echo $PHP_SELF ?>?view=<?php echo $view ?>&action=archive&eid=<?php echo $eid ?>">Archive</a></td>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<?php if ( $mode == "stream" ) { ?>
|
<?php if ( $mode == "stream" ) { ?>
|
||||||
<td align="center" class="text"><a href="<?php echo $PHP_SELF ?>?view=event&mode=still&mid=<?php echo $mid ?>&eid=<?php echo $eid ?>">Stills</a></td>
|
<td align="center" class="text"><a href="<?php echo $PHP_SELF ?>?view=event&mode=still&mid=<?php echo $mid ?>&eid=<?php echo $eid ?>">Stills</a></td>
|
||||||
|
@ -1300,7 +1338,7 @@ function configureButton(form,name)
|
||||||
<td align="center" class="text"><?php echo $zone['Type'] ?></td>
|
<td align="center" class="text"><?php echo $zone['Type'] ?></td>
|
||||||
<td align="center" class="text"><?php echo $zone[Units] ?></td>
|
<td align="center" class="text"><?php echo $zone[Units] ?></td>
|
||||||
<td align="center" class="text"><?php echo $zone[LoX] ?>,<?php echo $zone[LoY] ?>-<?php echo $zone[HiX] ?>,<?php echo $zone[HiY]?></td>
|
<td align="center" class="text"><?php echo $zone[LoX] ?>,<?php echo $zone[LoY] ?>-<?php echo $zone[HiX] ?>,<?php echo $zone[HiY]?></td>
|
||||||
<td align="center" class="text"><input type="checkbox" name="delete_zids[]" value="<?php echo $zone[Id] ?>" onClick="configureButton( zone_form, 'delete_zids' );"></td>
|
<td align="center" class="text"><input type="checkbox" name="mark_zids[]" value="<?php echo $zone[Id] ?>" onClick="configureButton( zone_form, 'mark_zids' );"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
|
@ -389,7 +389,7 @@ function checkAll(form,name){
|
||||||
<?php if ( !$archived ) { ?>
|
<?php if ( !$archived ) { ?>
|
||||||
<td align="center" class="text"><a href="<?php echo $PHP_SELF ?>?view=events&mid=<?php echo $mid ?>&archived=1">Archive</a></td>
|
<td align="center" class="text"><a href="<?php echo $PHP_SELF ?>?view=events&mid=<?php echo $mid ?>&archived=1">Archive</a></td>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<td align="right" class="text"><a href="javascript: checkAll( event_form, 'delete_eids' );">Check All</a></td>
|
<td align="right" class="text"><a href="javascript: checkAll( event_form, 'mark_eids' );">Check All</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr><td colspan="5" class="text"> </td></tr>
|
<tr><td colspan="5" class="text"> </td></tr>
|
||||||
<tr><td colspan="5"><table border="0" cellspacing="0" cellpadding="0" width="100%">
|
<tr><td colspan="5"><table border="0" cellspacing="0" cellpadding="0" width="100%">
|
||||||
|
@ -413,7 +413,7 @@ function checkAll(form,name){
|
||||||
<td align="center" class="text"><?php echo $row[Length] ?></td>
|
<td align="center" class="text"><?php echo $row[Length] ?></td>
|
||||||
<td align="center" class="text"><?php echo $row[Frames] ?> (<?php echo $row[AlarmFrames] ?>)</td>
|
<td align="center" class="text"><?php echo $row[Frames] ?> (<?php echo $row[AlarmFrames] ?>)</td>
|
||||||
<td align="center" class="text"><?php echo $row[AvgScore] ?> (<?php echo $row[MaxScore] ?>)</td>
|
<td align="center" class="text"><?php echo $row[AvgScore] ?> (<?php echo $row[MaxScore] ?>)</td>
|
||||||
<td align="center" class="text"><input type="checkbox" name="delete_eids[]" value="<?php echo $row[Id] ?>"></td>
|
<td align="center" class="text"><input type="checkbox" name="mark_eids[]" value="<?php echo $row[Id] ?>"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
@ -472,7 +472,7 @@ function closeWindow() {
|
||||||
window.close();
|
window.close();
|
||||||
}
|
}
|
||||||
function deleteEvent() {
|
function deleteEvent() {
|
||||||
opener.location.href = "<?php echo $PHP_SELF ?>?view=none&action=delete&delete_eid=<?php echo $eid ?>";
|
opener.location.href = "<?php echo $PHP_SELF ?>?view=none&action=delete&mark_eid=<?php echo $eid ?>";
|
||||||
window.close();
|
window.close();
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -554,7 +554,7 @@ function newWindow(Url,Name,Width,Height) {
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="center" class="text"><a href="javascript: refreshWindow();">Refresh</a></td>
|
<td align="center" class="text"><a href="javascript: refreshWindow();">Refresh</a></td>
|
||||||
<td align="center" class="text"><a href="<?php echo $PHP_SELF ?>?view=none&action=delete&delete_eid=<?php echo $eid ?>">Delete</a></td>
|
<td align="center" class="text"><a href="<?php echo $PHP_SELF ?>?view=none&action=delete&mark_eid=<?php echo $eid ?>">Delete</a></td>
|
||||||
<?php if ( $event[Archived] ) { ?>
|
<?php if ( $event[Archived] ) { ?>
|
||||||
<td align="center" class="text"><a href="<?php echo $PHP_SELF ?>?view=<?php echo $view ?>&action=unarchive&mid=<?php echo $event[MonitorName] ?>&eid=<?php echo $eid ?>">Unarchive</a></td>
|
<td align="center" class="text"><a href="<?php echo $PHP_SELF ?>?view=<?php echo $view ?>&action=unarchive&mid=<?php echo $event[MonitorName] ?>&eid=<?php echo $eid ?>">Unarchive</a></td>
|
||||||
<?php } else { ?>
|
<?php } else { ?>
|
||||||
|
@ -737,7 +737,7 @@ function closeWindow() {
|
||||||
<td align="center" class="text"><?php echo $zone['Type'] ?></td>
|
<td align="center" class="text"><?php echo $zone['Type'] ?></td>
|
||||||
<td align="center" class="text"><?php echo $zone[Units] ?></td>
|
<td align="center" class="text"><?php echo $zone[Units] ?></td>
|
||||||
<td align="center" class="text"><?php echo $zone[LoX] ?>,<?php echo $zone[LoY] ?>-<?php echo $zone[HiX] ?>,<?php echo $zone[HiY]?></td>
|
<td align="center" class="text"><?php echo $zone[LoX] ?>,<?php echo $zone[LoY] ?>-<?php echo $zone[HiX] ?>,<?php echo $zone[HiY]?></td>
|
||||||
<td align="center" class="text"><input type="checkbox" name="delete_zids[]" value="<?php echo $zone[Id] ?>"></td>
|
<td align="center" class="text"><input type="checkbox" name="mark_zids[]" value="<?php echo $zone[Id] ?>"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue