- added browser icon for each field (count unique values)

- removed styling
 - make use of global row highlighting/marking
 - display 'print table' and row stats for views
 - no actions for info_schema tables
This commit is contained in:
Sebastian Mendel
2005-10-27 08:14:08 +00:00
parent 4a91d35542
commit 41f8199ae9
2 changed files with 388 additions and 399 deletions

View File

@@ -12,6 +12,12 @@ $Source$
- preserve selected db - preserve selected db
- make use of PMA_DBI_select_db() - make use of PMA_DBI_select_db()
- documentation - documentation
* tbl_properties_structure.php:
- added browser icon for each field (count unique values)
- removed styling
- make use of global row highlighting/marking
- display 'print table' and row stats for views
- no actions for info_schema tables
2005-10-26 Marc Delisle <lem9@users.sourceforge.net> 2005-10-26 Marc Delisle <lem9@users.sourceforge.net>
* lang/french* updates * lang/french* updates

View File

@@ -94,35 +94,102 @@ $show_create_table = PMA_DBI_fetch_value(
0, 1 ); 0, 1 );
$analyzed_sql = PMA_SQP_analyze( PMA_SQP_parse( $show_create_table ) ); $analyzed_sql = PMA_SQP_analyze( PMA_SQP_parse( $show_create_table ) );
/**
* prepare table infos
*/
// action titles (image or string)
$titles = array();
if ( $cfg['PropertiesIconic'] == true ) {
if ( $cfg['PropertiesIconic'] === 'both' ) {
$iconic_spacer = '<div class="nowrap">';
} else {
$iconic_spacer = '';
}
// images replaced 2004-05-08 by mkkeck
$titles['Change'] = $iconic_spacer . '<img class="icon" width="16" height="16" src="' . $pmaThemeImage . 'b_edit.png" alt="' . $strChange . '" title="' . $strChange . '" />';
$titles['Drop'] = $iconic_spacer . '<img class="icon" width="16" height="16" src="' . $pmaThemeImage . 'b_drop.png" alt="' . $strDrop . '" title="' . $strDrop . '" />';
$titles['NoDrop'] = $iconic_spacer . '<img class="icon" width="16" height="16" src="' . $pmaThemeImage . 'b_drop.png" alt="' . $strDrop . '" title="' . $strDrop . '" />';
$titles['Primary'] = $iconic_spacer . '<img class="icon" width="16" height="16" src="' . $pmaThemeImage . 'b_primary.png" alt="' . $strPrimary . '" title="' . $strPrimary . '" />';
$titles['Index'] = $iconic_spacer . '<img class="icon" width="16" height="16" src="' . $pmaThemeImage . 'b_index.png" alt="' . $strIndex . '" title="' . $strIndex . '" />';
$titles['Unique'] = $iconic_spacer . '<img class="icon" width="16" height="16" src="' . $pmaThemeImage . 'b_unique.png" alt="' . $strUnique . '" title="' . $strUnique . '" />';
$titles['IdxFulltext'] = $iconic_spacer . '<img class="icon" width="16" height="16" src="' . $pmaThemeImage . 'b_ftext.png" alt="' . $strIdxFulltext . '" title="' . $strIdxFulltext . '" />';
$titles['NoPrimary'] = $iconic_spacer . '<img class="icon" width="16" height="16" src="' . $pmaThemeImage . 'bd_primary.png" alt="' . $strPrimary . '" title="' . $strPrimary . '" />';
$titles['NoIndex'] = $iconic_spacer . '<img class="icon" width="16" height="16" src="' . $pmaThemeImage . 'bd_index.png" alt="' . $strIndex . '" title="' . $strIndex . '" />';
$titles['NoUnique'] = $iconic_spacer . '<img class="icon" width="16" height="16" src="' . $pmaThemeImage . 'bd_unique.png" alt="' . $strUnique . '" title="' . $strUnique . '" />';
$titles['NoIdxFulltext'] = $iconic_spacer . '<img class="icon" width="16" height="16" src="' . $pmaThemeImage . 'bd_ftext.png" alt="' . $strIdxFulltext . '" title="' . $strIdxFulltext . '" />';
$titles['Browse'] = $iconic_spacer . '<img class="icon" width="16" height="16" src="' . $pmaThemeImage . 'b_browse.png" alt="' . $strBrowse . '" title="' . $strBrowse . '" />';
if ( $cfg['PropertiesIconic'] === 'both' ) {
$titles['Change'] .= $strChange . '</div>';
$titles['Drop'] .= $strDrop . '</div>';
$titles['NoDrop'] .= $strDrop . '</div>';
$titles['Primary'] .= $strPrimary . '</div>';
$titles['Index'] .= $strIndex . '</div>';
$titles['Unique'] .= $strUnique . '</div>';
$titles['IdxFulltext' ] .= $strIdxFulltext . '</div>';
$titles['NoPrimary'] .= $strPrimary . '</div>';
$titles['NoIndex'] .= $strIndex . '</div>';
$titles['NoUnique'] .= $strUnique . '</div>';
$titles['NoIdxFulltext'] .= $strIdxFulltext . '</div>';
$titles['Browse'] .= $strBrowse . '</div>';
}
} else {
$titles['Change'] = $strChange;
$titles['Drop'] = $strDrop;
$titles['NoDrop'] = $strDrop;
$titles['Primary'] = $strPrimary;
$titles['Index'] = $strIndex;
$titles['Unique'] = $strUnique;
$titles['IdxFulltext'] = $strIdxFulltext;
$titles['NoPrimary'] = $strPrimary;
$titles['NoIndex'] = $strIndex;
$titles['NoUnique'] = $strUnique;
$titles['NoIdxFulltext'] = $strIdxFulltext;
$titles['Browse'] = $strBrowse;
}
if ( PMA_MYSQL_INT_VERSION >= 50002 && $db === 'information_schema' ) {
$db_is_information_schema = true;
} else {
$db_is_information_schema = false;
}
/** /**
* Displays the table structure ('show table' works correct since 3.23.03) * Displays the table structure ('show table' works correct since 3.23.03)
*/ */
/* TABLE INFORMATION */
// table header
$i = 0; $i = 0;
?> ?>
<!-- TABLE INFORMATION -->
<form method="post" action="tbl_properties_structure.php" name="fieldsForm"> <form method="post" action="tbl_properties_structure.php" name="fieldsForm">
<?php echo PMA_generate_common_hidden_inputs($db, $table); ?> <?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
<table id="tablestructure"> <table id="tablestructure" class="data">
<thead> <thead>
<tr> <tr>
<?php echo $tbl_is_view ? '' : ' <th id="th' . ++$i . '">&nbsp;</th>' . "\n"; ?> <th id="th<?php echo ++$i; ?>"></th>
<th id="th<?php echo ++$i; ?>">&nbsp;<?php echo $strField; ?>&nbsp;</th> <th id="th<?php echo ++$i; ?>"><?php echo $strField; ?></th>
<th id="th<?php echo ++$i; ?>"><?php echo $strType; ?></th> <th id="th<?php echo ++$i; ?>"><?php echo $strType; ?></th>
<?php echo PMA_MYSQL_INT_VERSION >= 40100 ? ' <th id="th' . ++$i . '">' . $strCollation . '</th>' . "\n" : ''; ?> <?php echo PMA_MYSQL_INT_VERSION >= 40100 ? ' <th id="th' . ++$i . '">' . $strCollation . '</th>' . "\n" : ''; ?>
<th id="th<?php echo ++$i; ?>"><?php echo $strAttr; ?></th> <th id="th<?php echo ++$i; ?>"><?php echo $strAttr; ?></th>
<th id="th<?php echo ++$i; ?>"><?php echo $strNull; ?></th> <th id="th<?php echo ++$i; ?>"><?php echo $strNull; ?></th>
<th id="th<?php echo ++$i; ?>"><?php echo $strDefault; ?></th> <th id="th<?php echo ++$i; ?>"><?php echo $strDefault; ?></th>
<th id="th<?php echo ++$i; ?>"><?php echo $strExtra; ?></th> <th id="th<?php echo ++$i; ?>"><?php echo $strExtra; ?></th>
<?php echo $tbl_is_view ? '' : ' <th colspan="6" id="th' . ++$i . '">' . $strAction . '</th>' . "\n"; ?> <?php if ( $db_is_information_schema || $tbl_is_view ) { ?>
<th id="<?php echo ++$i; ?>"><?php echo $strView; ?></th>
<?php } else { ?>
<th colspan="7" id="<?php echo ++$i; ?>"><?php echo $strAction; ?></th>
<?php } ?>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php <?php
unset($i); unset($i);
// table body
// prepare comments
$comments_map = array(); $comments_map = array();
$mime_map = array(); $mime_map = array();
@@ -132,7 +199,6 @@ if ($GLOBALS['cfg']['ShowPropertyComments']) {
$cfgRelation = PMA_getRelationsParam(); $cfgRelation = PMA_getRelationsParam();
if ($cfgRelation['commwork']) { if ($cfgRelation['commwork']) {
$comments_map = PMA_getComments($db, $table); $comments_map = PMA_getComments($db, $table);
@@ -142,29 +208,16 @@ if ($GLOBALS['cfg']['ShowPropertyComments']) {
} }
} }
$i = 0; $rownum = 0;
$aryFields = array(); $aryFields = array();
$checked = (!empty($checkall) ? ' checked="checked"' : ''); $checked = (!empty($checkall) ? ' checked="checked"' : '');
$save_row = array(); $save_row = array();
$odd_row = true;
while ($row = PMA_DBI_fetch_assoc($fields_rs)) { while ($row = PMA_DBI_fetch_assoc($fields_rs)) {
$save_row[] = $row; $save_row[] = $row;
$i++; $rownum++;
$bgcolor = ($i % 2) ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo'];
$aryFields[] = $row['Field']; $aryFields[] = $row['Field'];
if ($GLOBALS['cfg']['BrowsePointerEnable'] == TRUE) {
$on_mouse = ' onmouseover="setPointer(this, ' . $i . ', \'over\', \'' . $bgcolor . '\', \'' . $GLOBALS['cfg']['BrowsePointerColor'] . '\', \'' . $GLOBALS['cfg']['BrowseMarkerColor'] . '\');"'
. ' onmouseout="setPointer(this, ' . $i . ', \'out\', \'' . $bgcolor . '\', \'' . $GLOBALS['cfg']['BrowsePointerColor'] . '\', \'' . $GLOBALS['cfg']['BrowseMarkerColor'] . '\');"';
} else {
$on_mouse = '';
}
if ($GLOBALS['cfg']['BrowseMarkerEnable'] == TRUE) {
$on_mouse .= ' onmousedown="setPointer(this, ' . $i . ', \'click\', \'' . $bgcolor . '\', \'' . $GLOBALS['cfg']['BrowsePointerColor'] . '\', \'' . $GLOBALS['cfg']['BrowseMarkerColor'] . '\');"';
}
$click_mouse = ' onmousedown="document.getElementById(\'checkbox_row_' . $i . '\').checked = (document.getElementById(\'checkbox_row_' . $i . '\').checked ? false : true);" ';
$type = $row['Type']; $type = $row['Type'];
// reformat mysql query output - staybyte - 9. June 2001 // reformat mysql query output - staybyte - 9. June 2001
// loic1: set or enum types: slashes single quotes inside options // loic1: set or enum types: slashes single quotes inside options
@@ -190,7 +243,7 @@ while ($row = PMA_DBI_fetch_assoc($fields_rs)) {
$type = preg_replace('@ZEROFILL@i', '', $type); $type = preg_replace('@ZEROFILL@i', '', $type);
$type = preg_replace('@UNSIGNED@i', '', $type); $type = preg_replace('@UNSIGNED@i', '', $type);
if (empty($type)) { if (empty($type)) {
$type = '&nbsp;'; $type = ' ';
} }
if (!preg_match('@BINARY[\(]@i', $row['Type'])) { if (!preg_match('@BINARY[\(]@i', $row['Type'])) {
@@ -235,7 +288,7 @@ while ($row = PMA_DBI_fetch_assoc($fields_rs)) {
$type_mime = ''; $type_mime = '';
} }
$attribute = '&nbsp;'; $attribute = ' ';
if ($binary) { if ($binary) {
$attribute = 'BINARY'; $attribute = 'BINARY';
} }
@@ -282,84 +335,28 @@ while ($row = PMA_DBI_fetch_assoc($fields_rs)) {
$field_name = '<u>' . $field_name . '</u>'; $field_name = '<u>' . $field_name . '</u>';
} }
echo "\n"; echo "\n";
$titles = array();
if ($cfg['PropertiesIconic'] == true) {
// We need to copy the value or else the == 'both' check will always return true
$propicon = (string)$cfg['PropertiesIconic'];
if ($propicon == 'both') {
$iconic_spacer = '<div class="nowrap">';
} else {
$iconic_spacer = '';
}
// images replaced 2004-05-08 by mkkeck
$titles['Change'] = $iconic_spacer . '<img hspace="2" width="16" height="16" src="' . $pmaThemeImage . 'b_edit.png" alt="' . $strChange . '" title="' . $strChange . '" border="0" />';
$titles['Drop'] = $iconic_spacer . '<img hspace="2" width="16" height="16" src="' . $pmaThemeImage . 'b_drop.png" alt="' . $strDrop . '" title="' . $strDrop . '" border="0" />';
$titles['NoDrop'] = $iconic_spacer . '<img hspace="2" width="16" height="16" src="' . $pmaThemeImage . 'b_drop.png" alt="' . $strDrop . '" title="' . $strDrop . '" border="0" />';
$titles['Primary'] = $iconic_spacer . '<img hspace="2" width="16" height="16" src="' . $pmaThemeImage . 'b_primary.png" alt="' . $strPrimary . '" title="' . $strPrimary . '" border="0" />';
$titles['Index'] = $iconic_spacer . '<img hspace="2" width="16" height="16" src="' . $pmaThemeImage . 'b_index.png" alt="' . $strIndex . '" title="' . $strIndex . '" border="0" />';
$titles['Unique'] = $iconic_spacer . '<img hspace="2" width="16" height="16" src="' . $pmaThemeImage . 'b_unique.png" alt="' . $strUnique . '" title="' . $strUnique . '" border="0" />';
$titles['IdxFulltext'] = $iconic_spacer . '<img hspace="2" width="16" height="16" src="' . $pmaThemeImage . 'b_ftext.png" alt="' . $strIdxFulltext . '" title="' . $strIdxFulltext . '" border="0" />';
$titles['NoPrimary'] = $iconic_spacer . '<img hspace="2" width="16" height="16" src="' . $pmaThemeImage . 'bd_primary.png" alt="' . $strPrimary . '" title="' . $strPrimary . '" border="0" />';
$titles['NoIndex'] = $iconic_spacer . '<img hspace="2" width="16" height="16" src="' . $pmaThemeImage . 'bd_index.png" alt="' . $strIndex . '" title="' . $strIndex . '" border="0" />';
$titles['NoUnique'] = $iconic_spacer . '<img hspace="2" width="16" height="16" src="' . $pmaThemeImage . 'bd_unique.png" alt="' . $strUnique . '" title="' . $strUnique . '" border="0" />';
$titles['NoIdxFulltext'] = $iconic_spacer . '<img hspace="2" width="16" height="16" src="' . $pmaThemeImage . 'bd_ftext.png" alt="' . $strIdxFulltext . '" title="' . $strIdxFulltext . '" border="0" />';
if ($propicon == 'both') {
$titles['Change'] .= '&nbsp;' . $strChange . '</div>';
$titles['Drop'] .= '&nbsp;' . $strDrop . '</div>';
$titles['NoDrop'] .= '&nbsp;' . $strDrop . '</div>';
$titles['Primary'] .= '&nbsp;' . $strPrimary . '</div>';
$titles['Index'] .= '&nbsp;' . $strIndex . '</div>';
$titles['Unique'] .= '&nbsp;' . $strUnique . '</div>';
$titles['IdxFulltext' ] .= '&nbsp;' . $strIdxFulltext . '</div>';
$titles['NoPrimary'] .= '&nbsp;' . $strPrimary . '</div>';
$titles['NoIndex'] .= '&nbsp;' . $strIndex . '</div>';
$titles['NoUnique'] .= '&nbsp;' . $strUnique . '</div>';
$titles['NoIdxFulltext'] .= '&nbsp;' . $strIdxFulltext . '</div>';
}
} else {
$titles['Change'] = $strChange;
$titles['Drop'] = $strDrop;
$titles['NoDrop'] = $strDrop;
$titles['Primary'] = $strPrimary;
$titles['Index'] = $strIndex;
$titles['Unique'] = $strUnique;
$titles['IdxFulltext'] = $strIdxFulltext;
$titles['NoPrimary'] = $strPrimary;
$titles['NoIndex'] = $strIndex;
$titles['NoUnique'] = $strUnique;
$titles['NoIdxFulltext'] = $strIdxFulltext;
}
?> ?>
<tr <?php echo $on_mouse; ?>> <tr class="<?php echo $odd_row ? 'odd': 'even'; $odd_row = !$odd_row; ?>">
<?php <td align="center">
if (!$tbl_is_view) { <input type="checkbox" name="selected_fld[]" value="<?php echo $field_encoded; ?>" id="checkbox_row_<?php echo $rownum; ?>" <?php echo $checked; ?> />
?>
<td align="center" bgcolor="<?php echo $bgcolor; ?>">
<input type="checkbox" name="selected_fld[]" value="<?php echo $field_encoded; ?>" id="checkbox_row_<?php echo $i; ?>" <?php echo $checked; ?> />
</td> </td>
<?php <th nowrap="nowrap"><label for="checkbox_row_<?php echo $rownum; ?>"><?php echo $field_name; ?></label></th>
} <td<?php echo $type_nowrap; ?>><?php echo $type; echo $type_mime; ?><bdo dir="ltr"></bdo></td>
?> <?php echo PMA_MYSQL_INT_VERSION >= 40100 ? ' <td>' . (empty($field_charset) ? '' : '<dfn title="' . PMA_getCollationDescr($field_charset) . '">' . $field_charset . '</dfn>') . '</td>' . "\n" : '' ?>
<td <?php echo $click_mouse; ?> bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap">&nbsp;<label onclick="return (document.getElementById('checkbox_row_<?php echo $i; ?>') ? false : true)" for="checkbox_row_<?php echo $i; ?>"><?php echo $field_name; ?></label>&nbsp;</td> <td nowrap="nowrap" style="font-size: <?php echo $font_smallest; ?>"><?php echo $attribute; ?></td>
<td <?php echo $click_mouse; ?> bgcolor="<?php echo $bgcolor; ?>"<?php echo $type_nowrap; ?>><?php echo $type; echo $type_mime; ?><bdo dir="ltr"></bdo></td> <td><?php echo (($row['Null'] == 'YES') ? $strYes : $strNo); ?></td>
<?php echo PMA_MYSQL_INT_VERSION >= 40100 ? ' <td bgcolor="' . $bgcolor . '" ' . $click_mouse . '>' . (empty($field_charset) ? '&nbsp;' : '<dfn title="' . PMA_getCollationDescr($field_charset) . '">' . $field_charset . '</dfn>') . '</td>' . "\n" : '' ?> <td nowrap="nowrap"><?php if (isset($row['Default'])) echo $row['Default']; ?></td>
<td <?php echo $click_mouse; ?> bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap" style="font-size: <?php echo $font_smallest; ?>"><?php echo $attribute; ?></td> <td nowrap="nowrap"><?php echo $row['Extra']; ?></td>
<td <?php echo $click_mouse; ?> bgcolor="<?php echo $bgcolor; ?>"><?php echo (($row['Null'] == 'YES') ? $strYes : $strNo); ?>&nbsp;</td> <td align="center">
<td <?php echo $click_mouse; ?> bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"><?php if (isset($row['Default'])) echo $row['Default']; ?>&nbsp;</td> <a href="sql.php?<?php echo $url_query; ?>&amp;sql_query=<?php echo urlencode( 'SELECT COUNT(*) AS `' . $strRows . '`, `' . $row['Field'] . '` FROM `' . $table . '` GROUP BY `' . $row['Field'] . '` ORDER BY `' . $row['Field'] . '`' ); ?>">
<td <?php echo $click_mouse; ?> bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"><?php echo $row['Extra']; ?>&nbsp;</td> <?php echo $titles['Browse']; ?></a>
<?php </td>
if (!$tbl_is_view) { <?php if ( ! $tbl_is_view && ! $db_is_information_schema ) { ?>
?> <td align="center">
<td align="center" bgcolor="<?php echo $bgcolor; ?>">
<a href="tbl_alter.php?<?php echo $url_query; ?>&amp;field=<?php echo $field_encoded; ?>"> <a href="tbl_alter.php?<?php echo $url_query; ?>&amp;field=<?php echo $field_encoded; ?>">
<?php echo $titles['Change']; ?></a> <?php echo $titles['Change']; ?></a>
</td> </td>
<td align="center" bgcolor="<?php echo $bgcolor; ?>"> <td align="center">
<?php <?php
// loic1: Drop field only if there is more than one field in the table // loic1: Drop field only if there is more than one field in the table
if ($fields_cnt > 1) { if ($fields_cnt > 1) {
@@ -375,7 +372,7 @@ while ($row = PMA_DBI_fetch_assoc($fields_rs)) {
echo "\n"; echo "\n";
?> ?>
</td> </td>
<td align="center" bgcolor="<?php echo $bgcolor; ?>"> <td align="center">
<?php <?php
if ($type == 'text' || $type == 'blob') { if ($type == 'text' || $type == 'blob') {
echo $titles['NoPrimary'] . "\n"; echo $titles['NoPrimary'] . "\n";
@@ -390,7 +387,7 @@ while ($row = PMA_DBI_fetch_assoc($fields_rs)) {
echo "\n"; echo "\n";
?> ?>
</td> </td>
<td align="center" bgcolor="<?php echo $bgcolor; ?>"> <td align="center">
<?php <?php
if ($type == 'text' || $type == 'blob') { if ($type == 'text' || $type == 'blob') {
echo $titles['NoIndex'] . "\n"; echo $titles['NoIndex'] . "\n";
@@ -404,7 +401,7 @@ while ($row = PMA_DBI_fetch_assoc($fields_rs)) {
echo "\n"; echo "\n";
?> ?>
</td> </td>
<td align="center" bgcolor="<?php echo $bgcolor; ?>"> <td align="center">
<?php <?php
if ($type == 'text' || $type == 'blob') { if ($type == 'text' || $type == 'blob') {
echo $titles['NoUnique'] . "\n"; echo $titles['NoUnique'] . "\n";
@@ -423,7 +420,7 @@ while ($row = PMA_DBI_fetch_assoc($fields_rs)) {
&& (strpos(' ' . $type, 'text') || strpos(' ' . $type, 'varchar'))) { && (strpos(' ' . $type, 'text') || strpos(' ' . $type, 'varchar'))) {
echo "\n"; echo "\n";
?> ?>
<td align="center" bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"> <td align="center" nowrap="nowrap">
<a href="sql.php?<?php echo $url_query; ?>&amp;sql_query=<?php echo urlencode('ALTER TABLE ' . PMA_backquote($table) . ' ADD FULLTEXT(' . PMA_backquote($row['Field']) . ')'); ?>&amp;zero_rows=<?php echo urlencode(sprintf($strAnIndex , htmlspecialchars($row['Field']))); ?>"> <a href="sql.php?<?php echo $url_query; ?>&amp;sql_query=<?php echo urlencode('ALTER TABLE ' . PMA_backquote($table) . ' ADD FULLTEXT(' . PMA_backquote($row['Field']) . ')'); ?>&amp;zero_rows=<?php echo urlencode(sprintf($strAnIndex , htmlspecialchars($row['Field']))); ?>">
<?php echo $titles['IdxFulltext']; ?></a> <?php echo $titles['IdxFulltext']; ?></a>
</td> </td>
@@ -431,13 +428,13 @@ while ($row = PMA_DBI_fetch_assoc($fields_rs)) {
} else { } else {
echo "\n"; echo "\n";
?> ?>
<td align="center" bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"> <td align="center" nowrap="nowrap">
<?php echo $titles['NoIdxFulltext'] . "\n"; ?> <?php echo $titles['NoIdxFulltext'] . "\n"; ?>
</td> </td>
<?php <?php
} // end if... else... } // end if... else...
echo "\n"; echo "\n";
} // end if (!$tbl_is_view) } // end if ( ! $tbl_is_view && ! $db_is_information_schema )
?> ?>
</tr> </tr>
<?php <?php
@@ -447,23 +444,29 @@ while ($row = PMA_DBI_fetch_assoc($fields_rs)) {
echo '</tbody>' . "\n" echo '</tbody>' . "\n"
.'</table>' . "\n"; .'</table>' . "\n";
if (!$tbl_is_view) {
$checkall_url = 'tbl_properties_structure.php?' . PMA_generate_common_url($db,$table); $checkall_url = 'tbl_properties_structure.php?' . PMA_generate_common_url($db,$table);
?> ?>
<img src="<?php echo $pmaThemeImage . 'arrow_' . $text_dir . '.png'; ?>" border="0" width="38" height="22" alt="<?php echo $strWithChecked; ?>" /> <img class="selectallarrow" src="<?php echo $pmaThemeImage . 'arrow_' . $text_dir . '.png'; ?>"
<a href="<?php echo $checkall_url; ?>&amp;checkall=1" onclick="setCheckboxes('fieldsForm', true); return false;"> width="38" height="22" alt="<?php echo $strWithChecked; ?>" />
<a href="<?php echo $checkall_url; ?>&amp;checkall=1"
onclick="setCheckboxes('fieldsForm', true); return false;">
<?php echo $strCheckAll; ?></a> <?php echo $strCheckAll; ?></a>
&nbsp;/&nbsp; /
<a href="<?php echo $checkall_url; ?>" onclick="setCheckboxes('fieldsForm', false); return false;"> <a href="<?php echo $checkall_url; ?>"
onclick="setCheckboxes('fieldsForm', false); return false;">
<?php echo $strUncheckAll; ?></a> <?php echo $strUncheckAll; ?></a>
&nbsp;&nbsp;&nbsp;
<i><?php echo $strWithChecked; ?></i>&nbsp;&nbsp;
<?php
<i><?php echo $strWithChecked; ?></i>
<?php
if ($cfg['PropertiesIconic']) { if ($cfg['PropertiesIconic']) {
PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_browse', $strBrowse, 'b_browse.png'); PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_browse', $strBrowse, 'b_browse.png');
} else {
echo '<input type="submit" name="submit_mult" value="' . $strChange . '" title="' . $strChange . '" />' . "\n";
}
if ( ! $tbl_is_view && ! $db_is_information_schema ) {
if ($cfg['PropertiesIconic']) {
PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_change', $strChange, 'b_edit.png'); PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_change', $strChange, 'b_edit.png');
// Drop button if there is at least two fields // Drop button if there is at least two fields
if ($fields_cnt > 1) { if ($fields_cnt > 1) {
@@ -476,77 +479,69 @@ if (!$tbl_is_view) {
PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_fulltext', $strIdxFulltext, 'b_ftext.png'); PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_fulltext', $strIdxFulltext, 'b_ftext.png');
} }
} else { } else {
echo '<input type="submit" name="submit_mult" value="' . $strChange . '" title="' . $strChange . '" />' . "\n";
// Drop button if there is at least two fields // Drop button if there is at least two fields
if ($fields_cnt > 1) { if ($fields_cnt > 1) {
echo '&nbsp;<i>' . $strOr . '</i>&nbsp;' . "\n" echo '<i>' . $strOr . '</i>' . "\n"
. '<input type="submit" name="submit_mult" value="' . $strDrop . '" title="' . $strDrop . '" />' . "\n"; . '<input type="submit" name="submit_mult" value="' . $strDrop . '" title="' . $strDrop . '" />' . "\n";
} }
echo '&nbsp;<i>' . $strOr . '</i>&nbsp;' . "\n" echo '<i>' . $strOr . '</i>' . "\n"
. '<input type="submit" name="submit_mult" value="' . $strPrimary . '" title="' . $strPrimary . '" />' . "\n"; . '<input type="submit" name="submit_mult" value="' . $strPrimary . '" title="' . $strPrimary . '" />' . "\n";
echo '&nbsp;<i>' . $strOr . '</i>&nbsp;' . "\n" echo '<i>' . $strOr . '</i>' . "\n"
. '<input type="submit" name="submit_mult" value="' . $strIndex . '" title="' . $strIndex . '" />' . "\n"; . '<input type="submit" name="submit_mult" value="' . $strIndex . '" title="' . $strIndex . '" />' . "\n";
echo '&nbsp;<i>' . $strOr . '</i>&nbsp;' . "\n" echo '<i>' . $strOr . '</i>' . "\n"
. '<input type="submit" name="submit_mult" value="' . $strUnique . '" title="' . $strUnique . '" />' . "\n"; . '<input type="submit" name="submit_mult" value="' . $strUnique . '" title="' . $strUnique . '" />' . "\n";
if ((!empty($tbl_type) && $tbl_type == 'MYISAM')) { if ((!empty($tbl_type) && $tbl_type == 'MYISAM')) {
echo '&nbsp;<i>' . $strOr . '</i>&nbsp;' . "\n" echo '<i>' . $strOr . '</i>' . "\n"
. '<input type="submit" name="submit_mult" value="' . $strIdxFulltext . '" title="' . $strIdxFulltext . '" />' . "\n"; . '<input type="submit" name="submit_mult" value="' . $strIdxFulltext . '" title="' . $strIdxFulltext . '" />' . "\n";
} }
} }
} }
?> ?>
</form> </form>
<hr /> <hr />
<?php <?php
if (!$tbl_is_view) {
/** /**
* Work on the table * Work on the table
*/ */
?> ?>
<!-- TABLE WORK -->
<!-- Printable view of the table -->
<a href="tbl_printview.php?<?php echo $url_query; ?>"><?php <a href="tbl_printview.php?<?php echo $url_query; ?>"><?php
if ($cfg['PropertiesIconic']) { if ($cfg['PropertiesIconic']) {
echo '<img src="' . $pmaThemeImage . 'b_print.png" border="0" hspace="2" align="middle" width="16" height="16" alt="' . $strPrintView . '"/>'; echo '<img class="icon" src="' . $pmaThemeImage . 'b_print.png" width="16" height="16" alt="' . $strPrintView . '"/>';
} }
echo $strPrintView; echo $strPrintView;
?></a>&nbsp;&nbsp;&nbsp; ?></a>
<?php <?php
if ( ! $tbl_is_view && ! $db_is_information_schema ) {
// if internal relations are available, or the table type is INNODB // if internal relations are available, or the table type is INNODB
// ($tbl_type comes from tbl_properties_table_info.php) // ($tbl_type comes from tbl_properties_table_info.php)
if ($cfg['Server']['relation'] || $tbl_type=="INNODB") { if ($cfg['Server']['relation'] || $tbl_type=="INNODB") {
?> ?>
<!-- Work on Relations -->
<a href="tbl_relation.php?<?php echo $url_query; ?>"><?php <a href="tbl_relation.php?<?php echo $url_query; ?>"><?php
if ($cfg['PropertiesIconic']) { if ($cfg['PropertiesIconic']) {
echo '<img src="' . $pmaThemeImage . 'b_relations.png" border="0" hspace="2" align="middle" width="16" height="16" alt="' . $strRelationView . '"/>'; echo '<img class="icon" src="' . $pmaThemeImage . 'b_relations.png" width="16" height="16" alt="' . $strRelationView . '"/>';
} }
echo $strRelationView; echo $strRelationView;
?></a>&nbsp;&nbsp;&nbsp; ?></a>
<?php <?php
} }
?> ?>
<!-- Let MySQL propose the optimal structure -->
<a href="sql.php?<?php echo $url_query; ?>&amp;session_max_rows=all&amp;sql_query=<?php echo urlencode('SELECT * FROM ' . PMA_backquote($table) . ' PROCEDURE ANALYSE()'); ?>"><?php <a href="sql.php?<?php echo $url_query; ?>&amp;session_max_rows=all&amp;sql_query=<?php echo urlencode('SELECT * FROM ' . PMA_backquote($table) . ' PROCEDURE ANALYSE()'); ?>"><?php
if ($cfg['PropertiesIconic']) { if ($cfg['PropertiesIconic']) {
echo '<img src="' . $pmaThemeImage . 'b_tblanalyse.png" border="0" hspace="2" align="middle" width="16" height="16" alt="' . $strStructPropose . '" />'; echo '<img class="icon" src="' . $pmaThemeImage . 'b_tblanalyse.png" width="16" height="16" alt="' . $strStructPropose . '" />';
} }
echo $strStructPropose; echo $strStructPropose;
?></a><?php ?></a><?php
echo PMA_showMySQLDocu('Extending_MySQL', 'procedure_analyse') . "\n"; echo PMA_showMySQLDocu('Extending_MySQL', 'procedure_analyse') . "\n";
?><br /> ?><br />
<!-- Add some new fields -->
<form method="post" action="tbl_addfield.php" <form method="post" action="tbl_addfield.php"
onsubmit="return checkFormElementInRange(this, 'num_fields', '<?php echo str_replace('\'', '\\\'', $GLOBALS['strInvalidFieldAddCount']); ?>', 1)"> onsubmit="return checkFormElementInRange(this, 'num_fields', '<?php echo str_replace('\'', '\\\'', $GLOBALS['strInvalidFieldAddCount']); ?>', 1)">
<?php <?php
echo PMA_generate_common_hidden_inputs($db, $table); echo PMA_generate_common_hidden_inputs($db, $table);
if ($cfg['PropertiesIconic']) { if ($cfg['PropertiesIconic']) {
echo '<img src="' . $pmaThemeImage . 'b_insrow.png" width="16" height="16" border="0" hspace="2" align="middle" alt="' . $strAddNewField . '"/>'; echo '<img class="icon" src="' . $pmaThemeImage . 'b_insrow.png" width="16" height="16" alt="' . $strAddNewField . '"/>';
} }
echo sprintf($strAddFields, '<input type="text" name="num_fields" size="2" maxlength="2" value="1" style="vertical-align: middle" onfocus="this.select()" />'); echo sprintf($strAddFields, '<input type="text" name="num_fields" size="2" maxlength="2" value="1" style="vertical-align: middle" onfocus="this.select()" />');
?> ?>
@@ -563,9 +558,7 @@ if (!$tbl_is_view) {
?> ?>
<input type="submit" value="<?php echo $strGo; ?>" style="vertical-align: middle" /> <input type="submit" value="<?php echo $strGo; ?>" style="vertical-align: middle" />
</form> </form>
<hr /> <hr />
<?php <?php
} }
@@ -574,26 +567,18 @@ if (!$tbl_is_view) {
* links again * links again
*/ */
if ($fields_cnt > 20) { if ($fields_cnt > 20) {
?>
<!-- Browse links -->
<?php
echo "\n";
require('./tbl_properties_links.php'); require('./tbl_properties_links.php');
} // end if ($fields_cnt > 20) } // end if ($fields_cnt > 20)
echo "\n\n"; echo "\n\n";
// show table statistics only if
// this is not a view and not the information_schema (MySQL >= 5.00.02)
if ( ! $tbl_is_view
&& ( $db != 'information_schema'
|| PMA_MYSQL_INT_VERSION < 50002 ) ) {
/** /**
* Displays indexes * Displays indexes
*/ */
echo '<div id="tablestatistics">' . "\n"; echo '<div id="tablestatistics">' . "\n";
if ( ! $tbl_is_view && ! $db_is_information_schema ) {
define('PMA_IDX_INCLUDED', 1); define('PMA_IDX_INCLUDED', 1);
require ('./tbl_indexes.php'); require ('./tbl_indexes.php');
}
/** /**
* Displays Space usage and row statistics * Displays Space usage and row statistics
*/ */
@@ -607,7 +592,7 @@ if ( ! $tbl_is_view
if (isset($showtable['Type']) && !preg_match('@ISAM|HEAP@i', $showtable['Type'])) { if (isset($showtable['Type']) && !preg_match('@ISAM|HEAP@i', $showtable['Type'])) {
$nonisam = TRUE; $nonisam = TRUE;
} }
if ($nonisam == FALSE || $is_innodb) {
// Gets some sizes // Gets some sizes
$mergetable = FALSE; $mergetable = FALSE;
if (isset($showtable['Type']) && $showtable['Type'] == 'MRG_MyISAM') { if (isset($showtable['Type']) && $showtable['Type'] == 'MRG_MyISAM') {
@@ -632,8 +617,8 @@ if ( ! $tbl_is_view
$odd_row = false; $odd_row = false;
?> ?>
<!-- Space usage -->
<a name="showusage"></a> <a name="showusage"></a>
<?php if ( ! $tbl_is_view && ! $db_is_information_schema ) { ?>
<table id="tablespaceusage" class="data"> <table id="tablespaceusage" class="data">
<caption class="tblHeaders"><?php echo $strSpaceUsage; ?></caption> <caption class="tblHeaders"><?php echo $strSpaceUsage; ?></caption>
<thead> <thead>
@@ -688,7 +673,7 @@ if ( ! $tbl_is_view
<td colspan="3" align="center"> <td colspan="3" align="center">
<a href="sql.php?<?php echo $url_query; ?>&pos=0&amp;sql_query=<?php echo urlencode('OPTIMIZE TABLE ' . PMA_backquote($table)); ?>"><?php <a href="sql.php?<?php echo $url_query; ?>&pos=0&amp;sql_query=<?php echo urlencode('OPTIMIZE TABLE ' . PMA_backquote($table)); ?>"><?php
if ($cfg['PropertiesIconic']) { if ($cfg['PropertiesIconic']) {
echo '<img src="' . $pmaThemeImage . 'b_tbloptimize.png" width="16" height="16" border="0" hspace="2" align="middle" alt="' . $strOptimizeTable. '" />'; echo '<img class="icon" src="' . $pmaThemeImage . 'b_tbloptimize.png" width="16" height="16" alt="' . $strOptimizeTable. '" />';
} }
echo $strOptimizeTable; echo $strOptimizeTable;
?></a> ?></a>
@@ -699,8 +684,8 @@ if ( ! $tbl_is_view
?> ?>
</tbody> </tbody>
</table> </table>
<?php <?php
}
$odd_row = false; $odd_row = false;
?> ?>
<table id="tablerowstats" class="data"> <table id="tablerowstats" class="data">
@@ -802,11 +787,9 @@ if ( ! $tbl_is_view
</table> </table>
<?php <?php
} }
}
// END - Calc Table Space // END - Calc Table Space
echo '<div class="clearfloat"></div>' . "\n"; echo '<div class="clearfloat"></div>' . "\n";
echo '</div>' . "\n"; echo '</div>' . "\n";
} // end if (!$tbl_is_view)
/** /**
* Displays the footer * Displays the footer