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

97 lines
4.0 KiB
PHP
Raw Normal View History

2015-08-16 22:52:47 +08:00
<?php
//
// ZoneMinder web user 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.
2015-08-16 22:52:47 +08:00
//
2017-10-16 23:31:35 +08:00
if ( !canEdit( 'System' ) ) {
$view = 'error';
return;
2015-08-16 22:52:47 +08:00
}
if ( $_REQUEST['id'] ) {
if ( !($newServer = dbFetchOne( 'SELECT * FROM Servers WHERE Id = ?', NULL, ARRAY($_REQUEST['id'])) ) ) {
2017-10-16 23:31:35 +08:00
$view = 'error';
2015-08-16 22:52:47 +08:00
return;
}
} else {
$newServer = array();
$newServer['Name'] = translate('NewServer');
$newServer['Hostname'] = '';
$newServer['zmstats'] = '';
$newServer['zmaudit'] = '';
$newServer['zmtrigger'] = '';
2015-08-16 22:52:47 +08:00
}
$focusWindow = true;
2017-10-16 23:31:35 +08:00
xhtmlHeaders(__FILE__, translate('Server').' - '.$newServer['Name'] );
2015-08-16 22:52:47 +08:00
?>
<body>
<div id="page">
<div id="header">
2017-10-16 23:31:35 +08:00
<h2><?php echo translate('Server').' - '.$newServer['Name'] ?></h2>
2015-08-16 22:52:47 +08:00
</div>
<div id="content">
<form name="contentForm" method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>" onsubmit="return validateForm( this, <?php echo empty($newServer['Name'])?'true':'false' ?> )">
<input type="hidden" name="view" value="<?php echo $view ?>"/>
<input type="hidden" name="object" value="server"/>
<input type="hidden" name="id" value="<?php echo validHtmlStr($_REQUEST['id']) ?>"/>
2017-10-16 23:31:35 +08:00
<table id="contentTable" class="major">
2015-08-16 22:52:47 +08:00
<tbody>
<tr>
<th scope="row"><?php echo translate('Name') ?></th>
2015-08-16 22:52:47 +08:00
<td><input type="text" name="newServer[Name]" value="<?php echo $newServer['Name'] ?>"/></td>
</tr>
2015-09-18 03:35:27 +08:00
<tr>
<th scope="row"><?php echo translate('Hostname') ?></th>
2015-09-18 03:35:27 +08:00
<td><input type="text" name="newServer[Hostname]" value="<?php echo $newServer['Hostname'] ?>"/></td>
</tr>
<tr>
<th scope="row"><?php echo translate('RunStats') ?></th>
<td>
2018-01-18 03:22:04 +08:00
<input type="radio" name="newServer[zmstats]" value="1"<?php echo $newServer['zmstats'] ? ' checked="checked"' : '' ?>/> Yes
<input type="radio" name="newServer[zmstats]" value="0"<?php echo $newServer['zmstats'] ? '' : ' checked="checked"' ?>/> No
</td>
</tr>
<tr>
<th scope="row"><?php echo translate('RunAudit') ?></th>
<td>
2018-01-18 03:22:04 +08:00
<input type="radio" name="newServer[zmaudit]" value="1"<?php echo $newServer['zmaudit'] ? ' checked="checked"' : '' ?>/> Yes
<input type="radio" name="newServer[zmaudit]" value="0"<?php echo $newServer['zmaudit'] ? '' : ' checked="checked"' ?>/> No
</td>
</tr>
<tr>
<th scope="row"><?php echo translate('RunTrigger') ?></th>
<td>
2018-01-18 03:22:04 +08:00
<input type="radio" name="newServer[zmtrigger]" value="1"<?php echo $newServer['zmtrigger'] ? ' checked="checked"' : '' ?>/> Yes
<input type="radio" name="newServer[zmtrigger]" value="0"<?php echo $newServer['zmtrigger'] ? '' : ' checked="checked"' ?>/> No
</td>
</tr>
2015-08-16 22:52:47 +08:00
</tbody>
</table>
<div id="contentButtons">
2017-10-16 23:31:35 +08:00
<input type="hidden" name="action" value="Save"/>
<input type="submit" value="<?php echo translate('Save') ?>"/>
<input type="button" value="<?php echo translate('Cancel') ?>" onclick="closeWindow();"/>
2015-08-16 22:52:47 +08:00
</div>
</form>
</div>
</div>
</body>
</html>