Upgraded phpmyadmin to 4.0.4 (All Languages) - No modifications yet
[openemr.git] / phpmyadmin / pmd_save_pos.php
blobbb97f31e603e085bf3e61e8c4626d6957a14b94b
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 // table name decode (post PDF exp/imp)
41 $KEY = empty($IS_AJAX) ? urldecode($key) : $key;
42 list($DB,$TAB) = explode(".", $KEY);
43 PMA_queryAsControlUser(
44 'DELETE FROM ' . PMA_Util::backquote($GLOBALS['cfgRelation']['db'])
45 . '.' . PMA_Util::backquote($GLOBALS['cfgRelation']['designer_coords'])
46 . ' WHERE `db_name` = \'' . PMA_Util::sqlAddSlashes($DB) . '\''
47 . ' AND `table_name` = \'' . PMA_Util::sqlAddSlashes($TAB) . '\'',
48 true, PMA_DBI_QUERY_STORE
51 PMA_queryAsControlUser(
52 'INSERT INTO ' . PMA_Util::backquote($GLOBALS['cfgRelation']['db'])
53 . '.' . PMA_Util::backquote($GLOBALS['cfgRelation']['designer_coords'])
54 . ' (db_name, table_name, x, y, v, h)'
55 . ' VALUES ('
56 . '\'' . PMA_Util::sqlAddSlashes($DB) . '\', '
57 . '\'' . PMA_Util::sqlAddSlashes($TAB) . '\', '
58 . '\'' . PMA_Util::sqlAddSlashes($t_x[$key]) . '\', '
59 . '\'' . PMA_Util::sqlAddSlashes($t_y[$key]) . '\', '
60 . '\'' . PMA_Util::sqlAddSlashes($t_v[$key]) . '\', '
61 . '\'' . PMA_Util::sqlAddSlashes($t_h[$key]) . '\')',
62 true, PMA_DBI_QUERY_STORE
65 //----------------------------------------------------------------------------
67 function PMD_err_sav()
69 global $die_save_pos; // if this file included
70 if (! empty($die_save_pos)) {
71 header("Content-Type: text/xml; charset=utf-8");
72 header("Cache-Control: no-cache");
73 die('<root act="save_pos" return="' . __('Error saving coordinates for Designer.') . '"></root>');
77 if (! empty($die_save_pos)) {
78 header("Content-Type: text/xml; charset=utf-8");
79 header("Cache-Control: no-cache");
81 <root act='save_pos' return='<?php echo __('Modifications have been saved'); ?>'></root>
82 <?php