add multi database option along with related zend configuration module (#439)
[openemr.git] / interface / modules / zend_modules / module / Multipledb / view / multipledb / multipledb / index.phtml
bloba98bf98303b19e1f9c7a370a1d7b08efd76a7f08
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
20     if ($closeBeforeOpening):
21     ?>
22     opener.document.forms[0].submit();
23     window.close();
25     <?php
26     endif;
27     ?>
28 </script>
29 <a href="multipledb/edit"><input type="submit" value="<?php echo  $translate->z_xlt('Add new database') ?>"></a>
30 <a href="multipledb/generatesafekey"><input type="submit" value="<?php echo  $translate->z_xlt('Generate safe key') ?>"></a>
31 <table class="responstable">
32     <?php
33     $html = null;
34     foreach ($getmultipledb as $value) {
35         $date       = date('Y/m/d H:i:s', strtotime($value['date']));
36         $editLang   = $translate->z_xlt('Edit');
37         $removeLang = $translate->z_xlt('Remove');
38         $id = $this->escapeHtml($value['id']);
39         $namespace = $this->escapeHtml($value['namespace']);
40         $username = $this->escapeHtml($value['username']);
41         $dbname = $this->escapeHtml($value['dbname']);
42         $host = $this->escapeHtml($value['host']);
43         $port = $this->escapeHtml($value['port']);
44         $html .= <<<html
45     <tr>
46         <td><a href="multipledb/edit?id={$id}">{$editLang}</a> | <a href="multipledb/remove?id={$id}"  onclick="save($(this),'{$namespace}')">{$removeLang}</a></td>
47         <td>{$namespace}</td> 
48         <td>{$username}</td>
49         <td>{$dbname}</td>
50         <td>{$host}</td>
51         <td>{$port}</td>
52         <td>{$date}</td>
54     </tr>
55 html;
56     }
57     if(empty($html)){
58         $lang = $translate->z_xlt('Empty table');
59         $html .= <<<html
60     <tr>
61         <td colspan="7">{$lang}</td>
62     </tr>
63 html;
64     }
65     ?>
66     <tr>
67         <th><?php echo $translate->z_xlt('Options') ?></th>
68         <th><?php echo $translate->z_xlt('Namespace') ?></th>
69         <th><span><?php echo $translate->z_xlt('Username') ?></span></th>
70         <th><?php echo $translate->z_xlt('Database name') ?></th>
71         <th><?php echo $translate->z_xlt('Host') ?></th>
72         <th><?php echo $translate->z_xlt('Port') ?></th>
73         <th><?php echo $translate->z_xlt('Date') ?></th>
74     </tr>
76     <?php echo $html ?>
78 </table>
80 <script type="text/javascript">
81     function save(box,table){
82         var href = box.prop('href');
83         event.preventDefault()
85         var answer = confirm('<?php echo  $translate->z_xlt('Are you sure you want to remove namespace') ?>' + ' ' + table + '?');
86         if (answer) {
87             window.location = href;
88         }
89     }
90 </script>