2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * handle row specifc actions like edit, delete, export
11 * do not globalize/import request variables
12 * can only be enabled if all included files are switched superglobals too
13 * but leave this here to show that this file is 'superglobalized'
14 define('PMA_NO_VARIABLES_IMPORT', true);
20 require_once './libraries/common.inc.php';
21 require_once './libraries/mysql_charsets.lib.php';
24 * No rows were selected => show again the query and tell that user.
26 if (! PMA_isValid($_REQUEST['rows_to_delete'], 'array')
27 && ! isset($_REQUEST['mult_btn'])) {
28 $disp_message = __('No rows selected');
31 require './libraries/footer.inc.php';
34 if (isset($_REQUEST['submit_mult'])) {
35 $submit_mult = $_REQUEST['submit_mult'];
36 // workaround for IE problem:
37 } elseif (isset($_REQUEST['submit_mult_delete_x'])) {
38 $submit_mult = 'row_delete';
39 } elseif (isset($_REQUEST['submit_mult_change_x'])) {
40 $submit_mult = 'row_edit';
41 } elseif (isset($_REQUEST['submit_mult_export_x'])) {
42 $submit_mult = 'row_export';
45 // If the 'Ask for confirmation' button was pressed, this can only come
46 // from 'delete' mode, so we set it straight away.
47 if (isset($_REQUEST['mult_btn'])) {
48 $submit_mult = 'row_delete';
51 switch($submit_mult) {
59 $submit_mult = 'row_export';
64 $submit_mult = 'row_delete';
69 $submit_mult = 'row_edit';
73 $GLOBALS['js_include'][] = 'tbl_change.js';
75 require_once './libraries/header.inc.php';
77 if (!empty($submit_mult)) {
78 switch($submit_mult) {
80 // As we got the fields to be edited from the
81 // 'rows_to_delete' checkbox, we use the index of it as the
82 // indicating WHERE clause. Then we build the array which is used
83 // for the tbl_change.php script.
84 $where_clause = array();
85 foreach ($_REQUEST['rows_to_delete'] as $i_where_clause => $del_query) {
86 $where_clause[] = urldecode($i_where_clause);
89 $active_page = 'tbl_change.php';
90 include './tbl_change.php';
94 // Needed to allow SQL export
97 // As we got the fields to be edited from the
98 // 'rows_to_delete' checkbox, we use the index of it as the
99 // indicating WHERE clause. Then we build the array which is used
100 // for the tbl_change.php script.
101 $where_clause = array();
102 foreach ($_REQUEST['rows_to_delete'] as $i_where_clause => $del_query) {
103 $where_clause[] = urldecode($i_where_clause);
106 $active_page = 'tbl_export.php';
107 include './tbl_export.php';
112 $action = 'tbl_row_action.php';
113 $err_url = 'tbl_row_action.php' . PMA_generate_common_url($GLOBALS['url_params']);
114 if (! isset($_REQUEST['mult_btn'])) {
115 $original_sql_query = $sql_query;
116 if (! empty($url_query)) {
117 $original_url_query = $url_query;
120 require './libraries/mult_submits.inc.php';
121 $_url_params = $GLOBALS['url_params'];
122 $_url_params['goto'] = 'tbl_sql.php';
123 $url_query = PMA_generate_common_url($_url_params);
127 * Show result of multi submit operation
129 // sql_query is not set when user does not confirm multi-delete
130 if ((!empty($submit_mult) ||
isset($_REQUEST['mult_btn'])) && ! empty($sql_query)) {
131 $disp_message = __('Your SQL query has been executed successfully');
132 $disp_query = $sql_query;
135 if (isset($original_sql_query)) {
136 $sql_query = $original_sql_query;
139 if (isset($original_url_query)) {
140 $url_query = $original_url_query;
143 // this is because sql.php could call tbl_structure
144 // which would think it needs to call mult_submits.inc.php:
145 unset($submit_mult, $_REQUEST['mult_btn']);
147 $active_page = 'sql.php';
151 * Displays the footer
153 require './libraries/footer.inc.php';