2004-02-21 02:27:38 +08:00
|
|
|
<?php
|
|
|
|
//
|
|
|
|
// ZoneMinder web watch menu view file, $Date$, $Revision$
|
2005-02-24 22:40:14 +08:00
|
|
|
// Copyright (C) 2003, 2004, 2005 Philip Coombes
|
2004-02-21 02:27:38 +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.
|
|
|
|
//
|
|
|
|
|
|
|
|
if ( !canView( 'Stream' ) )
|
|
|
|
{
|
|
|
|
$view = "error";
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( empty($mode) )
|
|
|
|
{
|
2005-10-19 21:30:05 +08:00
|
|
|
if ( ZM_WEB_USE_STREAMS && canStream() )
|
2004-02-21 02:27:38 +08:00
|
|
|
$mode = "stream";
|
|
|
|
else
|
|
|
|
$mode = "still";
|
|
|
|
}
|
|
|
|
|
|
|
|
$result = mysql_query( "select * from Monitors where Id = '$mid'" );
|
|
|
|
if ( !$result )
|
|
|
|
die( mysql_error() );
|
|
|
|
$monitor = mysql_fetch_assoc( $result );
|
|
|
|
|
|
|
|
if ( !isset( $scale ) )
|
2005-10-20 00:52:28 +08:00
|
|
|
$scale = $monitor['DefaultScale'] * ZM_WEB_DEFAULT_SCALE;
|
2004-02-21 02:27:38 +08:00
|
|
|
|
|
|
|
?>
|
2004-12-29 03:22:23 +08:00
|
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
2004-02-21 02:27:38 +08:00
|
|
|
<html>
|
|
|
|
<head>
|
2004-12-29 02:20:11 +08:00
|
|
|
<link rel="stylesheet" href="zm_html_styles.css" type="text/css">
|
2004-12-29 03:29:43 +08:00
|
|
|
<script type="text/javascript">
|
2004-02-21 02:27:38 +08:00
|
|
|
function newWindow(Url,Name,Width,Height)
|
|
|
|
{
|
2005-10-17 05:11:44 +08:00
|
|
|
var Win = window.open(Url,Name,"resizable,width="+Width+",height="+Height);
|
2004-02-21 02:27:38 +08:00
|
|
|
}
|
|
|
|
function closeWindow()
|
|
|
|
{
|
|
|
|
top.window.close();
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<table width="96%" align="center" border="0" cellspacing="0" cellpadding="4">
|
|
|
|
<form name="view_form" method="get" action="<?= $PHP_SELF ?>" target="_parent">
|
|
|
|
<input type="hidden" name="view" value="watch">
|
|
|
|
<input type="hidden" name="mode" value="<?= $mode ?>">
|
|
|
|
<input type="hidden" name="mid" value="<?= $mid ?>">
|
|
|
|
<tr>
|
2005-02-24 18:43:29 +08:00
|
|
|
<td align="left" class="text"><b><?= $monitor['Name'] ?></b></td>
|
|
|
|
<?php
|
|
|
|
if ( ZM_OPT_CONTROL && $monitor['Controllable'] )
|
|
|
|
{
|
|
|
|
if ( !$control )
|
|
|
|
{
|
2005-10-17 05:11:44 +08:00
|
|
|
if ( canView( 'Control' ) )
|
2005-03-21 03:47:04 +08:00
|
|
|
{
|
2005-02-24 18:43:29 +08:00
|
|
|
?>
|
|
|
|
<td align="center" class="text"><a href="<?= $php_self ?>?view=watch&mid=<?= $mid ?>&mode=<?= $mode ?>&scale=<?= $scale ?>&control=1" target="_parent"><?= $zmSlangControl ?></a></td>
|
|
|
|
<?php
|
2005-03-21 03:47:04 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
?>
|
|
|
|
<td align="center" class="text"> </td>
|
|
|
|
<?php
|
|
|
|
}
|
2005-02-24 18:43:29 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2005-03-21 03:47:04 +08:00
|
|
|
if ( canView( 'Events' ) )
|
|
|
|
{
|
2005-02-24 18:43:29 +08:00
|
|
|
?>
|
|
|
|
<td align="center" class="text"><a href="<?= $php_self ?>?view=watch&mid=<?= $mid ?>&mode=<?= $mode ?>&scale=<?= $scale ?>&control=0" target="_parent"><?= $zmSlangEvents ?></a></td>
|
|
|
|
<?php
|
2005-03-21 03:47:04 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
?>
|
|
|
|
<td align="center" class="text"> </td>
|
|
|
|
<?php
|
|
|
|
}
|
2005-02-24 18:43:29 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
?>
|
|
|
|
<td align="center" class="text"> </td>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
2004-02-21 02:27:38 +08:00
|
|
|
<td align="center" valign="middle" class="text">
|
|
|
|
<?= $zmSlangScale ?>: <?= buildSelect( "scale", $scales, "document.view_form.submit();" ); ?>
|
|
|
|
</td>
|
2005-11-07 20:10:49 +08:00
|
|
|
<?php if ( canView( 'Control' ) && $monitor['Type'] == "Local" ) { ?>
|
2004-02-21 02:27:38 +08:00
|
|
|
<td align="center" class="text"><a href="javascript: newWindow( '<?= $PHP_SELF ?>?view=settings&mid=<?= $monitor['Id'] ?>', 'zmSettings<?= $monitor['Id'] ?>', <?= $jws['settings']['w'] ?>, <?= $jws['settings']['h'] ?> );"><?= $zmSlangSettings ?></a></td>
|
|
|
|
<?php } else { ?>
|
|
|
|
<td align="center" class="text"> </td>
|
|
|
|
<?php } ?>
|
|
|
|
<?php if ( $mode == "stream" ) { ?>
|
2005-02-24 18:43:29 +08:00
|
|
|
<td align="center" class="text"><a href="<?= $php_self ?>?view=watch&mid=<?= $mid ?>&control=<?= $control ?>&mode=still&scale=<?= $scale ?>" target="_parent"><?= $zmSlangStills ?></a></td>
|
2004-02-21 02:27:38 +08:00
|
|
|
<?php } elseif ( canStream() ) { ?>
|
2005-02-24 18:43:29 +08:00
|
|
|
<td align="center" class="text"><a href="<?= $php_self ?>?view=watch&mid=<?= $mid ?>&control=<?= $control ?>&mode=stream&scale=<?= $scale ?>" target="_parent"><?= $zmSlangStream ?></a></td>
|
2004-02-21 02:27:38 +08:00
|
|
|
<?php } else { ?>
|
|
|
|
<td align="center" class="text"> </td>
|
|
|
|
<?php } ?>
|
|
|
|
<td align="right" class="text"><a href="javascript: closeWindow();"><?= $zmSlangClose ?></a></td>
|
|
|
|
</tr>
|
|
|
|
</form>
|
|
|
|
</table>
|
|
|
|
</body>
|
|
|
|
</html>
|