2 /* vim: set expandtab sw=4 ts=4 sts=4: */
11 require_once './libraries/common.inc.php';
12 require_once './libraries/mysql_charsets.lib.php';
15 * Avoids undefined variables
22 * No rows were selected => show again the query and tell that user.
24 if ((!isset($rows_to_delete) ||
!is_array($rows_to_delete)) && !isset($mult_btn)) {
25 $disp_message = $strNoRowsSelected;
28 require_once './libraries/footer.inc.php';
32 * Drop multiple rows if required
35 // workaround for IE problem:
36 if (isset($submit_mult_delete_x)) {
37 $submit_mult = 'row_delete';
38 } elseif (isset($submit_mult_change_x)) {
39 $submit_mult = 'row_edit';
40 } elseif (isset($submit_mult_export_x)) {
41 $submit_mult = 'row_export';
44 // garvin: If the 'Ask for confirmation' button was pressed, this can only come from 'delete' mode,
45 // so we set it straight away.
46 if (isset($mult_btn)) {
47 $submit_mult = 'row_delete';
50 switch($submit_mult) {
57 case $GLOBALS['strExport']:
58 $submit_mult = 'row_export';
61 case $GLOBALS['strDelete']:
62 case $GLOBALS['strKill']:
63 $submit_mult = 'row_delete';
67 case $GLOBALS['strEdit']:
68 $submit_mult = 'row_edit';
72 if ($submit_mult == 'row_edit') {
73 $js_to_run = 'tbl_change.js';
76 if ($submit_mult == 'row_delete' ||
$submit_mult == 'row_export') {
77 $js_to_run = 'functions.js';
80 require_once './libraries/header.inc.php';
82 if (!empty($submit_mult)) {
83 switch($submit_mult) {
85 $primary_key = array();
86 // garvin: As we got the fields to be edited from the 'rows_to_delete' checkbox, we use the index of it as the
87 // indicating primary key. Then we built the array which is used for the tbl_change.php script.
88 foreach ($rows_to_delete AS $i_primary_key => $del_query) {
89 $primary_key[] = urldecode($i_primary_key);
92 $active_page = 'tbl_change.php';
93 include './tbl_change.php';
97 // Needed to allow SQL export
100 $primary_key = array();
101 //$sql_query = urldecode($sql_query);
102 // garvin: As we got the fields to be edited from the 'rows_to_delete' checkbox, we use the index of it as the
103 // indicating primary key. Then we built the array which is used for the tbl_change.php script.
104 foreach ($rows_to_delete AS $i_primary_key => $del_query) {
105 $primary_key[] = urldecode($i_primary_key);
108 $active_page = 'tbl_export.php';
109 include './tbl_export.php';
114 $action = 'tbl_row_action.php';
115 $err_url = 'tbl_row_action.php?' . PMA_generate_common_url($db, $table);
116 if (!isset($mult_btn)) {
117 $original_sql_query = $sql_query;
118 $original_url_query = $url_query;
119 $original_pos = $pos;
121 require './libraries/mult_submits.inc.php';
122 $url_query = PMA_generate_common_url($db, $table)
123 . '&goto=tbl_sql.php';
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($mult_btn)) && ! empty($sql_query)) {
131 $disp_message = $strSuccess;
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 if (isset($original_pos)) {
144 $pos = $original_pos;
147 // this is because sql.php could call tbl_structure
148 // which would think it needs to call mult_submits.inc.php:
152 $active_page = 'sql.php';
156 * Displays the footer
158 require_once './libraries/footer.inc.php';