bug #2891250 [ob] Garbled data in navi frame (PHP 5.2.11 bug)
[phpmyadmin/tyronm.git] / tbl_row_action.php
blobc2204a509da0ca8c8396c28388a0e7dd5ba46ab9
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * handle row specifc actions like edit, delete, export
6 * @version $Id$
7 * @package phpMyAdmin
8 */
11 /**
12 * do not globalize/import request variables
13 * can only be enabled if all included files are switched superglobals too
14 * but leave this here to show that this file is 'superglobalized'
15 define('PMA_NO_VARIABLES_IMPORT', true);
18 /**
21 require_once './libraries/common.inc.php';
22 require_once './libraries/mysql_charsets.lib.php';
24 /**
25 * No rows were selected => show again the query and tell that user.
27 if (! PMA_isValid($_REQUEST['rows_to_delete'], 'array')
28 && ! isset($_REQUEST['mult_btn'])) {
29 $disp_message = $strNoRowsSelected;
30 $disp_query = '';
31 require './sql.php';
32 require_once './libraries/footer.inc.php';
35 if (isset($_REQUEST['submit_mult'])) {
36 $submit_mult = $_REQUEST['submit_mult'];
37 // workaround for IE problem:
38 } elseif (isset($_REQUEST['submit_mult_delete_x'])) {
39 $submit_mult = 'row_delete';
40 } elseif (isset($_REQUEST['submit_mult_change_x'])) {
41 $submit_mult = 'row_edit';
42 } elseif (isset($_REQUEST['submit_mult_export_x'])) {
43 $submit_mult = 'row_export';
46 // garvin: If the 'Ask for confirmation' button was pressed, this can only come
47 // from 'delete' mode, so we set it straight away.
48 if (isset($_REQUEST['mult_btn'])) {
49 $submit_mult = 'row_delete';
52 switch($submit_mult) {
53 case 'row_delete':
54 case 'row_edit':
55 case 'row_export':
56 // leave as is
57 break;
59 case $GLOBALS['strExport']:
60 $submit_mult = 'row_export';
61 break;
63 case $GLOBALS['strDelete']:
64 case $GLOBALS['strKill']:
65 $submit_mult = 'row_delete';
66 break;
68 default:
69 case $GLOBALS['strEdit']:
70 $submit_mult = 'row_edit';
71 break;
74 $GLOBALS['js_include'][] = 'tbl_change.js';
75 $GLOBALS['js_include'][] = 'functions.js';
77 require_once './libraries/header.inc.php';
79 if (!empty($submit_mult)) {
80 switch($submit_mult) {
81 case 'row_edit':
82 // garvin: As we got the fields to be edited from the 'rows_to_delete'
83 // checkbox, we use the index of it as the
84 // indicating primary key. Then we built the array which is used for
85 // the tbl_change.php script.
86 $primary_key = array();
87 foreach ($_REQUEST['rows_to_delete'] as $i_primary_key => $del_query) {
88 $primary_key[] = urldecode($i_primary_key);
91 $active_page = 'tbl_change.php';
92 include './tbl_change.php';
93 break;
95 case 'row_export':
96 // Needed to allow SQL export
97 $single_table = TRUE;
99 //$sql_query = urldecode($sql_query);
100 // garvin: As we got the fields to be edited from the 'rows_to_delete'
101 // checkbox, we use the index of it as the
102 // indicating primary key. Then we built the array which is used for
103 // the tbl_change.php script.
104 $primary_key = array();
105 foreach ($_REQUEST['rows_to_delete'] as $i_primary_key => $del_query) {
106 $primary_key[] = urldecode($i_primary_key);
109 $active_page = 'tbl_export.php';
110 include './tbl_export.php';
111 break;
113 case 'row_delete':
114 default:
115 $action = 'tbl_row_action.php';
116 $err_url = 'tbl_row_action.php' . PMA_generate_common_url($GLOBALS['url_params']);
117 if (! isset($_REQUEST['mult_btn'])) {
118 $original_sql_query = $sql_query;
119 $original_url_query = $url_query;
121 require './libraries/mult_submits.inc.php';
122 $_url_params = $GLOBALS['url_params'];
123 $_url_params['goto'] = 'tbl_sql.php';
124 $url_query = PMA_generate_common_url($_url_params);
128 * Show result of multi submit operation
130 // sql_query is not set when user does not confirm multi-delete
131 if ((!empty($submit_mult) || isset($_REQUEST['mult_btn'])) && ! empty($sql_query)) {
132 $disp_message = $strSuccess;
133 $disp_query = $sql_query;
136 if (isset($original_sql_query)) {
137 $sql_query = $original_sql_query;
140 if (isset($original_url_query)) {
141 $url_query = $original_url_query;
144 // this is because sql.php could call tbl_structure
145 // which would think it needs to call mult_submits.inc.php:
146 unset($submit_mult, $_REQUEST['mult_btn']);
148 $active_page = 'sql.php';
149 require './sql.php';
152 * Displays the footer
154 require_once './libraries/footer.inc.php';
155 break;