From 2ac7b84a3300e7cd707a071612c46783d236c49b Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Wed, 1 May 2002 10:34:40 +0000 Subject: [PATCH] Structure --- ChangeLog | 6 + tbl_properties.php3 | 476 +------------------------------------- tbl_properties_links.php3 | 8 +- 3 files changed, 16 insertions(+), 474 deletions(-) diff --git a/ChangeLog b/ChangeLog index 50198b6f1..35f67835a 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,12 @@ phpMyAdmin - Changelog $Id$ $Source$ +2002-05-01 Marc Delisle + * tbl_properties.php3, tbl_properties_links.php3, + new tbl_properties_structure, lang/*.php3: Structure page + (todo: - stay on the sub-pages as long as needed + - "Add field" dialog belongs to Structure page) + 2002-05-01 Loïc Chapeaux * tbl_properties.php3; tbl_properties_table_info.php3: comments. * tbl_properties_options.php3: added labels and beautified display. diff --git a/tbl_properties.php3 b/tbl_properties.php3 index b39d9c737..8e0d7db0a 100755 --- a/tbl_properties.php3 +++ b/tbl_properties.php3 @@ -68,473 +68,6 @@ if (isset($submitoptions)) { $result = mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url); } - -/** - * Prepares the table structure display - */ -// 1. Get table information -require('./tbl_properties_table_info.php3'); - -// 2. Gets table keys and retains them -$local_query = 'SHOW KEYS FROM ' . PMA_backquote($table); -$result = mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0); -$primary = ''; -$ret_keys = array(); -$pk_array = array(); // will be use to emphasis prim. keys in the table view -while ($row = mysql_fetch_array($result)) { - $ret_keys[] = $row; - // Backups the list of primary keys - if ($row['Key_name'] == 'PRIMARY') { - $primary .= $row['Column_name'] . ', '; - $pk_array[$row['Column_name']] = 1; - } -} // end while -mysql_free_result($result); - -// 3. Get fields -$local_query = 'SHOW FIELDS FROM ' . PMA_backquote($table); -$fields_rs = mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0); -$fields_cnt = mysql_num_rows($fields_rs); - - - -/** - * Displays the table structure ('show table' works correct since 3.23.03) - */ -?> - - - -
- - - - - - - - - - - - - - - - - -NULL'; - } - } else { - $row['Default'] = htmlspecialchars($row['Default']); - } - - $field_encoded = urlencode($row['Field']); - $field_name = htmlspecialchars($row['Field']); - if (isset($pk_array[$row['Field']])) { - $field_name = '' . $field_name . ''; - } - echo "\n"; - - ?> - - - - - - - - - - - - - - = 32323) { - if ((!empty($tbl_type) && $tbl_type == 'MYISAM') - && ($type == 'text' || strpos(' ' . $type, 'varchar'))) { - echo "\n"; - ?> - - - - - - - - - - -
  
- -   >    - - - - 1) { - echo "\n"; - ?> - - - - - - - - - - - - - - - - - - - - - - - -
- <?php echo $strWithChecked; ?> -    - - 1) { - ?> -    - - -
- -
- - - 20) { - ?> - - 20) -echo "\n\n"; - - -/** - * Displays indexes - */ -?> - -
- - - - - to get valid -// statistics whatever is the table type -if ($cfg['ShowStats']) { - $nonisam = FALSE; - $is_innodb = ($showtable['Type'] == 'InnoDB'); - if (isset($showtable['Type']) && !eregi('ISAM|HEAP', $showtable['Type'])) { - $nonisam = TRUE; - } - if (PMA_MYSQL_INT_VERSION >= 32303 && ($nonisam == FALSE || $is_innodb)) { - // Gets some sizes - $mergetable = FALSE; - if (isset($showtable['Type']) && $showtable['Type'] == 'MRG_MyISAM') { - $mergetable = TRUE; - } - list($data_size, $data_unit) = PMA_formatByteDown($showtable['Data_length']); - if ($mergetable == FALSE) { - list($index_size, $index_unit) = PMA_formatByteDown($showtable['Index_length']); - } - if (isset($showtable['Data_free']) && $showtable['Data_free'] > 0) { - list($free_size, $free_unit) = PMA_formatByteDown($showtable['Data_free']); - list($effect_size, $effect_unit) = PMA_formatByteDown($showtable['Data_length'] + $showtable['Index_length'] - $showtable['Data_free']); - } else { - list($effect_size, $effect_unit) = PMA_formatByteDown($showtable['Data_length'] + $showtable['Index_length']); - } - list($tot_size, $tot_unit) = PMA_formatByteDown($showtable['Data_length'] + $showtable['Index_length']); - if ($num_rows > 0) { - list($avg_size, $avg_unit) = PMA_formatByteDown(($showtable['Data_length'] + $showtable['Index_length']) / $showtable['Rows'], 6, 1); - } - - // Displays them - ?> - - - - - - - - - - -
- -   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- [] -
-
  - - - - - - - - - - - - - - - - - 0) { - $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']); - echo "\n"; - ?> - - - - - 0 && $mergetable == FALSE) { - $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']); - echo "\n"; - ?> - - - - - - - - - - -
- -
- -
 ø - -
 ø - -
 Autoindex - -
-
-
- - - -= 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'))); + +require('./tbl_properties_table_info.php3'); + ?>