Translated using Weblate (Japanese)
[phpmyadmin.git] / pmd_display_field.php
blob0925f1e1534b97a9de077e80dca0309a45208bb1
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * @package PhpMyAdmin-Designer
5 */
7 /**
9 */
10 require_once './libraries/common.inc.php';
12 PMA_Response::getInstance()->disable();
14 require_once 'libraries/pmd_common.php';
16 $table = $_POST['T'];
17 $display_field = $_POST['F'];
19 if ($cfgRelation['displaywork']) {
21 $disp = PMA_getDisplayField($db, $table);
22 if ($disp) {
23 if ($display_field != $disp) {
24 $upd_query = 'UPDATE ' . PMA_Util::backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_Util::backquote($cfgRelation['table_info'])
25 . ' SET display_field = \'' . PMA_Util::sqlAddSlashes($display_field) . '\''
26 . ' WHERE db_name = \'' . PMA_Util::sqlAddSlashes($db) . '\''
27 . ' AND table_name = \'' . PMA_Util::sqlAddSlashes($table) . '\'';
28 } else {
29 $upd_query = 'DELETE FROM ' . PMA_Util::backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_Util::backquote($cfgRelation['table_info'])
30 . ' WHERE db_name = \'' . PMA_Util::sqlAddSlashes($db) . '\''
31 . ' AND table_name = \'' . PMA_Util::sqlAddSlashes($table) . '\'';
33 } elseif ($display_field != '') {
34 $upd_query = 'INSERT INTO ' . PMA_Util::backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_Util::backquote($cfgRelation['table_info'])
35 . '(db_name, table_name, display_field) '
36 . ' VALUES('
37 . '\'' . PMA_Util::sqlAddSlashes($db) . '\','
38 . '\'' . PMA_Util::sqlAddSlashes($table) . '\','
39 . '\'' . PMA_Util::sqlAddSlashes($display_field) . '\')';
42 if (isset($upd_query)) {
43 $upd_rs = PMA_queryAsControlUser($upd_query);
45 } // end if
47 header("Content-Type: text/xml; charset=utf-8");
48 header("Cache-Control: no-cache");
49 die("<root act='save_pos' return='" . __('Modifications have been saved') . "'></root>");