forked from openemr/openemr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
list_installed.php
74 lines (66 loc) · 2.85 KB
/
list_installed.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?php
/**
* This file implements the main jquery interface for loading external
* database files into openEMR
*
* Copyright (C) 2012 Patient Healthcare Analytics, Inc.
* Copyright (C) 2011 Phyaura, LLC <[email protected]>
*
* LICENSE: 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, see <http:https://opensource.org/licenses/gpl-license.php>;.
*
* @package OpenEMR
* @author (Mac) Kevin McAloon <[email protected]>
* @author Rohit Kumar <[email protected]>
* @author Brady Miller <[email protected]>
* @link http:https://www.open-emr.org
*/
//SANITIZE ALL ESCAPES
$sanitize_all_escapes=true;
//
//STOP FAKE REGISTER GLOBALS
$fake_register_globals=false;
//
require_once("../../interface/globals.php");
require_once("$srcdir/acl.inc");
// Control access
if (!acl_check('admin', 'super')) {
echo xlt('Not Authorized');
exit;
}
$db = isset($_GET['db']) ? $_GET['db'] : '0';
// Ordering by the imported_date with tiebreaker being the revision_date
$rez = sqlStatement("SELECT DATE_FORMAT(`revision_date`,'%Y-%m-%d') as `revision_date`, `revision_version`, `name` FROM `standardized_tables_track` WHERE upper(`name`) = ? ORDER BY `imported_date` DESC, `revision_date` DESC", array($db) );
for($iter=0; $row=sqlFetchArray($rez); $iter++) {
$sqlReturn[$iter]=$row;
}
if (empty($sqlReturn)) {
?>
<div class="stg"><?php echo xlt("Not installed"); ?></div>
<?php
} else {
if ($sqlReturn[0]['name'] == 'SNOMED' && $sqlReturn[0]['revision_version'] == 'US Extension') {
// If using the SNOMED US Extension package, then show the preceding SNOMED International Package information first
?>
<div class="atr"><?php echo xlt("Name") . ": " . text($sqlReturn[1]['name']); ?> </div>
<div class="atr"><?php echo xlt("Revision") . ": " . text($sqlReturn[1]['revision_version']); ?> </div>
<div class="atr"><?php echo xlt("Release Date") . ": " . text($sqlReturn[1]['revision_date']); ?> </div>
<br>
<?php
}
// Always show the first item of query results
?>
<div class="atr"><?php echo xlt("Name") . ": " . text($sqlReturn[0]['name']); ?> </div>
<div class="atr"><?php echo xlt("Revision") . ": " . text($sqlReturn[0]['revision_version']); ?> </div>
<div class="atr"><?php echo xlt("Release Date") . ": " . text($sqlReturn[0]['revision_date']); ?> </div>
<?php
}
?>