zoneminder/web/skins/classic/views/control.php

77 lines
2.3 KiB
PHP
Raw Normal View History

<?php
//
// ZoneMinder web control view file, $Date$, $Revision$
// Copyright (C) 2001-2008 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
//
2019-02-13 05:40:48 +08:00
if ( !canView('Control') ) {
$view = 'error';
return;
}
$params = array();
$groupSql = '';
if ( !empty($_REQUEST['group']) ) {
2019-02-13 05:40:48 +08:00
$groupSql = ' AND gm.GroupId = :groupid';
$params[':groupid'] = $_REQUEST['group'];
}
$mid = !empty($_REQUEST['mid']) ? validInt($_REQUEST['mid']) : 0;
$sql = "SELECT m.* FROM Monitors m INNER JOIN Groups_Monitors AS gm ON m.Id = gm.MonitorId WHERE m.Function != 'None' AND m.Controllable = 1$groupSql ORDER BY Sequence";
$mids = array();
2019-02-13 05:40:48 +08:00
foreach ( dbFetchAll($sql, false, $params) as $row ) {
if ( !visibleMonitor($row['Id']) ) {
continue;
}
if ( empty($mid) )
$mid = $row['Id'];
$mids[$row['Id']] = $row['Name'];
}
2019-02-13 05:40:48 +08:00
foreach ( getSkinIncludes('includes/control_functions.php') as $includeFile )
require_once $includeFile;
$monitor = new ZM\Monitor($mid);
$focusWindow = true;
2019-02-13 05:40:48 +08:00
xhtmlHeaders(__FILE__, translate('Control'));
?>
<body>
<div id="page">
<div id="header">
<div id="headerButtons">
<a href="#" data-on-click="closeWindow"><?php echo translate('Close') ?></a>
</div>
2015-05-10 21:10:30 +08:00
<h2><?php echo translate('Control') ?></h2>
<div id="headerControl">
<form name="contentForm" id="contentForm" method="get" action="?">
<input type="hidden" name="view" value="<?php echo $view ?>"/>
2019-02-13 05:40:48 +08:00
<?php echo buildSelect('mid', $mids, 'this.form.submit();'); ?>
</form>
</div>
</div>
<div id="content">
<div id="ptzControls" class="ptzControls">
2019-02-13 05:40:48 +08:00
<?php echo ptzControls($monitor) ?>
</div>
</div>
</div>
</body>
</html>