2003-07-11 17:27:56 +08:00
|
|
|
<?php
|
|
|
|
if ( !canView( 'Events' ) )
|
|
|
|
{
|
|
|
|
$view = "error";
|
2003-07-14 22:14:34 +08:00
|
|
|
return;
|
2003-07-11 17:27:56 +08:00
|
|
|
}
|
|
|
|
$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
|
|
|
|
{
|
2004-01-08 18:55:16 +08:00
|
|
|
$result = mysql_query( "select * from Frames where EventID = '$eid' and Score = '".$event['MaxScore']."'" );
|
2003-07-11 17:27:56 +08:00
|
|
|
if ( !$result )
|
|
|
|
die( mysql_error() );
|
|
|
|
$frame = mysql_fetch_assoc( $result );
|
2004-01-08 18:09:35 +08:00
|
|
|
$fid = $frame['FrameId'];
|
2003-07-11 17:27:56 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
$result = mysql_query( "select count(*) as FrameCount from Frames where EventID = '$eid'" );
|
|
|
|
if ( !$result )
|
|
|
|
die( mysql_error() );
|
|
|
|
$row = mysql_fetch_assoc( $result );
|
2004-01-08 18:09:35 +08:00
|
|
|
$max_fid = $row['FrameCount'];
|
2003-07-11 17:27:56 +08:00
|
|
|
|
|
|
|
$first_fid = 1;
|
|
|
|
$prev_fid = $fid-1;
|
|
|
|
$next_fid = $fid+1;
|
|
|
|
$last_fid = $max_fid;
|
|
|
|
|
2004-01-08 18:09:35 +08:00
|
|
|
$image_path = $frame['ImagePath'];
|
2003-07-11 17:27:56 +08:00
|
|
|
$anal_image = preg_replace( "/capture/", "analyse", $image_path );
|
|
|
|
if ( file_exists( $anal_image ) )
|
|
|
|
{
|
|
|
|
$image_path = $anal_image;
|
|
|
|
}
|
2004-01-08 18:09:35 +08:00
|
|
|
$img_class = $frame['AlarmFrame']?"alarm":"normal";
|
2003-07-11 17:27:56 +08:00
|
|
|
?>
|
|
|
|
<html>
|
|
|
|
<head>
|
2004-01-07 20:57:07 +08:00
|
|
|
<title>ZM - <?= $zmSlangFrame ?> <?= $eid."-".$fid ?></title>
|
2003-07-11 17:27:56 +08:00
|
|
|
<link rel="stylesheet" href="zm_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();
|
|
|
|
}
|
|
|
|
function deleteEvent()
|
|
|
|
{
|
2004-01-08 18:55:16 +08:00
|
|
|
location.href = "<?= $PHP_SELF ?>?view=none&action=delete&mark_eid=<?= $eid ?>";
|
2003-07-11 17:27:56 +08:00
|
|
|
//window.close();
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<table border="0">
|
2004-01-08 18:55:16 +08:00
|
|
|
<tr><td colspan="2" class="smallhead"><?= $zmSlangFrame ?> <?= $eid."-".$fid." (".$frame['Score'].")" ?>
|
2004-01-08 18:09:35 +08:00
|
|
|
<?php if ( ZM_RECORD_EVENT_STATS && $frame['AlarmFrame'] ) { ?>
|
2004-01-07 20:57:07 +08:00
|
|
|
(<a href="javascript: newWindow( '<?= $PHP_SELF ?>?view=stats&eid=<?= $eid ?>&fid=<?= $fid ?>', 'zmStats', <?= $jws['stats']['w'] ?>, <?= $jws['stats']['h'] ?> );"><?= $zmSlangStats ?></a>)
|
2003-07-11 17:27:56 +08:00
|
|
|
<?php } ?>
|
|
|
|
</td>
|
2004-01-07 20:57:07 +08:00
|
|
|
<td align="center" class="text"><?php if ( canEdit( 'Events' ) ) { ?><a href="javascript: deleteEvent();"><?= $zmSlangDelete ?></a><?php } else { ?> <?php } ?></td>
|
|
|
|
<td align="right" class="text"><a href="javascript: closeWindow();"><?= $zmSlangClose ?></a></td>
|
2003-07-11 17:27:56 +08:00
|
|
|
</tr>
|
2004-01-08 18:09:35 +08:00
|
|
|
<tr><td colspan="4"><img src="<?= $image_path ?>" width="<?= $event['Width'] ?>" height="<?= $event['Height'] ?>" class="<?= $img_class ?>"></td></tr>
|
2003-07-11 17:27:56 +08:00
|
|
|
<tr>
|
|
|
|
<?php if ( $fid > 1 ) { ?>
|
2004-01-08 18:55:16 +08:00
|
|
|
<td align="center" width="25%" class="text"><a href="<?= $PHP_SELF ?>?view=frame&eid=<?= $eid ?>&fid=<?= $first_fid ?>"><?= $zmSlangFirst ?></a></td>
|
2003-07-11 17:27:56 +08:00
|
|
|
<?php } else { ?>
|
|
|
|
<td align="center" width="25%" class="text"> </td>
|
|
|
|
<?php } if ( $fid > 1 ) { ?>
|
2004-01-08 18:55:16 +08:00
|
|
|
<td align="center" width="25%" class="text"><a href="<?= $PHP_SELF ?>?view=frame&eid=<?= $eid ?>&fid=<?= $prev_fid ?>"><?= $zmSlangPrev ?></a></td>
|
2003-07-11 17:27:56 +08:00
|
|
|
<?php } else { ?>
|
|
|
|
<td align="center" width="25%" class="text"> </td>
|
|
|
|
<?php } if ( $fid < $max_fid ) { ?>
|
2004-01-08 18:55:16 +08:00
|
|
|
<td align="center" width="25%" class="text"><a href="<?= $PHP_SELF ?>?view=frame&eid=<?= $eid ?>&fid=<?= $next_fid ?>"><?= $zmSlangNext ?></a></td>
|
2003-07-11 17:27:56 +08:00
|
|
|
<?php } else { ?>
|
|
|
|
<td align="center" width="25%" class="text"> </td>
|
|
|
|
<?php } if ( $fid < $max_fid ) { ?>
|
2004-01-08 18:55:16 +08:00
|
|
|
<td align="center" width="25%" class="text"><a href="<?= $PHP_SELF ?>?view=frame&eid=<?= $eid ?>&fid=<?= $last_fid ?>"><?= $zmSlangLast ?></a></td>
|
2003-07-11 17:27:56 +08:00
|
|
|
<?php } else { ?>
|
|
|
|
<td align="center" width="25%" class="text"> </td>
|
|
|
|
<?php } ?>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</body>
|
|
|
|
</html>
|