From 53fd79880cc947e1c672e3e8ec230b0e03283fa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Chapeaux?= Date: Sun, 2 Sep 2001 22:29:33 +0000 Subject: [PATCH] added buttons to run multiple "DROP/DELETE/ALTER" statements --- db_details.php3 | 84 ++++++++++++++++++++++------ mult_drops.inc.php3 | 133 ++++++++++++++++++++++++++++++++++++++++++++ tbl_properties.php3 | 85 +++++++++++++++++++++------- 3 files changed, 267 insertions(+), 35 deletions(-) create mode 100644 mult_drops.inc.php3 diff --git a/db_details.php3 b/db_details.php3 index b6c4b22c2..ed49e137f 100755 --- a/db_details.php3 +++ b/db_details.php3 @@ -26,6 +26,15 @@ window.parent.frames['nav'].location.replace('./left.php3?lang== 32300 && isset($tbl_cache)) { +
+ + + + - + + @@ -118,8 +133,11 @@ else if (MYSQL_INT_VERSION >= 32300 && isset($tbl_cache)) { echo "\n"; ?> + - - + + + + + + +
  
+ + -   +     @@ -218,21 +236,34 @@ else if (MYSQL_INT_VERSION >= 32300 && isset($tbl_cache)) { list($sum_formated,$unit) = format_byte_down($sum_size,3,1); echo "\n"; ?> -
- - +
+    + - - + + - - + + - +
+ <?php echo $strWithChecked; ?> +    + +    + +
+ +
= 3.23 @@ -245,9 +276,15 @@ else { +
+ + + + - + + @@ -264,8 +301,11 @@ else { echo "\n"; ?> + + + +
  
+ + - +    @@ -294,7 +334,19 @@ else { } echo "\n"; ?> +
+ <?php echo $strWithChecked; ?> +    + +    + +
+ +
0) {
- - + + diff --git a/mult_drops.inc.php3 b/mult_drops.inc.php3 new file mode 100644 index 000000000..41b422dc6 --- /dev/null +++ b/mult_drops.inc.php3 @@ -0,0 +1,133 @@ +'; + break; + + case 'drop_tbl': + $full_query .= 'DROP TABLE ' + . backquote(htmlspecialchars(urldecode($selected[$i]))) + . ';
'; + break; + + case 'empty_tbl': + $full_query .= 'DELETE FROM ' + . backquote(htmlspecialchars(urldecode($selected[$i]))) + . ';
'; + break; + + case 'drop_fld': + $full_query .= 'ALTER TABLE ' + . backquote(htmlspecialchars($table)) + . ' DROP ' + . backquote(htmlspecialchars(urldecode($selected[$i]))) + . ';
'; + break; + } // end switch + } + + // Displays the form + echo $strDoYouReally . ' :
' . "\n"; + echo '' . $full_query . ' ?
' . "\n"; + ?> + + + + ' . "\n"; + } else if ($action == 'tbl_properties.php3') { + echo ' ' . "\n"; + echo ' ' . "\n"; + } + for ($i = 0; $i < $selected_cnt; $i++) { + echo ' ' . "\n"; + } + ?> + + + +
+ diff --git a/tbl_properties.php3 b/tbl_properties.php3 index 318055dda..f77e12eee 100755 --- a/tbl_properties.php3 +++ b/tbl_properties.php3 @@ -15,6 +15,15 @@ if (!isset($message)) { } +/** + * Drop/delete mutliple tables if required + */ +if (!empty($submit_mult) || isset($btnDrop)) { + $action = 'tbl_properties.php3'; + include('./mult_drops.inc.php3'); +} + + /** * Defines the query to be displayed in the query textarea */ @@ -177,22 +186,36 @@ $result = mysql_query($local_query) or mysql_die('', $local_query); + + 1) { + ?> +
+ + + + + + - + 1) { + echo ' ' . "\n"; +} +?> + - - + 1) { + ?> + + > - - + +// Drop button if there is at least two fields +if (mysql_num_rows($result) > 1) { + ?> + + +
  
+ +         @@ -288,16 +318,33 @@ while ($row = mysql_fetch_array($result)) {
+ <?php echo $strWithChecked; ?> +    + +
+ +
+ + +
@@ -582,11 +629,11 @@ echo "\n";
- - + +