Common strings for descriptions of DATE, TIME, DATETIME and VARCHAR2
[phpmyadmin.git] / pmd_save_pos.php
blob30871cb0e703fdd26f0db4c239dfae018caadf1a
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
5 * @package PhpMyAdmin-Designer
6 */
8 /**
11 require_once './libraries/common.inc.php';
12 require_once 'libraries/pmd_common.php';
14 $cfgRelation = PMA_getRelationsParam();
16 if (! $cfgRelation['designerwork']) {
17 PMD_err_sav();
20 /**
21 * Sets globals from $_POST
23 $post_params = array(
24 'IS_AJAX',
25 'die_save_pos',
26 'server',
27 't_h',
28 't_v',
29 't_x',
30 't_y'
33 foreach ($post_params as $one_post_param) {
34 if (isset($_POST[$one_post_param])) {
35 $GLOBALS[$one_post_param] = $_POST[$one_post_param];
39 foreach ($t_x as $key => $value) {
40 $KEY = empty($IS_AJAX) ? urldecode($key) : $key; // table name decode (post PDF exp/imp)
41 list($DB,$TAB) = explode(".", $KEY);
42 PMA_query_as_controluser(
43 'DELETE FROM ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($GLOBALS['cfgRelation']['designer_coords'])
44 . ' WHERE `db_name` = \'' . PMA_sqlAddSlashes($DB) . '\''
45 . ' AND `table_name` = \'' . PMA_sqlAddSlashes($TAB) . '\'',
46 true, PMA_DBI_QUERY_STORE
49 PMA_query_as_controluser(
50 'INSERT INTO ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($GLOBALS['cfgRelation']['designer_coords'])
51 . ' (db_name, table_name, x, y, v, h)'
52 . ' VALUES ('
53 . '\'' . PMA_sqlAddSlashes($DB) . '\', '
54 . '\'' . PMA_sqlAddSlashes($TAB) . '\', '
55 . '\'' . PMA_sqlAddSlashes($t_x[$key]) . '\', '
56 . '\'' . PMA_sqlAddSlashes($t_y[$key]) . '\', '
57 . '\'' . PMA_sqlAddSlashes($t_v[$key]) . '\', '
58 . '\'' . PMA_sqlAddSlashes($t_h[$key]) . '\')',
59 true, PMA_DBI_QUERY_STORE
62 //----------------------------------------------------------------------------
64 function PMD_err_sav()
66 global $die_save_pos; // if this file included
67 if (! empty($die_save_pos)) {
68 header("Content-Type: text/xml; charset=utf-8");
69 header("Cache-Control: no-cache");
70 die('<root act="save_pos" return="' . __('Error saving coordinates for Designer.') . '"></root>');
74 if (! empty($die_save_pos)) {
75 header("Content-Type: text/xml; charset=utf-8");
76 header("Cache-Control: no-cache");
78 <root act='save_pos' return='<?php echo __('Modifications have been saved'); ?>'></root>
79 <?php