added the $cfgShowStats setting

This commit is contained in:
Loïc Chapeaux
2001-09-20 08:04:03 +00:00
parent 6026f15e75
commit 8a4bb53fc4
5 changed files with 254 additions and 204 deletions

View File

@@ -5,6 +5,14 @@ phpMyAdmin - Changelog
$Id$ $Id$
$Source$ $Source$
2001-09-20 Lo<4C>c Chapeaux <lolo@phpheaven.net>
* main.php3: fixed an error I've done while merging patch #462787.
* config.inc.php3; Documentation.html: added the $cfgShowStats setting and
resorted the core phpMyAdmin settings in a more logical way.
* db_details.php3; db_printview.php3; tbl_properties.php3;
tbl_printview.php3: added the $cfgShowStats setting.
* lang/italian.inc.php3: updated thanks to Pietro Danesi.
2001-09-19 Marc Delisle <lem9@users.sourceforge.net> 2001-09-19 Marc Delisle <lem9@users.sourceforge.net>
* tbl_properties.php3, db_details.php3, lang/*: start to merge new messages * tbl_properties.php3, db_details.php3, lang/*: start to merge new messages
with parameters. with parameters.

View File

@@ -139,7 +139,12 @@ else if (MYSQL_INT_VERSION >= 32300) {
<th colspan="6"><?php echo ucfirst($strAction); ?></th> <th colspan="6"><?php echo ucfirst($strAction); ?></th>
<th><?php echo ucfirst($strRecords); ?></th> <th><?php echo ucfirst($strRecords); ?></th>
<th><?php echo ucfirst($strType); ?></th> <th><?php echo ucfirst($strType); ?></th>
<th><?php echo ucfirst($strSize); ?></th> <?php
if ($cfgShowStats) {
echo '<th>' . ucfirst($strSize) . '</th>';
}
echo "\n";
?>
</tr> </tr>
<?php <?php
$i = $sum_entries = $sum_size = 0; $i = $sum_entries = $sum_size = 0;
@@ -201,7 +206,7 @@ else if (MYSQL_INT_VERSION >= 32300) {
if (isset($sts_data['Rows'])) { if (isset($sts_data['Rows'])) {
if ($mergetable == FALSE) { if ($mergetable == FALSE) {
if ($nonisam == FALSE) { if ($cfgShowStats && $nonisam == FALSE) {
$tblsize = $sts_data['Data_length'] + $sts_data['Index_length']; $tblsize = $sts_data['Data_length'] + $sts_data['Index_length'];
$sum_size += $tblsize; $sum_size += $tblsize;
if ($tblsize > 0) { if ($tblsize > 0) {
@@ -209,20 +214,18 @@ else if (MYSQL_INT_VERSION >= 32300) {
} else { } else {
list($formated_size, $unit) = format_byte_down($tblsize, 3, 0); list($formated_size, $unit) = format_byte_down($tblsize, 3, 0);
} }
} else { } else if ($cfgShowStats) {
$formated_size = '&nbsp;-&nbsp;'; $formated_size = '&nbsp;-&nbsp;';
$unit = ''; $unit = '';
} }
if (isset($sts_data['Rows'])) { $sum_entries += $sts_data['Rows'];
$sum_entries += $sts_data['Rows'];
}
} }
// MyISAM MERGE Table // MyISAM MERGE Table
else if ($mergetable == TRUE) { else if ($cfgShowStats && $mergetable == TRUE) {
$formated_size = '&nbsp;-&nbsp;'; $formated_size = '&nbsp;-&nbsp;';
$unit = ''; $unit = '';
} }
else { else if ($cfgShowStats) {
$formated_size = 'unknown'; $formated_size = 'unknown';
$unit = ''; $unit = '';
} }
@@ -240,11 +243,17 @@ else if (MYSQL_INT_VERSION >= 32300) {
<td nowrap="nowrap"> <td nowrap="nowrap">
&nbsp;<?php echo (isset($sts_data['Type']) ? $sts_data['Type'] : '&nbsp;'); ?>&nbsp; &nbsp;<?php echo (isset($sts_data['Type']) ? $sts_data['Type'] : '&nbsp;'); ?>&nbsp;
</td> </td>
<?php
if ($cfgShowStats) {
echo "\n";
?>
<td align="right" nowrap="nowrap"> <td align="right" nowrap="nowrap">
&nbsp;&nbsp; &nbsp;&nbsp;
<a href="tbl_properties.php3?<?php echo $url_query; ?>#showusage"><?php echo $formated_size . ' ' . $unit; ?></a> <a href="tbl_properties.php3?<?php echo $url_query; ?>#showusage"><?php echo $formated_size . ' ' . $unit; ?></a>
</td> </td>
<?php <?php
echo "\n";
} // end if
} else { } else {
?> ?>
<td colspan="3" align="center"> <td colspan="3" align="center">
@@ -258,7 +267,9 @@ else if (MYSQL_INT_VERSION >= 32300) {
<?php <?php
} }
// Show Summary // Show Summary
list($sum_formated,$unit) = format_byte_down($sum_size,3,1); if ($cfgShowStats) {
list($sum_formated, $unit) = format_byte_down($sum_size, 3, 1);
}
echo "\n"; echo "\n";
?> ?>
<tr> <tr>
@@ -275,13 +286,21 @@ else if (MYSQL_INT_VERSION >= 32300) {
<th align="center"> <th align="center">
<b>--</b> <b>--</b>
</td> </td>
<?php
if ($cfgShowStats) {
echo "\n";
?>
<th align="right" nowrap="nowrap"> <th align="right" nowrap="nowrap">
<b><?php echo $sum_formated . ' '. $unit; ?></b> <b><?php echo $sum_formated . ' '. $unit; ?></b>
</th> </th>
<?php
}
echo "\n";
?>
</tr> </tr>
<tr> <tr>
<td colspan="11"> <td colspan="<?php echo (($cfgShowStats) ? '11' : '10'); ?>">
<img src="./images/arrow.gif" border="0" width="38" height="22" alt="<?php echo $strWithChecked; ?>" /> <img src="./images/arrow.gif" border="0" width="38" height="22" alt="<?php echo $strWithChecked; ?>" />
<i><?php echo $strWithChecked; ?></i>&nbsp;&nbsp; <i><?php echo $strWithChecked; ?></i>&nbsp;&nbsp;
<input type="submit" name="submit_mult" value="<?php echo $strDrop; ?>" /> <input type="submit" name="submit_mult" value="<?php echo $strDrop; ?>" />

View File

@@ -89,7 +89,12 @@ else if (MYSQL_INT_VERSION >= 32300) {
<th>&nbsp;<?php echo ucfirst($strTable); ?>&nbsp;</th> <th>&nbsp;<?php echo ucfirst($strTable); ?>&nbsp;</th>
<th><?php echo ucfirst($strRecords); ?></th> <th><?php echo ucfirst($strRecords); ?></th>
<th><?php echo ucfirst($strType); ?></th> <th><?php echo ucfirst($strType); ?></th>
<th><?php echo ucfirst($strSize); ?></th> <?php
if ($cfgShowStats) {
echo '<th>' . ucfirst($strSize) . '</th>';
}
echo "\n";
?>
</tr> </tr>
<?php <?php
$i = $sum_entries = $sum_size = 0; $i = $sum_entries = $sum_size = 0;
@@ -116,7 +121,7 @@ else if (MYSQL_INT_VERSION >= 32300) {
if (isset($sts_data['Rows'])) { if (isset($sts_data['Rows'])) {
if ($mergetable == FALSE) { if ($mergetable == FALSE) {
if ($nonisam == FALSE) { if ($cfgShowStats && $nonisam == FALSE) {
$tblsize = $sts_data['Data_length'] + $sts_data['Index_length']; $tblsize = $sts_data['Data_length'] + $sts_data['Index_length'];
$sum_size += $tblsize; $sum_size += $tblsize;
if ($tblsize > 0) { if ($tblsize > 0) {
@@ -124,20 +129,18 @@ else if (MYSQL_INT_VERSION >= 32300) {
} else { } else {
list($formated_size, $unit) = format_byte_down($tblsize, 3, 0); list($formated_size, $unit) = format_byte_down($tblsize, 3, 0);
} }
} else { } else if ($cfgShowStats) {
$formated_size = '&nbsp;-&nbsp;'; $formated_size = '&nbsp;-&nbsp;';
$unit = ''; $unit = '';
} }
if (isset($sts_data['Rows'])) { $sum_entries += $sts_data['Rows'];
$sum_entries += $sts_data['Rows'];
}
} }
// MyISAM MERGE Table // MyISAM MERGE Table
else if ($mergetable == TRUE) { else if ($cfgShowStats && $mergetable == TRUE) {
$formated_size = '&nbsp;-&nbsp;'; $formated_size = '&nbsp;-&nbsp;';
$unit = ''; $unit = '';
} }
else { else if ($cfgShowStats) {
$formated_size = 'unknown'; $formated_size = 'unknown';
$unit = ''; $unit = '';
} }
@@ -155,10 +158,16 @@ else if (MYSQL_INT_VERSION >= 32300) {
<td nowrap="nowrap"> <td nowrap="nowrap">
&nbsp;<?php echo (isset($sts_data['Type']) ? $sts_data['Type'] : '&nbsp;'); ?>&nbsp; &nbsp;<?php echo (isset($sts_data['Type']) ? $sts_data['Type'] : '&nbsp;'); ?>&nbsp;
</td> </td>
<?php
if ($cfgShowStats) {
echo "\n";
?>
<td align="right" nowrap="nowrap"> <td align="right" nowrap="nowrap">
&nbsp;<?php echo $formated_size . ' ' . $unit . "\n"; ?> &nbsp;<?php echo $formated_size . ' ' . $unit . "\n"; ?>
</td> </td>
<?php <?php
echo "\n";
} // end if
} else { } else {
?> ?>
<td colspan="3" align="center"> <td colspan="3" align="center">
@@ -172,7 +181,9 @@ else if (MYSQL_INT_VERSION >= 32300) {
<?php <?php
} }
// Show Summary // Show Summary
list($sum_formated,$unit) = format_byte_down($sum_size,3,1); if ($cfgShowStats) {
list($sum_formated, $unit) = format_byte_down($sum_size, 3, 1);
}
echo "\n"; echo "\n";
?> ?>
<tr> <tr>
@@ -185,9 +196,17 @@ else if (MYSQL_INT_VERSION >= 32300) {
<th align="center"> <th align="center">
<b>--</b> <b>--</b>
</td> </td>
<?php
if ($cfgShowStats) {
echo "\n";
?>
<th align="right" nowrap="nowrap"> <th align="right" nowrap="nowrap">
<b><?php echo $sum_formated . ' '. $unit; ?></b> <b><?php echo $sum_formated . ' '. $unit; ?></b>
</th> </th>
<?php
}
echo "\n";
?>
</tr> </tr>
</table> </table>
<?php <?php

View File

@@ -256,33 +256,34 @@ if ($index_count > 0) {
* *
* staybyte - 9 June 2001 * staybyte - 9 June 2001
*/ */
$nonisam = FALSE; if ($cfgShowStats) {
if (isset($showtable['Type']) && !eregi('ISAM|HEAP', $showtable['Type'])) { $nonisam = FALSE;
$nonisam = TRUE; if (isset($showtable['Type']) && !eregi('ISAM|HEAP', $showtable['Type'])) {
} $nonisam = TRUE;
if (MYSQL_INT_VERSION >= 32303 && $nonisam == FALSE) {
// Gets some sizes
$mergetable = FALSE;
if (isset($showtable['Type']) && $showtable['Type'] == 'MRG_MyISAM') {
$mergetable = TRUE;
}
list($data_size, $data_unit) = format_byte_down($showtable['Data_length']);
if ($mergetable == FALSE) {
list($index_size, $index_unit) = format_byte_down($showtable['Index_length']);
}
if (isset($showtable['Data_free']) && $showtable['Data_free'] > 0) {
list($free_size, $free_unit) = format_byte_down($showtable['Data_free']);
list($effect_size, $effect_unit) = format_byte_down($showtable['Data_length'] + $showtable['Index_length'] - $showtable['Data_free']);
} else {
list($effect_size, $effect_unit) = format_byte_down($showtable['Data_length'] + $showtable['Index_length']);
}
list($tot_size, $tot_unit) = format_byte_down($showtable['Data_length'] + $showtable['Index_length']);
if ($num_rows > 0) {
list($avg_size, $avg_unit) = format_byte_down(($showtable['Data_length'] + $showtable['Index_length']) / $showtable['Rows'], 6, 1);
} }
if (MYSQL_INT_VERSION >= 32303 && $nonisam == FALSE) {
// Gets some sizes
$mergetable = FALSE;
if (isset($showtable['Type']) && $showtable['Type'] == 'MRG_MyISAM') {
$mergetable = TRUE;
}
list($data_size, $data_unit) = format_byte_down($showtable['Data_length']);
if ($mergetable == FALSE) {
list($index_size, $index_unit) = format_byte_down($showtable['Index_length']);
}
if (isset($showtable['Data_free']) && $showtable['Data_free'] > 0) {
list($free_size, $free_unit) = format_byte_down($showtable['Data_free']);
list($effect_size, $effect_unit) = format_byte_down($showtable['Data_length'] + $showtable['Index_length'] - $showtable['Data_free']);
} else {
list($effect_size, $effect_unit) = format_byte_down($showtable['Data_length'] + $showtable['Index_length']);
}
list($tot_size, $tot_unit) = format_byte_down($showtable['Data_length'] + $showtable['Index_length']);
if ($num_rows > 0) {
list($avg_size, $avg_unit) = format_byte_down(($showtable['Data_length'] + $showtable['Index_length']) / $showtable['Rows'], 6, 1);
}
// Displays them // Displays them
?> ?>
<br /><br /> <br /><br />
<table border="0" cellspacing="0" cellpadding="0"> <table border="0" cellspacing="0" cellpadding="0">
@@ -301,20 +302,20 @@ if (MYSQL_INT_VERSION >= 32303 && $nonisam == FALSE) {
<td align="right" nowrap="nowrap"><?php echo $data_size; ?></td> <td align="right" nowrap="nowrap"><?php echo $data_size; ?></td>
<td><?php echo $data_unit; ?></td> <td><?php echo $data_unit; ?></td>
</tr> </tr>
<?php
if (isset($index_size)) {
echo "\n";
?>
<tr bgcolor="<?php echo $cfgBgcolorTwo; ?>">
<td style="padding-right: 10px"><?php echo ucfirst($strIndex); ?></td>
<td align="right" nowrap="nowrap"><?php echo $index_size; ?></td>
<td><?php echo $index_unit; ?></td>
</tr>
<?php <?php
} if (isset($index_size)) {
if (isset($free_size)) { echo "\n";
echo "\n"; ?>
?> <tr bgcolor="<?php echo $cfgBgcolorTwo; ?>">
<td style="padding-right: 10px"><?php echo ucfirst($strIndex); ?></td>
<td align="right" nowrap="nowrap"><?php echo $index_size; ?></td>
<td><?php echo $index_unit; ?></td>
</tr>
<?php
}
if (isset($free_size)) {
echo "\n";
?>
<tr bgcolor="<?php echo $cfgBgcolorTwo; ?>" style="color: #bb0000"> <tr bgcolor="<?php echo $cfgBgcolorTwo; ?>" style="color: #bb0000">
<td style="padding-right: 10px"><?php echo ucfirst($strOverhead); ?></td> <td style="padding-right: 10px"><?php echo ucfirst($strOverhead); ?></td>
<td align="right" nowrap="nowrap"><?php echo $free_size; ?></td> <td align="right" nowrap="nowrap"><?php echo $free_size; ?></td>
@@ -325,20 +326,20 @@ if (MYSQL_INT_VERSION >= 32303 && $nonisam == FALSE) {
<td align="right" nowrap="nowrap"><?php echo $effect_size; ?></td> <td align="right" nowrap="nowrap"><?php echo $effect_size; ?></td>
<td><?php echo $effect_unit; ?></td> <td><?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 bgcolor="<?php echo $cfgBgcolorOne; ?>"> <tr bgcolor="<?php echo $cfgBgcolorOne; ?>">
<td style="padding-right: 10px"><?php echo ucfirst($strTotal); ?></td> <td style="padding-right: 10px"><?php echo ucfirst($strTotal); ?></td>
<td align="right" nowrap="nowrap"><?php echo $tot_size; ?></td> <td align="right" nowrap="nowrap"><?php echo $tot_size; ?></td>
<td><?php echo $tot_unit; ?></td> <td><?php echo $tot_unit; ?></td>
</tr> </tr>
<?php <?php
} }
echo "\n"; echo "\n";
?> ?>
</table> </table>
</td> </td>
@@ -352,82 +353,83 @@ if (MYSQL_INT_VERSION >= 32303 && $nonisam == FALSE) {
<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'])) {
echo "\n"; echo "\n";
?> ?>
<tr bgcolor="<?php echo ((++$i%2) ? $cfgBgcolorTwo : $cfgBgcolorOne); ?>"> <tr bgcolor="<?php echo ((++$i%2) ? $cfgBgcolorTwo : $cfgBgcolorOne); ?>">
<td><?php echo ucfirst($strFormat); ?></td> <td><?php echo ucfirst($strFormat); ?></td>
<td align="right" nowrap="nowrap"> <td align="right" 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 (isset($showtable['Rows'])) { if (isset($showtable['Rows'])) {
echo "\n"; echo "\n";
?> ?>
<tr bgcolor="<?php echo ((++$i%2) ? $cfgBgcolorTwo : $cfgBgcolorOne); ?>"> <tr bgcolor="<?php echo ((++$i%2) ? $cfgBgcolorTwo : $cfgBgcolorOne); ?>">
<td><?php echo ucfirst($strRows); ?></td> <td><?php echo ucfirst($strRows); ?></td>
<td align="right" nowrap="nowrap"> <td 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 (isset($showtable['Avg_row_length']) && $showtable['Avg_row_length'] > 0) { if (isset($showtable['Avg_row_length']) && $showtable['Avg_row_length'] > 0) {
echo "\n"; echo "\n";
?> ?>
<tr bgcolor="<?php echo ((++$i%2) ? $cfgBgcolorTwo : $cfgBgcolorOne); ?>"> <tr bgcolor="<?php echo ((++$i%2) ? $cfgBgcolorTwo : $cfgBgcolorOne); ?>">
<td><?php echo ucfirst($strRowLength); ?>&nbsp;&oslash;</td> <td><?php echo ucfirst($strRowLength); ?>&nbsp;&oslash;</td>
<td align="right" nowrap="nowrap"> <td 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 (isset($showtable['Data_length']) && $showtable['Rows'] > 0 && $mergetable == FALSE) { if (isset($showtable['Data_length']) && $showtable['Rows'] > 0 && $mergetable == FALSE) {
echo "\n"; echo "\n";
?> ?>
<tr bgcolor="<?php echo ((++$i%2) ? $cfgBgcolorTwo : $cfgBgcolorOne); ?>"> <tr bgcolor="<?php echo ((++$i%2) ? $cfgBgcolorTwo : $cfgBgcolorOne); ?>">
<td><?php echo ucfirst($strRowSize); ?>&nbsp;&oslash;</td> <td><?php echo ucfirst($strRowSize); ?>&nbsp;&oslash;</td>
<td align="right" nowrap="nowrap"> <td 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'])) {
echo "\n"; echo "\n";
?> ?>
<tr bgcolor="<?php echo ((++$i%2) ? $cfgBgcolorTwo : $cfgBgcolorOne); ?>"> <tr bgcolor="<?php echo ((++$i%2) ? $cfgBgcolorTwo : $cfgBgcolorOne); ?>">
<td><?php echo ucfirst($strNext); ?>&nbsp;Autoindex</td> <td><?php echo ucfirst($strNext); ?>&nbsp;Autoindex</td>
<td align="right" nowrap="nowrap"> <td 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"; echo "\n";
?> ?>
</table> </table>
</td> </td>
</tr> </tr>
</table> </table>
<?php <?php
} // end if (MYSQL_INT_VERSION >= 32303 && $nonisam == FALSE) } // end if (MYSQL_INT_VERSION >= 32303 && $nonisam == FALSE)
} // end if ($cfgShowStats)
/** /**

View File

@@ -522,36 +522,37 @@ if ($index_count > 0) {
* 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
$nonisam = FALSE; if ($cfgShowStats) {
if (isset($showtable['Type']) && !eregi('ISAM|HEAP', $showtable['Type'])) { $nonisam = FALSE;
$nonisam = TRUE; if (isset($showtable['Type']) && !eregi('ISAM|HEAP', $showtable['Type'])) {
} $nonisam = TRUE;
if (MYSQL_INT_VERSION >= 32303 && $nonisam == FALSE) {
// Gets some sizes
$mergetable = FALSE;
if (isset($showtable['Type']) && $showtable['Type'] == 'MRG_MyISAM') {
$mergetable = TRUE;
}
list($data_size, $data_unit) = format_byte_down($showtable['Data_length']);
if ($mergetable == FALSE) {
list($index_size, $index_unit) = format_byte_down($showtable['Index_length']);
}
if (isset($showtable['Data_free']) && $showtable['Data_free'] > 0) {
list($free_size, $free_unit) = format_byte_down($showtable['Data_free']);
list($effect_size, $effect_unit) = format_byte_down($showtable['Data_length'] + $showtable['Index_length'] - $showtable['Data_free']);
} else {
list($effect_size, $effect_unit) = format_byte_down($showtable['Data_length'] + $showtable['Index_length']);
}
list($tot_size, $tot_unit) = format_byte_down($showtable['Data_length'] + $showtable['Index_length']);
if ($num_rows > 0) {
list($avg_size, $avg_unit) = format_byte_down(($showtable['Data_length'] + $showtable['Index_length']) / $showtable['Rows'], 6, 1);
} }
if (MYSQL_INT_VERSION >= 32303 && $nonisam == FALSE) {
// Gets some sizes
$mergetable = FALSE;
if (isset($showtable['Type']) && $showtable['Type'] == 'MRG_MyISAM') {
$mergetable = TRUE;
}
list($data_size, $data_unit) = format_byte_down($showtable['Data_length']);
if ($mergetable == FALSE) {
list($index_size, $index_unit) = format_byte_down($showtable['Index_length']);
}
if (isset($showtable['Data_free']) && $showtable['Data_free'] > 0) {
list($free_size, $free_unit) = format_byte_down($showtable['Data_free']);
list($effect_size, $effect_unit) = format_byte_down($showtable['Data_length'] + $showtable['Index_length'] - $showtable['Data_free']);
} else {
list($effect_size, $effect_unit) = format_byte_down($showtable['Data_length'] + $showtable['Index_length']);
}
list($tot_size, $tot_unit) = format_byte_down($showtable['Data_length'] + $showtable['Index_length']);
if ($num_rows > 0) {
list($avg_size, $avg_unit) = format_byte_down(($showtable['Data_length'] + $showtable['Index_length']) / $showtable['Rows'], 6, 1);
}
// Displays them // Displays them
if ($index_count > 0) { if ($index_count > 0) {
echo ' <td width="20">&nbsp;</td>' . "\n"; echo ' <td width="20">&nbsp;</td>' . "\n";
} }
?> ?>
<!-- Space usage --> <!-- Space usage -->
<td valign="top"> <td valign="top">
@@ -567,20 +568,20 @@ if (MYSQL_INT_VERSION >= 32303 && $nonisam == FALSE) {
<td align="right" nowrap="nowrap"><?php echo $data_size; ?></td> <td align="right" nowrap="nowrap"><?php echo $data_size; ?></td>
<td><?php echo $data_unit; ?></td> <td><?php echo $data_unit; ?></td>
</tr> </tr>
<?php <?php
if (isset($index_size)) { if (isset($index_size)) {
echo "\n"; echo "\n";
?> ?>
<tr bgcolor="<?php echo $cfgBgcolorTwo; ?>"> <tr bgcolor="<?php echo $cfgBgcolorTwo; ?>">
<td style="padding-right: 10px"><?php echo ucfirst($strIndex); ?></td> <td style="padding-right: 10px"><?php echo ucfirst($strIndex); ?></td>
<td align="right" nowrap="nowrap"><?php echo $index_size; ?></td> <td align="right" nowrap="nowrap"><?php echo $index_size; ?></td>
<td><?php echo $index_unit; ?></td> <td><?php echo $index_unit; ?></td>
</tr> </tr>
<?php <?php
} }
if (isset($free_size)) { if (isset($free_size)) {
echo "\n"; echo "\n";
?> ?>
<tr bgcolor="<?php echo $cfgBgcolorTwo; ?>" style="color: #bb0000"> <tr bgcolor="<?php echo $cfgBgcolorTwo; ?>" style="color: #bb0000">
<td style="padding-right: 10px"><?php echo ucfirst($strOverhead); ?></td> <td style="padding-right: 10px"><?php echo ucfirst($strOverhead); ?></td>
<td align="right" nowrap="nowrap"><?php echo $free_size; ?></td> <td align="right" nowrap="nowrap"><?php echo $free_size; ?></td>
@@ -591,31 +592,31 @@ if (MYSQL_INT_VERSION >= 32303 && $nonisam == FALSE) {
<td align="right" nowrap="nowrap"><?php echo $effect_size; ?></td> <td align="right" nowrap="nowrap"><?php echo $effect_size; ?></td>
<td><?php echo $effect_unit; ?></td> <td><?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 bgcolor="<?php echo $cfgBgcolorOne; ?>"> <tr bgcolor="<?php echo $cfgBgcolorOne; ?>">
<td style="padding-right: 10px"><?php echo ucfirst($strTotal); ?></td> <td style="padding-right: 10px"><?php echo ucfirst($strTotal); ?></td>
<td align="right" nowrap="nowrap"><?php echo $tot_size; ?></td> <td align="right" nowrap="nowrap"><?php echo $tot_size; ?></td>
<td><?php echo $tot_unit; ?></td> <td><?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"> <td colspan="3" align="center">
[<a href="sql.php3?<?php echo $url_query; ?>&pos=0&sql_query=<?php echo urlencode('OPTIMIZE TABLE ' . backquote($table)); ?>"><?php echo $strOptimizeTable; ?></a>] [<a href="sql.php3?<?php echo $url_query; ?>&pos=0&sql_query=<?php echo urlencode('OPTIMIZE TABLE ' . backquote($table)); ?>"><?php echo $strOptimizeTable; ?></a>]
</td> </td>
<tr> <tr>
<?php <?php
} }
echo "\n"; echo "\n";
?> ?>
</table> </table>
</td> </td>
@@ -628,80 +629,81 @@ if (MYSQL_INT_VERSION >= 32303 && $nonisam == FALSE) {
<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'])) {
echo "\n"; echo "\n";
?> ?>
<tr bgcolor="<?php echo ((++$i%2) ? $cfgBgcolorTwo : $cfgBgcolorOne); ?>"> <tr bgcolor="<?php echo ((++$i%2) ? $cfgBgcolorTwo : $cfgBgcolorOne); ?>">
<td><?php echo ucfirst($strFormat); ?></td> <td><?php echo ucfirst($strFormat); ?></td>
<td align="right" nowrap="nowrap"> <td align="right" 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 (isset($showtable['Rows'])) { if (isset($showtable['Rows'])) {
echo "\n"; echo "\n";
?> ?>
<tr bgcolor="<?php echo ((++$i%2) ? $cfgBgcolorTwo : $cfgBgcolorOne); ?>"> <tr bgcolor="<?php echo ((++$i%2) ? $cfgBgcolorTwo : $cfgBgcolorOne); ?>">
<td><?php echo ucfirst($strRows); ?></td> <td><?php echo ucfirst($strRows); ?></td>
<td align="right" nowrap="nowrap"> <td 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 (isset($showtable['Avg_row_length']) && $showtable['Avg_row_length'] > 0) { if (isset($showtable['Avg_row_length']) && $showtable['Avg_row_length'] > 0) {
echo "\n"; echo "\n";
?> ?>
<tr bgcolor="<?php echo ((++$i%2) ? $cfgBgcolorTwo : $cfgBgcolorOne); ?>"> <tr bgcolor="<?php echo ((++$i%2) ? $cfgBgcolorTwo : $cfgBgcolorOne); ?>">
<td><?php echo ucfirst($strRowLength); ?>&nbsp;&oslash;</td> <td><?php echo ucfirst($strRowLength); ?>&nbsp;&oslash;</td>
<td align="right" nowrap="nowrap"> <td 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 (isset($showtable['Data_length']) && $showtable['Rows'] > 0 && $mergetable == FALSE) { if (isset($showtable['Data_length']) && $showtable['Rows'] > 0 && $mergetable == FALSE) {
echo "\n"; echo "\n";
?> ?>
<tr bgcolor="<?php echo ((++$i%2) ? $cfgBgcolorTwo : $cfgBgcolorOne); ?>"> <tr bgcolor="<?php echo ((++$i%2) ? $cfgBgcolorTwo : $cfgBgcolorOne); ?>">
<td><?php echo ucfirst($strRowSize); ?>&nbsp;&oslash;</td> <td><?php echo ucfirst($strRowSize); ?>&nbsp;&oslash;</td>
<td align="right" nowrap="nowrap"> <td 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'])) {
echo "\n"; echo "\n";
?> ?>
<tr bgcolor="<?php echo ((++$i%2) ? $cfgBgcolorTwo : $cfgBgcolorOne); ?>"> <tr bgcolor="<?php echo ((++$i%2) ? $cfgBgcolorTwo : $cfgBgcolorOne); ?>">
<td><?php echo ucfirst($strNext); ?>&nbsp;Autoindex</td> <td><?php echo ucfirst($strNext); ?>&nbsp;Autoindex</td>
<td align="right" nowrap="nowrap"> <td 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"; echo "\n";
?> ?>
</table> </table>
</td> </td>
<?php <?php
}
} }
// END - Calc Table Space // END - Calc Table Space
echo "\n"; echo "\n";