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');
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;
15 require_once('./footer.inc.php');
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) {
44 case $GLOBALS['strExport']:
45 $submit_mult = 'row_export';
48 case $GLOBALS['strDelete']:
49 case $GLOBALS['strKill']:
50 $submit_mult = 'row_delete';
54 case $GLOBALS['strEdit']:
55 $submit_mult = 'row_edit';
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) {
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';
84 // Needed to allow SQL export
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';
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 . '&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:
138 $active_page = 'sql.php';
139 require('./sql.php');
142 * Displays the footer
144 require_once('./footer.inc.php');