6 * Confirmation form if required or include of other scripts
8 if (!empty($submit_mult)
9 && (!empty($selected_db) ||
!empty($selected_tbl) ||
!empty($selected_fld))) {
11 if (get_magic_quotes_gpc()) {
12 $submit_mult = stripslashes($submit_mult);
14 if (!empty($selected_db)) {
15 $selected = $selected_db;
17 } else if (!empty($selected_tbl)) {
18 if ($submit_mult == $strPrintView) {
19 include('./tbl_printview.php3');
22 $selected = $selected_tbl;
23 switch ($submit_mult) {
30 case $strOptimizeTable:
31 $what = 'optimize_tbl';
36 $selected = $selected_fld;
37 if ($submit_mult == $strDrop) {
40 include('./tbl_alter.php3');
47 $selected_cnt = count($selected);
48 for ($i = 0; $i < $selected_cnt; $i++
) {
51 $full_query .= 'DROP DATABASE '
52 . PMA_backquote(htmlspecialchars(urldecode($selected[$i])))
57 $full_query .= (empty($full_query) ?
'DROP TABLE ' : ', ')
58 . PMA_backquote(htmlspecialchars(urldecode($selected[$i])))
59 . (($i == $selected_cnt - 1) ?
';<br />' : '');
63 $full_query .= (empty($full_query) ?
'OPTIMIZE TABLE ' : ', ')
64 . PMA_backquote(htmlspecialchars(urldecode($selected[$i])))
65 . (($i == $selected_cnt - 1) ?
';<br />' : '');
69 $full_query .= 'DELETE FROM '
70 . PMA_backquote(htmlspecialchars(urldecode($selected[$i])))
75 if ($full_query == '') {
76 $full_query .= 'ALTER TABLE '
77 . PMA_backquote(htmlspecialchars($table))
78 . '<br /> DROP '
79 . PMA_backquote(htmlspecialchars(urldecode($selected[$i])))
82 $full_query .= '<br /> DROP '
83 . PMA_backquote(htmlspecialchars(urldecode($selected[$i])))
86 if ($i == $selected_cnt-1) {
87 $full_query = ereg_replace(',$', ';<br />', $full_query);
94 echo $strDoYouReally . ' :<br />' . "\n";
95 echo '<tt>' . $full_query . '</tt> ?<br/>' . "\n";
97 <form action
="<?php echo $action; ?>" method
="post">
98 <input type
="hidden" name
="lang" value
="<?php echo $lang; ?>" />
99 <input type
="hidden" name
="server" value
="<?php echo $server; ?>" />
102 if ($action == 'db_details.php3') {
103 echo ' <input type="hidden" name="db" value="' . $db . '" />' . "\n";
104 } else if ($action == 'tbl_properties.php3') {
105 echo ' <input type="hidden" name="db" value="' . $db . '" />' . "\n";
106 echo ' <input type="hidden" name="table" value="' . $table . '" />' . "\n";
108 for ($i = 0; $i < $selected_cnt; $i++
) {
109 echo ' <input type="hidden" name="selected[]" value="' . $selected[$i] . '" />' . "\n";
112 <input type
="hidden" name
="query_type" value
="<?php echo $what; ?>" />
113 <input type
="submit" name
="mult_btn" value
="<?php echo $strYes; ?>" />
114 <input type
="submit" name
="mult_btn" value
="<?php echo $strNo; ?>" />
119 include('./footer.inc.php3');
126 else if ((get_magic_quotes_gpc() && stripslashes($mult_btn) == $strYes)
127 ||
$mult_btn == $strYes) {
130 $selected_cnt = count($selected);
131 for ($i = 0; $i < $selected_cnt; $i++
) {
132 switch ($query_type) {
134 $a_query = 'DROP DATABASE '
135 . PMA_backquote(urldecode($selected[$i]));
140 $sql_query .= (empty($sql_query) ?
'DROP TABLE ' : ', ')
141 . PMA_backquote(urldecode($selected[$i]))
142 . (($i == $selected_cnt-1) ?
';' : '');
147 $sql_query .= (empty($sql_query) ?
'OPTIMIZE TABLE ' : ', ')
148 . PMA_backquote(urldecode($selected[$i]))
149 . (($i == $selected_cnt-1) ?
';' : '');
153 $a_query = 'DELETE FROM '
154 . PMA_backquote(urldecode($selected[$i]));
158 $sql_query .= (empty($sql_query) ?
'ALTER TABLE ' . PMA_backquote($table) : ',')
159 . ' DROP ' . PMA_backquote(urldecode($selected[$i]))
160 . (($i == $selected_cnt-1) ?
';' : '');
164 // All "DROP TABLE","DROP FIELD" and "OPTIMIZE TABLE" statements will
165 // be run at once below
166 if ($query_type != 'drop_tbl'
167 && $query_type != 'drop_fld'
168 && $query_type != 'optimize_tbl') {
169 $sql_query .= $a_query . ';' . "\n";
171 if ($query_type != 'drop_db') {
172 mysql_select_db($db);
174 $result = @mysql_query
($a_query) or PMA_mysqlDie('', $a_query, FALSE, $err_url);
178 if ($query_type == 'drop_tbl'
179 ||
$query_type == 'drop_fld'
180 ||
$query_type == 'optimize_tbl') {
181 mysql_select_db($db);
182 $result = @mysql_query
($sql_query) or PMA_mysqlDie('', '', FALSE, $err_url);
185 PMA_showMessage($strSuccess);