Update ICD9/ICD10 (yearly chore, grateful to cms for icd harvest)
[openemr.git] / phpmyadmin / pmd_display_field.php
blob8efe96f05784c39bcbf3d4d0be865cd043e299bd
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Handles the display field
6 * @package PhpMyAdmin-Designer
7 */
9 /**
12 require_once './libraries/common.inc.php';
14 PMA_Response::getInstance()->disable();
16 require_once 'libraries/pmd_common.php';
18 $table = $_POST['T'];
19 $display_field = $_POST['F'];
21 if ($cfgRelation['displaywork']) {
23 $disp = PMA_getDisplayField($db, $table);
24 if ($disp) {
25 if ($display_field != $disp) {
26 $upd_query = 'UPDATE '
27 . PMA_Util::backquote($GLOBALS['cfgRelation']['db'])
28 . '.'
29 . PMA_Util::backquote($cfgRelation['table_info'])
30 . ' SET display_field = \''
31 . PMA_Util::sqlAddSlashes($display_field) . '\''
32 . ' WHERE db_name = \'' . PMA_Util::sqlAddSlashes($db) . '\''
33 . ' AND table_name = \'' . PMA_Util::sqlAddSlashes($table) . '\'';
34 } else {
35 $upd_query = 'DELETE FROM '
36 . PMA_Util::backquote($GLOBALS['cfgRelation']['db'])
37 . '.'
38 . PMA_Util::backquote($cfgRelation['table_info'])
39 . ' WHERE db_name = \'' . PMA_Util::sqlAddSlashes($db) . '\''
40 . ' AND table_name = \'' . PMA_Util::sqlAddSlashes($table) . '\'';
42 } elseif ($display_field != '') {
43 $upd_query = 'INSERT INTO '
44 . PMA_Util::backquote($GLOBALS['cfgRelation']['db'])
45 . '.'
46 . PMA_Util::backquote($cfgRelation['table_info'])
47 . '(db_name, table_name, display_field) '
48 . ' VALUES('
49 . '\'' . PMA_Util::sqlAddSlashes($db) . '\','
50 . '\'' . PMA_Util::sqlAddSlashes($table) . '\','
51 . '\'' . PMA_Util::sqlAddSlashes($display_field) . '\')';
54 if (isset($upd_query)) {
55 $upd_rs = PMA_queryAsControlUser($upd_query);
57 } // end if
59 header("Content-Type: text/xml; charset=utf-8");
60 header("Cache-Control: no-cache");
61 die("<root act='save_pos' return='"
62 . __('Modifications have been saved') . "'></root>");