Fix left frame reloading after dropping table (bug #1034531).
[phpmyadmin/crack.git] / tbl_row_delete.php
blob688c7717fdd053f39b14e85a02f702e6b982fdb4
1 <?php
2 /* $Id$ */
3 // vim: expandtab sw=4 ts=4 sts=4:
4 require_once('./libraries/grab_globals.lib.php');
5 require_once('./libraries/common.lib.php');
6 require_once('./libraries/mysql_charsets.lib.php');
8 /**
9 * No rows were selected => show again the query and tell that user.
11 if ((!isset($rows_to_delete) || !is_array($rows_to_delete)) && !isset($mult_btn)) {
12 $disp_message = $strNoRowsSelected;
13 $disp_query = '';
14 require('./sql.php');
15 require_once('./footer.inc.php');
18 /**
19 * Drop multiple rows if required
22 // workaround for IE problem:
23 if (isset($submit_mult_x)) {
24 $submit_mult = 'row_delete';
25 } elseif (isset($submit_mult_edit_x)) {
26 $submit_mult = 'row_edit';
27 } elseif (isset($submit_mult_export_x)) {
28 $submit_mult = 'row_export';
31 // garvin: If the 'Ask for confirmation' button was pressed, this can only come from 'delete' mode,
32 // so we set it straight away.
33 if (isset($mult_btn)) {
34 $submit_mult = 'row_delete';
37 switch($submit_mult) {
38 case 'row_delete':
39 case 'row_edit':
40 case 'row_export':
41 // leave as is
42 break;
44 case $GLOBALS['strExport']:
45 $submit_mult = 'row_export';
46 break;
48 case $GLOBALS['strDelete']:
49 case $GLOBALS['strKill']:
50 $submit_mult = 'row_delete';
51 break;
53 default:
54 case $GLOBALS['strEdit']:
55 $submit_mult = 'row_edit';
56 break;
59 if ($submit_mult == 'row_edit') {
60 $js_to_run = 'tbl_change.js';
63 if ($submit_mult == 'row_delete' || $submit_mult == 'row_export') {
64 $js_to_run = 'functions.js';
67 require_once('./header.inc.php');
69 if (!empty($submit_mult)) {
70 switch($submit_mult) {
71 case 'row_edit':
72 $primary_key = array();
73 // garvin: As we got the fields to be edited from the 'rows_to_delete' checkbox, we use the index of it as the
74 // indicating primary key. Then we built the array which is used for the tbl_change.php script.
75 foreach ($rows_to_delete AS $i_primary_key => $del_query) {
76 $primary_key[] = urldecode($i_primary_key);
79 $active_page = 'tbl_change.php';
80 include './tbl_change.php';
81 break;
83 case 'row_export':
84 // Needed to allow SQL export
85 $single_table = TRUE;
87 $primary_key = array();
88 $sql_query = urldecode($sql_query);
89 // garvin: As we got the fields to be edited from the 'rows_to_delete' checkbox, we use the index of it as the
90 // indicating primary key. Then we built the array which is used for the tbl_change.php script.
91 foreach ($rows_to_delete AS $i_primary_key => $del_query) {
92 $primary_key[] = urldecode($i_primary_key);
95 $active_page = 'tbl_properties_export.php';
96 include './tbl_properties_export.php';
97 break;
99 case 'row_delete':
100 default:
101 $action = 'tbl_row_delete.php';
102 $err_url = 'tbl_row_delete.php?' . PMA_generate_common_url($db, $table);
103 if (!isset($mult_btn)) {
104 $original_sql_query = $sql_query;
105 $original_url_query = $url_query;
106 $original_pos = $pos;
108 require('./mult_submits.inc.php');
109 $url_query = PMA_generate_common_url($db, $table)
110 . '&amp;goto=tbl_properties.php';
114 * Show result of multi submit operation
116 if (!empty($submit_mult) || isset($mult_btn)) {
117 $disp_message = $strSuccess;
118 $disp_query = $sql_query;
121 if (isset($original_sql_query)) {
122 $sql_query = urldecode($original_sql_query);
125 if (isset($original_url_query)) {
126 $url_query = $original_url_query;
129 if (isset($original_pos)) {
130 $pos = $original_pos;
133 // this is because sql.php could call tbl_properties_structure
134 // which would think it needs to call mult_submits.inc.php:
135 unset($submit_mult);
136 unset($mult_btn);
138 $active_page = 'sql.php';
139 require('./sql.php');
142 * Displays the footer
144 require_once('./footer.inc.php');
145 break;