2 /* +-----------------------------------------------------------------------------+
3 * Copyright 2016 matrix israel
4 * LICENSE: This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 3
7 * of the License, or (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 * You should have received a copy of the GNU General Public License
13 * along with this program. If not, see
14 * http://www.gnu.org/licenses/licenses.html#GPL
15 * @author Oshri Rozmarin <oshri.rozmarin@gmail.com>
16 * +------------------------------------------------------------------------------+
19 <?php if ($closeBeforeOpening):?>
20 opener.document.forms[0].submit();
25 <form id="editForm" action="save" method="POST">
26 <ul class="form-style-1">
28 <label><?php echo $translate->z_xlt('Namespace')?> <span class="required">*</span></label>
29 <input type="text" value="<?php echo $this->escapeHtml($db->namespace)?>" name="db[namespace]" required class="field-divided" placeholder="<?php echo $translate->z_xlt('Namespace')?>" />
33 <label><?php echo $translate->z_xlt('Username')?> <span class="required">*</span></label>
34 <input type="text" value="<?php echo $this->escapeHtml($db->username)?>" name="db[username]" required class="field-divided" placeholder="<?php echo $translate->z_xlt('Username')?>" />
38 <label><?php echo $translate->z_xlt('Database name')?></label>
39 <input type="text" value="<?php echo $this->escapeHtml($db->dbname)?>" name="db[dbname]" required class="field-divided" placeholder="<?php echo $translate->z_xlt('Database name')?>" />
42 <label><?php echo $translate->z_xlt('Password')?> <span class="required">*</span></label>
43 <input type="password" name="db[password]" class="field-divided" <?php echo ($db->password) ? '' : 'required' ?> placeholder="<?php echo ($db->password) ? '****' : $translate->z_xlt('Password') ?>" />
46 <label><?php echo $translate->z_xlt('Host')?> <span class="required">*</span></label>
47 <input type="text" value="<?php echo ($db->host) ? $this->escapeHtml($db->host) : 'localhost' ?>" name="db[host]" required class="field-divided" placeholder="<?php echo $translate->z_xlt('Host')?>" />
50 <label><?php echo $translate->z_xlt('Port')?> <span class="required">*</span></label>
51 <input type="text" value="<?php echo ($db->port) ? $this->escapeHtml($db->port) : '3306' ?>" name="db[port]" required class="field-divided" placeholder="<?php echo $translate->z_xlt('Port')?>" onkeypress="return onlynumber(event,this);" />
54 <input type="button" name="back" value="<?php echo $translate->z_xlt('Back')?>" onclick=" window.location.href = window.history.back(1);" />
55 <input type="submit" value="<?php echo $translate->z_xlt('Save')?>" />
62 $("#editForm").validate();
63 function onlynumber(e, t) {
67 var charCode = window.event.keyCode;
70 var charCode = e.which;
73 if (charCode > 31 && (charCode < 48 || charCode > 57)) {
79 alert(err.Description);