From 947de9c9ee2c3bdf47e9ef99d278b42605908075 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Wed, 17 Jul 2002 17:42:56 +0000 Subject: [PATCH] distinct query box logic --- ChangeLog | 2 + tbl_properties.php3 | 143 ++------------------------------- tbl_properties_structure.php3 | 8 ++ tbl_query_box.php3 | 144 ++++++++++++++++++++++++++++++++++ 4 files changed, 160 insertions(+), 137 deletions(-) create mode 100755 tbl_query_box.php3 diff --git a/ChangeLog b/ChangeLog index fc9a494b4..112852f31 100755 --- a/ChangeLog +++ b/ChangeLog @@ -18,6 +18,8 @@ $Source$ * chk_rel.php3, db_details_structure.php3, Documentation.html, pdf_pages.php3, pdf_shema.php3, libraries/select_lang.lib.php3: commits for Loic + * tbl_properties.php3, tbl_properties_structure.php3, + new tbl_query_box.php3: query box at the bottom of the structure page 2002-07-17 Alexander M. Turek * libraries/common.lib.php3, libraries/config_import.lib.php3: Added diff --git a/tbl_properties.php3 b/tbl_properties.php3 index 62bd01ffe..936cb2bee 100755 --- a/tbl_properties.php3 +++ b/tbl_properties.php3 @@ -14,152 +14,21 @@ $url_query .= '&back=tbl_properties.php3'; */ require('./tbl_properties_table_info.php3'); -/** - * Defines the query to be displayed in the query textarea - */ -if (isset($show_query) && $show_query == 'y') { - // This script has been called by read_dump.php3 - if (isset($sql_query_cpy)) { - $query_to_display = $sql_query_cpy; - } - // Other cases - else if (get_magic_quotes_gpc()) { - $query_to_display = stripslashes($sql_query); - } - else { - $query_to_display = $sql_query; - } -} else { - $query_to_display = ''; -} -unset($sql_query); - - -/** - * Get the list and number of fields - */ -$local_query = 'SHOW FIELDS FROM ' . PMA_backquote($db) . '.' . PMA_backquote($table); -$result = @PMA_mysql_query($local_query); -if (!$result) { - PMA_mysqlDie('', $local_query, '', $err_url); -} -else { - $fields_cnt = mysql_num_rows($result); - while ($row = PMA_mysql_fetch_array($result)) { - $fields_list[] = $row['Field']; - } // end while - mysql_free_result($result); -} - - -/** - * Work on the table - */ -// loic1: defines wether file upload is available or not -// lem9: we should check if PHP 4.0.0 really implements the "file_uploads" -// variable, because I got a support request and his 4.0.0 did not have it - -$is_upload = (PMA_PHP_INT_VERSION >= 40000 && function_exists('ini_get')) - ? ((strtolower(ini_get('file_uploads')) == 'on' || ini_get('file_uploads') == 1) && intval(ini_get('upload_max_filesize'))) - // loic1: php 3.0.15 and lower bug -> always enabled - : (PMA_PHP_INT_VERSION < 30016 || intval(@get_cfg_var('upload_max_filesize'))); - ?> - - + diff --git a/tbl_query_box.php3 b/tbl_query_box.php3 new file mode 100755 index 000000000..8cf49b018 --- /dev/null +++ b/tbl_query_box.php3 @@ -0,0 +1,144 @@ += 40000 && function_exists('ini_get')) + ? ((strtolower(ini_get('file_uploads')) == 'on' || ini_get('file_uploads') == 1) && intval(ini_get('upload_max_filesize'))) + // loic1: php 3.0.15 and lower bug -> always enabled + : (PMA_PHP_INT_VERSION < 30016 || intval(@get_cfg_var('upload_max_filesize'))); + +?> + + + + +
  • +
    + onsubmit="return checkSqlQuery(this)" name="sqlform"> + + + + + + + + + + + + + +
    +
    +
    +   +
    +
    +' . $strOr . ' ' . $strLocationTextfile . ' :
    ' . "\n"; + ?> +
    +
    +
    + 0) { + echo " $strOr $strBookmarkQuery :
    \n"; + echo '
    ' . "\n"; + echo ' ' . "\n"; + echo ' ' . "\n"; + echo '  ' . "\n"; + echo '  ' . "\n"; + echo '
    ' . "\n"; + echo '
    ' . "\n"; + } +} +?> + +
    +
  • + + + +
  • +
    +
  • +