add multi database option along with related zend configuration module (#439)
[openemr.git] / interface / modules / zend_modules / module / Multipledb / view / multipledb / multipledb / edit.phtml
blob2207bce503b0cf0da21b3b84cf1612b1f6fa1133
1 <script>
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      * +------------------------------------------------------------------------------+
17      *
18      */
19     <?php if ($closeBeforeOpening):?>
20     opener.document.forms[0].submit();
21     window.close();
23     <?php endif;?>
24 </script>
25 <form id="editForm" action="save" method="POST">
26     <ul class="form-style-1">
27         <li>
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')?>" />
31         </li>
32         <li>
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')?>" />
36         </li>
37         <li>
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')?>" />
40         </li>
41         <li>
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') ?>" />
44         </li>
45         <li>
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')?>" />
48         </li>
49         <li>
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);" />
52         </li>
53         <li>
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')?>" />
56         </li>
57     </ul>
58 </form>
60 <script>
62     $("#editForm").validate();
63     function onlynumber(e, t) {
65         try {
66             if (window.event) {
67                 var charCode = window.event.keyCode;
68             }
69             else if (e) {
70                 var charCode = e.which;
71             }
72             else { return true; }
73             if (charCode > 31 && (charCode < 48 || charCode > 57)) {
74                 return false;
75             }
76             return true;
77         }
78         catch (err) {
79             alert(err.Description);
80         }
81     }
83 </script>