Merge branch 'QA_3_4'
[phpmyadmin/madhuracj.git] / pmd_save_pos.php
blobac7d53366a890fa9eef72e5195859afde8097854
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
5 * @package phpMyAdmin-Designer
6 */
8 /**
11 require_once './libraries/pmd_common.php';
13 $cfgRelation = PMA_getRelationsParam();
15 if (! $cfgRelation['designerwork']) {
16 PMD_err_sav();
19 foreach ($t_x as $key => $value) {
20 $KEY = empty($IS_AJAX) ? urldecode($key) : $key; // table name decode (post PDF exp/imp)
21 list($DB,$TAB) = explode(".", $KEY);
22 PMA_query_as_controluser('DELETE FROM ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($GLOBALS['cfgRelation']['designer_coords']) . '
23 WHERE `db_name` = \'' . PMA_sqlAddSlashes($DB) . '\'
24 AND `table_name` = \'' . PMA_sqlAddSlashes($TAB) . '\'', true, PMA_DBI_QUERY_STORE);
26 PMA_query_as_controluser('INSERT INTO ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($GLOBALS['cfgRelation']['designer_coords']) . '
27 (db_name, table_name, x, y, v, h)
28 VALUES ('
29 . '\'' . PMA_sqlAddSlashes($DB) . '\', '
30 . '\'' . PMA_sqlAddSlashes($TAB) . '\', '
31 . '\'' . PMA_sqlAddSlashes($t_x[$key]) . '\', '
32 . '\'' . PMA_sqlAddSlashes($t_y[$key]) . '\', '
33 . '\'' . PMA_sqlAddSlashes($t_v[$key]) . '\', '
34 . '\'' . PMA_sqlAddSlashes($t_h[$key]) . '\''
35 . ')', true, PMA_DBI_QUERY_STORE);
37 //----------------------------------------------------------------------------
39 function PMD_err_sav()
41 global $die_save_pos; // if this file included
42 if (! empty($die_save_pos)) {
43 header("Content-Type: text/xml; charset=utf-8");
44 header("Cache-Control: no-cache");
45 die('<root act="save_pos" return="' . __('Error saving coordinates for Designer.') . '"></root>');
49 if (! empty($die_save_pos)) {
50 header("Content-Type: text/xml; charset=utf-8");
51 header("Cache-Control: no-cache");
53 <root act='save_pos' return='<?php echo __('Modifications have been saved'); ?>'></root>
54 <?php