Another Acknowledgements page update (fix for previous commit)
[openemr.git] / phpmyadmin / pmd_save_pos.php
blobe0b312e89f80969c402028f0a60848fa0fb50637
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
5 * @version $Id$
6 * @package phpMyAdmin-Designer
7 */
9 /**
12 include_once 'pmd_common.php';
13 require_once './libraries/relation.lib.php';
15 $alltab_rs = PMA_query_as_cu('SHOW TABLES FROM '.PMA_backquote($cfg['Server']['pmadb']),FALSE,PMA_DBI_QUERY_STORE) or PMD_err_sav();
17 $seen_pmd_table = false;
18 while ($tab_name = @PMA_DBI_fetch_row($alltab_rs)) {
19 if (stristr($tab_name[0],$GLOBALS['cfgRelation']['designer_coords'])) {
20 $seen_pmd_table = true;
21 break;
25 if (! $seen_pmd_table) {
26 PMD_err_sav();
29 foreach ($t_x as $key => $value) {
30 $KEY = empty($IS_AJAX) ? urldecode($key) : $key; // table name decode (post PDF exp/imp)
31 list($DB,$TAB) = explode(".", $KEY);
32 PMA_query_as_cu('DELETE FROM '.$GLOBALS['cfgRelation']['designer_coords'].'
33 WHERE `db_name` = \'' . PMA_sqlAddslashes($DB) . '\'
34 AND `table_name` = \'' . PMA_sqlAddslashes($TAB) . '\'', 1, PMA_DBI_QUERY_STORE);
36 PMA_query_as_cu('INSERT INTO '.$GLOBALS['cfgRelation']['designer_coords'].'
37 (db_name, table_name, x, y, v, h)
38 VALUES ('
39 . '\'' . PMA_sqlAddslashes($DB) . '\', '
40 . '\'' . PMA_sqlAddslashes($TAB) . '\', '
41 . '\'' . PMA_sqlAddslashes($t_x[$key]) . '\', '
42 . '\'' . PMA_sqlAddslashes($t_y[$key]) . '\', '
43 . '\'' . PMA_sqlAddslashes($t_v[$key]) . '\', '
44 . '\'' . PMA_sqlAddslashes($t_h[$key]) . '\''
45 . ')', 1 ,PMA_DBI_QUERY_STORE);
47 //----------------------------------------------------------------------------
49 function PMD_err_sav() {
50 global $die_save_pos; // if this file included
51 if (! empty($die_save_pos)) {
52 header("Content-Type: text/xml; charset=utf-8");
53 header("Cache-Control: no-cache");
54 die('<root act="save_pos" return="strErrorSaveTable"></root>');
58 if(! empty($die_save_pos)) {
59 header("Content-Type: text/xml; charset=utf-8");
60 header("Cache-Control: no-cache");
62 <root act='save_pos' return='<?php echo 'strModifications'; ?>'></root>
63 <?php