This commit is contained in:
Alexander M. Turek
2005-01-12 10:07:13 +00:00
parent 865e6211d9
commit a47d428faf
3 changed files with 230 additions and 197 deletions

View File

@@ -5,6 +5,11 @@ phpMyAdmin - Changelog
$Id$ $Id$
$Source$ $Source$
2005-01-12 Alexander M. Turek <me@derrabus.de>
* tbl_properties_table_info.inc.php: Basic view detection.
* tbl_properties_structure.php: Disabled table-specific interface elements
for views.
2005-01-11 Alexander M. Turek <me@derrabus.de> 2005-01-11 Alexander M. Turek <me@derrabus.de>
* libraries/relation.lib.php: * libraries/relation.lib.php:
- Removed redundant code; - Removed redundant code;

View File

@@ -95,7 +95,7 @@ $i = 0;
<?php echo PMA_generate_common_hidden_inputs($db, $table); ?> <?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
<table border="<?php echo $cfg['Border']; ?>" cellpadding="2" cellspacing="1"> <table border="<?php echo $cfg['Border']; ?>" cellpadding="2" cellspacing="1">
<tr> <tr>
<th id="th<?php echo ++$i; ?>">&nbsp;</th> <?php echo $tbl_is_view ? '' : ' <th id="th' . ++$i . '">&nbsp;</th>' . "\n"; ?>
<th id="th<?php echo ++$i; ?>">&nbsp;<?php echo $strField; ?>&nbsp;</th> <th id="th<?php echo ++$i; ?>">&nbsp;<?php echo $strField; ?>&nbsp;</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" : ''; ?>
@@ -103,7 +103,7 @@ $i = 0;
<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>
<th colspan="6" id="th<?php echo ++$i; ?>"><?php echo $strAction; ?></th> <?php echo $tbl_is_view ? '' : ' <th colspan="6" id="th' . ++$i . '">' . $strAction . '</th>' . "\n"; ?>
</tr> </tr>
<?php <?php
@@ -302,9 +302,15 @@ while ($row = PMA_DBI_fetch_assoc($fields_rs)) {
?> ?>
<tr <?php echo $on_mouse; ?>> <tr <?php echo $on_mouse; ?>>
<?php
if (!$tbl_is_view) {
?>
<td align="center" bgcolor="<?php echo $bgcolor; ?>"> <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; ?> /> <input type="checkbox" name="selected_fld[]" value="<?php echo $field_encoded; ?>" id="checkbox_row_<?php echo $i; ?>" <?php echo $checked; ?> />
</td> </td>
<?php
}
?>
<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 <?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 <?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 $click_mouse; ?> bgcolor="<?php echo $bgcolor; ?>"<?php echo $type_nowrap; ?>><?php echo $type; echo $type_mime; ?><bdo dir="ltr"></bdo></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" : '' ?> <?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" : '' ?>
@@ -312,6 +318,9 @@ while ($row = PMA_DBI_fetch_assoc($fields_rs)) {
<td <?php echo $click_mouse; ?> bgcolor="<?php echo $bgcolor; ?>"><?php echo (($row['Null'] == '') ? $strNo : $strYes); ?>&nbsp;</td> <td <?php echo $click_mouse; ?> bgcolor="<?php echo $bgcolor; ?>"><?php echo (($row['Null'] == '') ? $strNo : $strYes); ?>&nbsp;</td>
<td <?php echo $click_mouse; ?> bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"><?php if (isset($row['Default'])) echo $row['Default']; ?>&nbsp;</td> <td <?php echo $click_mouse; ?> bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"><?php if (isset($row['Default'])) echo $row['Default']; ?>&nbsp;</td>
<td <?php echo $click_mouse; ?> bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"><?php echo $row['Extra']; ?>&nbsp;</td> <td <?php echo $click_mouse; ?> bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"><?php echo $row['Extra']; ?>&nbsp;</td>
<?php
if (!$tbl_is_view) {
?>
<td align="center" bgcolor="<?php echo $bgcolor; ?>"> <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>
@@ -393,7 +402,8 @@ while ($row = PMA_DBI_fetch_assoc($fields_rs)) {
</td> </td>
<?php <?php
} // end if... else... } // end if... else...
echo "\n" echo "\n";
} // end if (!$tbl_is_view)
?> ?>
</tr> </tr>
<?php <?php
@@ -402,8 +412,10 @@ while ($row = PMA_DBI_fetch_assoc($fields_rs)) {
echo "\n"; echo "\n";
$checkall_url = 'tbl_properties_structure.php?' . PMA_generate_common_url($db,$table); if (!$tbl_is_view) {
?>
$checkall_url = 'tbl_properties_structure.php?' . PMA_generate_common_url($db,$table);
?>
<tr> <tr>
<td colspan="<?php echo PMA_MYSQL_INT_VERSION >= 40100 ? '14' : '13'; ?>"> <td colspan="<?php echo PMA_MYSQL_INT_VERSION >= 40100 ? '14' : '13'; ?>">
@@ -422,43 +434,46 @@ $checkall_url = 'tbl_properties_structure.php?' . PMA_generate_common_url($db,$t
<td> <td>
<?php <?php
if ($cfg['PropertiesIconic']) { 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) {
PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_drop', $strDrop, 'b_drop.png'); PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_drop', $strDrop, 'b_drop.png');
} }
PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_primary', $strPrimary, 'b_primary.png'); PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_primary', $strPrimary, 'b_primary.png');
PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_index', $strIndex, 'b_index.png'); PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_index', $strIndex, 'b_index.png');
PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_unique', $strUnique, 'b_unique.png'); PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_unique', $strUnique, 'b_unique.png');
if ((!empty($tbl_type) && $tbl_type == 'MYISAM')) { if ((!empty($tbl_type) && $tbl_type == 'MYISAM')) {
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"; 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"
. '<input type="submit" name="submit_mult" value="' . $strDrop . '" title="' . $strDrop . '" />' . "\n";
}
echo '&nbsp;<i>' . $strOr . '</i>&nbsp;' . "\n" echo '&nbsp;<i>' . $strOr . '</i>&nbsp;' . "\n"
. '<input type="submit" name="submit_mult" value="' . $strDrop . '" title="' . $strDrop . '" />' . "\n"; . '<input type="submit" name="submit_mult" value="' . $strPrimary . '" title="' . $strPrimary . '" />' . "\n";
}
echo '&nbsp;<i>' . $strOr . '</i>&nbsp;' . "\n"
. '<input type="submit" name="submit_mult" value="' . $strPrimary . '" title="' . $strPrimary . '" />' . "\n";
echo '&nbsp;<i>' . $strOr . '</i>&nbsp;' . "\n"
. '<input type="submit" name="submit_mult" value="' . $strIndex . '" title="' . $strIndex . '" />' . "\n";
echo '&nbsp;<i>' . $strOr . '</i>&nbsp;' . "\n"
. '<input type="submit" name="submit_mult" value="' . $strUnique . '" title="' . $strUnique . '" />' . "\n";
if ((!empty($tbl_type) && $tbl_type == 'MYISAM')) {
echo '&nbsp;<i>' . $strOr . '</i>&nbsp;' . "\n" echo '&nbsp;<i>' . $strOr . '</i>&nbsp;' . "\n"
. '<input type="submit" name="submit_mult" value="' . $strIdxFulltext . '" title="' . $strIdxFulltext . '" />' . "\n"; . '<input type="submit" name="submit_mult" value="' . $strIndex . '" title="' . $strIndex . '" />' . "\n";
echo '&nbsp;<i>' . $strOr . '</i>&nbsp;' . "\n"
. '<input type="submit" name="submit_mult" value="' . $strUnique . '" title="' . $strUnique . '" />' . "\n";
if ((!empty($tbl_type) && $tbl_type == 'MYISAM')) {
echo '&nbsp;<i>' . $strOr . '</i>&nbsp;' . "\n"
. '<input type="submit" name="submit_mult" value="' . $strIdxFulltext . '" title="' . $strIdxFulltext . '" />' . "\n";
}
} }
}
?> ?>
</td> </td>
</tr> </tr>
</table> </table>
</td> </td>
</tr> </tr>
<?php
}
?>
</table> </table>
</form> </form>
@@ -466,10 +481,11 @@ if ($cfg['PropertiesIconic']) {
<?php <?php
/** if (!$tbl_is_view) {
* Work on the table /**
*/ * Work on the table
?> */
?>
<!-- TABLE WORK --> <!-- TABLE WORK -->
<!-- Printable view of the table --> <!-- 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
@@ -479,12 +495,12 @@ if ($cfg['PropertiesIconic']) {
echo $strPrintView; echo $strPrintView;
?></a>&nbsp;&nbsp;&nbsp; ?></a>&nbsp;&nbsp;&nbsp;
<?php <?php
// 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 --> <!-- 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']) {
@@ -492,9 +508,9 @@ if ($cfg['Server']['relation'] || $tbl_type=="INNODB") {
} }
echo $strRelationView; echo $strRelationView;
?></a>&nbsp;&nbsp;&nbsp; ?></a>&nbsp;&nbsp;&nbsp;
<?php <?php
} }
?> ?>
<!-- Let MySQL propose the optimal structure --> <!-- 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']) {
@@ -530,7 +546,9 @@ if ($cfg['Server']['relation'] || $tbl_type=="INNODB") {
<hr /> <hr />
<?php <?php
}
/** /**
* If there are more than 20 rows, displays browse/select/insert/empty/drop * If there are more than 20 rows, displays browse/select/insert/empty/drop
* links again * links again
@@ -545,57 +563,58 @@ if ($fields_cnt > 20) {
echo "\n\n"; echo "\n\n";
/** if (!$tbl_is_view) {
* Displays indexes /**
*/ * Displays indexes
?> */
?>
<!-- Indexes, space usage and row statistics --> <!-- Indexes, space usage and row statistics -->
<table border="0" cellspacing="0" cellpadding="0"> <table border="0" cellspacing="0" cellpadding="0">
<tr> <tr>
<td valign="top"> <td valign="top">
<?php <?php
define('PMA_IDX_INCLUDED', 1); define('PMA_IDX_INCLUDED', 1);
require ('./tbl_indexes.php'); require ('./tbl_indexes.php');
?> ?>
</td> </td>
<?php <?php
/** /**
* Displays Space usage and row statistics * Displays Space usage and row statistics
*/ */
// BEGIN - Calc Table Space - staybyte - 9 June 2001 // BEGIN - Calc Table Space - staybyte - 9 June 2001
// loic1, 22 feb. 2002: updated with patch from // loic1, 22 feb. 2002: updated with patch from
// Joshua Nye <josh at boxcarmedia.com> to get valid // Joshua Nye <josh at boxcarmedia.com> to get valid
// statistics whatever is the table type // statistics whatever is the table type
if ($cfg['ShowStats']) { if ($cfg['ShowStats']) {
$nonisam = FALSE; $nonisam = FALSE;
$is_innodb = (isset($showtable['Type']) && $showtable['Type'] == 'InnoDB'); $is_innodb = (isset($showtable['Type']) && $showtable['Type'] == 'InnoDB');
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
$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 ($table_info_num_rows > 0) {
list($avg_size, $avg_unit) = PMA_formatByteDown(($showtable['Data_length'] + $showtable['Index_length']) / $showtable['Rows'], 6, 1);
} }
if ($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 ($table_info_num_rows > 0) {
list($avg_size, $avg_unit) = PMA_formatByteDown(($showtable['Data_length'] + $showtable['Index_length']) / $showtable['Rows'], 6, 1);
}
// Displays them // Displays them
?> ?>
<!-- Space usage --> <!-- Space usage -->
<td width="20">&nbsp;</td> <td width="20">&nbsp;</td>
@@ -612,20 +631,20 @@ if ($cfg['ShowStats']) {
<td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>" align="right" nowrap="nowrap"><?php echo $data_size; ?></td> <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>" align="right" nowrap="nowrap"><?php echo $data_size; ?></td>
<td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>"><?php echo $data_unit; ?></td> <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>"><?php echo $data_unit; ?></td>
</tr> </tr>
<?php <?php
if (isset($index_size)) { if (isset($index_size)) {
echo "\n"; echo "\n";
?> ?>
<tr> <tr>
<td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>" style="padding-right: 10px"><?php echo $strIndex; ?></td> <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>" style="padding-right: 10px"><?php echo $strIndex; ?></td>
<td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>" align="right" nowrap="nowrap"><?php echo $index_size; ?></td> <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>" align="right" nowrap="nowrap"><?php echo $index_size; ?></td>
<td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>"><?php echo $index_unit; ?></td> <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>"><?php echo $index_unit; ?></td>
</tr> </tr>
<?php <?php
} }
if (isset($free_size)) { if (isset($free_size)) {
echo "\n"; echo "\n";
?> ?>
<tr style="color: #bb0000"> <tr style="color: #bb0000">
<td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>" style="padding-right: 10px"><?php echo $strOverhead; ?></td> <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>" style="padding-right: 10px"><?php echo $strOverhead; ?></td>
<td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>" align="right" nowrap="nowrap"><?php echo $free_size; ?></td> <td bgcolor="<?php echo $cfg['BgcolorTwo']; ?>" align="right" nowrap="nowrap"><?php echo $free_size; ?></td>
@@ -636,22 +655,22 @@ if ($cfg['ShowStats']) {
<td bgcolor="<?php echo $cfg['BgcolorOne']; ?>" align="right" nowrap="nowrap"><?php echo $effect_size; ?></td> <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>" align="right" nowrap="nowrap"><?php echo $effect_size; ?></td>
<td bgcolor="<?php echo $cfg['BgcolorOne']; ?>"><?php echo $effect_unit; ?></td> <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>"><?php echo $effect_unit; ?></td>
</tr> </tr>
<?php <?php
} }
if (isset($tot_size) && $mergetable == FALSE) { if (isset($tot_size) && $mergetable == FALSE) {
echo "\n"; echo "\n";
?> ?>
<tr> <tr>
<td bgcolor="<?php echo $cfg['BgcolorOne']; ?>" style="padding-right: 10px"><?php echo $strTotalUC; ?></td> <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>" style="padding-right: 10px"><?php echo $strTotalUC; ?></td>
<td bgcolor="<?php echo $cfg['BgcolorOne']; ?>" align="right" nowrap="nowrap"><?php echo $tot_size; ?></td> <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>" align="right" nowrap="nowrap"><?php echo $tot_size; ?></td>
<td bgcolor="<?php echo $cfg['BgcolorOne']; ?>"><?php echo $tot_unit; ?></td> <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>"><?php echo $tot_unit; ?></td>
</tr> </tr>
<?php <?php
} }
// Optimize link if overhead // Optimize link if overhead
if (isset($free_size) && ($tbl_type == 'MYISAM' || $tbl_type == 'BDB')) { if (isset($free_size) && ($tbl_type == 'MYISAM' || $tbl_type == 'BDB')) {
echo "\n"; echo "\n";
?> ?>
<tr> <tr>
<td colspan="3" align="center" bgcolor="<?php echo $cfg['BgcolorTwo']; ?>"> <td colspan="3" align="center" bgcolor="<?php echo $cfg['BgcolorTwo']; ?>">
<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
@@ -662,10 +681,10 @@ if ($cfg['ShowStats']) {
?></a> ?></a>
</td> </td>
</tr> </tr>
<?php <?php
} }
echo "\n"; echo "\n";
?> ?>
</table> </table>
</td> </td>
@@ -678,99 +697,99 @@ if ($cfg['ShowStats']) {
<th><?php echo $strStatement; ?></th> <th><?php echo $strStatement; ?></th>
<th align="center"><?php echo $strValue; ?></th> <th align="center"><?php echo $strValue; ?></th>
</tr> </tr>
<?php <?php
$i = 0; $i = 0;
if (isset($showtable['Row_format'])) { if (isset($showtable['Row_format'])) {
$bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']); $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
echo "\n"; echo "\n";
?> ?>
<tr> <tr>
<td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strFormat; ?></td> <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strFormat; ?></td>
<td bgcolor="<?php echo $bgcolor; ?>" align="<?php echo $cell_align_left; ?>" nowrap="nowrap"> <td bgcolor="<?php echo $bgcolor; ?>" align="<?php echo $cell_align_left; ?>" nowrap="nowrap">
<?php <?php
echo ' '; echo ' ';
if ($showtable['Row_format'] == 'Fixed') { if ($showtable['Row_format'] == 'Fixed') {
echo $strFixed; echo $strFixed;
} }
else if ($showtable['Row_format'] == 'Dynamic') { else if ($showtable['Row_format'] == 'Dynamic') {
echo $strDynamic; echo $strDynamic;
} }
else { else {
echo $showtable['Row_format']; echo $showtable['Row_format'];
} }
echo "\n"; echo "\n";
?> ?>
</td> </td>
</tr> </tr>
<?php <?php
} }
if (PMA_MYSQL_INT_VERSION >= 40100) { if (PMA_MYSQL_INT_VERSION >= 40100 && !empty($tbl_collation)) {
$bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']); $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
?> ?>
<tr> <tr>
<td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strCollation; ?></td> <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strCollation; ?></td>
<td bgcolor="<?php echo $bgcolor; ?>" align="<?php echo $cell_align_left; ?>" nowrap="nowrap"> <td bgcolor="<?php echo $bgcolor; ?>" align="<?php echo $cell_align_left; ?>" nowrap="nowrap">
<?php <?php
echo '<dfn title="' . PMA_getCollationDescr($tbl_collation) . '">' . $tbl_collation . '</dfn>'; echo '<dfn title="' . PMA_getCollationDescr($tbl_collation) . '">' . $tbl_collation . '</dfn>';
?> ?>
</td> </td>
</tr> </tr>
<?php <?php
} }
if (!$is_innodb && isset($showtable['Rows'])) { if (!$is_innodb && isset($showtable['Rows'])) {
$bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']); $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
echo "\n"; echo "\n";
?> ?>
<tr> <tr>
<td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strRows; ?></td> <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strRows; ?></td>
<td bgcolor="<?php echo $bgcolor; ?>" align="right" nowrap="nowrap"> <td bgcolor="<?php echo $bgcolor; ?>" align="right" nowrap="nowrap">
<?php echo number_format($showtable['Rows'], 0, $number_decimal_separator, $number_thousands_separator) . "\n"; ?> <?php echo number_format($showtable['Rows'], 0, $number_decimal_separator, $number_thousands_separator) . "\n"; ?>
</td> </td>
</tr> </tr>
<?php <?php
} }
if (!$is_innodb && isset($showtable['Avg_row_length']) && $showtable['Avg_row_length'] > 0) { if (!$is_innodb && isset($showtable['Avg_row_length']) && $showtable['Avg_row_length'] > 0) {
$bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']); $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
echo "\n"; echo "\n";
?> ?>
<tr> <tr>
<td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strRowLength; ?>&nbsp;&oslash;</td> <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strRowLength; ?>&nbsp;&oslash;</td>
<td bgcolor="<?php echo $bgcolor; ?>" align="right" nowrap="nowrap"> <td bgcolor="<?php echo $bgcolor; ?>" align="right" nowrap="nowrap">
<?php echo number_format($showtable['Avg_row_length'], 0, $number_decimal_separator, $number_thousands_separator) . "\n"; ?> <?php echo number_format($showtable['Avg_row_length'], 0, $number_decimal_separator, $number_thousands_separator) . "\n"; ?>
</td> </td>
</tr> </tr>
<?php <?php
} }
if (!$is_innodb && isset($showtable['Data_length']) && $showtable['Rows'] > 0 && $mergetable == FALSE) { if (!$is_innodb && isset($showtable['Data_length']) && $showtable['Rows'] > 0 && $mergetable == FALSE) {
$bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']); $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
echo "\n"; echo "\n";
?> ?>
<tr> <tr>
<td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strRowSize; ?>&nbsp;&oslash;</td> <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strRowSize; ?>&nbsp;&oslash;</td>
<td bgcolor="<?php echo $bgcolor; ?>" align="right" nowrap="nowrap"> <td bgcolor="<?php echo $bgcolor; ?>" align="right" nowrap="nowrap">
<?php echo $avg_size . ' ' . $avg_unit . "\n"; ?> <?php echo $avg_size . ' ' . $avg_unit . "\n"; ?>
</td> </td>
</tr> </tr>
<?php <?php
} }
if (isset($showtable['Auto_increment'])) { if (isset($showtable['Auto_increment'])) {
$bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']); $bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
echo "\n"; echo "\n";
?> ?>
<tr> <tr>
<td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strNext; ?>&nbsp;Autoindex</td> <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strNext; ?>&nbsp;Autoindex</td>
<td bgcolor="<?php echo $bgcolor; ?>" align="right" nowrap="nowrap"> <td bgcolor="<?php echo $bgcolor; ?>" align="right" nowrap="nowrap">
<?php echo number_format($showtable['Auto_increment'], 0, $number_decimal_separator, $number_thousands_separator) . "\n"; ?> <?php echo number_format($showtable['Auto_increment'], 0, $number_decimal_separator, $number_thousands_separator) . "\n"; ?>
</td> </td>
</tr> </tr>
<?php <?php
} }
echo "\n";
if (isset($showtable['Create_time'])) {
$bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
echo "\n"; echo "\n";
?>
if (isset($showtable['Create_time'])) {
$bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
echo "\n";
?>
<tr> <tr>
<td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strStatCreateTime; ?></td> <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strStatCreateTime; ?></td>
<td<?php if($theme=='original' || $theme==''){ echo ' style="font-size:' . $font_smaller . '"'; } ?> align="right" bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"> <td<?php if($theme=='original' || $theme==''){ echo ' style="font-size:' . $font_smaller . '"'; } ?> align="right" bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap">
@@ -778,13 +797,13 @@ if ($cfg['ShowStats']) {
</td> </td>
</tr> </tr>
<?php <?php
} }
echo "\n";
if (isset($showtable['Update_time'])) {
$bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
echo "\n"; echo "\n";
?>
if (isset($showtable['Update_time'])) {
$bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
echo "\n";
?>
<tr> <tr>
<td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strStatUpdateTime; ?></td> <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strStatUpdateTime; ?></td>
<td<?php if($theme=='original' || $theme==''){ echo ' style="font-size:' . $font_smaller . '"'; } ?> align="right" bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"> <td<?php if($theme=='original' || $theme==''){ echo ' style="font-size:' . $font_smaller . '"'; } ?> align="right" bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap">
@@ -792,35 +811,37 @@ if ($cfg['ShowStats']) {
</td> </td>
</tr> </tr>
<?php <?php
} }
echo "\n";
if (isset($showtable['Check_time'])) {
$bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
echo "\n"; echo "\n";
?>
if (isset($showtable['Check_time'])) {
$bgcolor = ((++$i%2) ? $cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
echo "\n";
?>
<tr> <tr>
<td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strStatCheckTime; ?></td> <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $strStatCheckTime; ?></td>
<td<?php if($theme=='original' || $theme==''){ echo ' style="font-size:' . $font_smaller . '"'; } ?> align="right" bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"> <td<?php if($theme=='original' || $theme==''){ echo ' style="font-size:' . $font_smaller . '"'; } ?> align="right" bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap">
<?php echo PMA_localisedDate(strtotime($showtable['Check_time'])) . "\n"; ?> <?php echo PMA_localisedDate(strtotime($showtable['Check_time'])) . "\n"; ?>
</td> </td>
</tr> </tr>
<?php <?php
} }
echo "\n"; echo "\n";
?> ?>
</table> </table>
</td> </td>
<?php <?php
}
} }
} // END - Calc Table Space
// END - Calc Table Space echo "\n";
echo "\n"; ?>
?>
</tr> </tr>
</table> </table>
<hr /> <hr />
<?php <?php
} // end if (!$tbl_is_view)
/** /**
* Query box, bookmark, insert data from textfile * Query box, bookmark, insert data from textfile
*/ */

View File

@@ -20,10 +20,17 @@ $showtable = PMA_DBI_fetch_assoc($table_info_result);
if (!isset($showtable['Type']) && isset($showtable['Engine'])) { if (!isset($showtable['Type']) && isset($showtable['Engine'])) {
$showtable['Type'] =& $showtable['Engine']; $showtable['Type'] =& $showtable['Engine'];
} }
$tbl_type = isset($showtable['Type']) ? strtoupper($showtable['Type']) : ''; if (PMA_MYSQL_INT_VERSION >= 50000 && !isset($showtable['Type']) && isset($showtable['Comment']) && $showtable['Comment'] == 'view') {
$tbl_collation = empty($showtable['Collation']) ? '' : $showtable['Collation']; $tbl_is_view = TRUE;
$tbl_type = $strView;
$show_comment = NULL;
} else {
$tbl_is_view = FALSE;
$tbl_type = isset($showtable['Type']) ? strtoupper($showtable['Type']) : '';
$show_comment = (isset($showtable['Comment']) ? $showtable['Comment'] : '');
}
$tbl_collation = empty($showtable['Collation']) ? '' : $showtable['Collation'];
$table_info_num_rows = (isset($showtable['Rows']) ? $showtable['Rows'] : 0); $table_info_num_rows = (isset($showtable['Rows']) ? $showtable['Rows'] : 0);
$show_comment = (isset($showtable['Comment']) ? $showtable['Comment'] : '');
$auto_increment = (isset($showtable['Auto_increment']) ? $showtable['Auto_increment'] : ''); $auto_increment = (isset($showtable['Auto_increment']) ? $showtable['Auto_increment'] : '');
$tmp = isset($showtable['Create_options']) ? explode(' ', $showtable['Create_options']) : array(); $tmp = isset($showtable['Create_options']) ? explode(' ', $showtable['Create_options']) : array();
@@ -34,6 +41,6 @@ for ($i = 0; $i < $tmp_cnt; $i++) {
$$tmp1[0] = $tmp1[1]; $$tmp1[0] = $tmp1[1];
} }
} // end for } // end for
unset($tmp1, $tmp);
PMA_DBI_free_result($table_info_result); PMA_DBI_free_result($table_info_result);
unset($tmp1, $tmp, $table_info_result);
?> ?>