3 // vim: expandtab sw=4 ts=4 sts=4:
5 if (!defined('PMA_GRAB_GLOBALS_INCLUDED')) {
6 include('./libraries/grab_globals.lib.php3');
8 if (!defined('PMA_COMMON_LIB_INCLUDED')) {
9 include('./libraries/common.lib.php3');
11 if (PMA_MYSQL_INT_VERSION
>= 40100 && !defined('PMA_MYSQL_CHARSETS_LIB_INCLUDED')) {
12 include('./libraries/mysql_charsets.lib.php3');
16 * Drop multiple fields if required
19 // workaround for IE problem:
20 if (isset($submit_mult_change_x)) {
21 $submit_mult = $strChange;
23 if (isset($submit_mult_drop_x)) {
24 $submit_mult = $strDrop;
27 if ((!empty($submit_mult) && isset($selected_fld))
28 ||
isset($mult_btn)) {
29 $action = 'tbl_properties_structure.php3';
30 $err_url = 'tbl_properties_structure.php3?' . PMA_generate_common_url($db, $table);
31 include('./mult_submits.inc.php3');
37 require('./tbl_properties_common.php3');
38 $url_query .= '&goto=tbl_properties_structure.php3&back=tbl_properties_structure.php3';
41 * Prepares the table structure display
43 // 1. Get table information/display tabs
44 require('./tbl_properties_table_info.php3');
47 * Show result of multi submit operation
49 if ((!empty($submit_mult) && isset($selected_fld))
50 ||
isset($mult_btn)) {
51 PMA_showMessage($strSuccess);
54 // 2. Gets table keys and retains them
55 $local_query = 'SHOW KEYS FROM ' . PMA_backquote($table);
56 $result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
59 $pk_array = array(); // will be use to emphasis prim. keys in the table view
60 while ($row = PMA_mysql_fetch_array($result)) {
62 // Backups the list of primary keys
63 if ($row['Key_name'] == 'PRIMARY') {
64 $primary .= $row['Column_name'] . ', ';
65 $pk_array[$row['Column_name']] = 1;
68 mysql_free_result($result);
71 $local_query = 'SHOW FIELDS FROM ' . PMA_backquote($table);
72 $fields_rs = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
73 $fields_cnt = mysql_num_rows($fields_rs);
78 * Displays the table structure ('show table' works correct since 3.23.03)
82 <!-- TABLE INFORMATIONS
-->
84 <form method
="post" action
="tbl_properties_structure.php3" name
="fieldsForm">
85 <?php
echo PMA_generate_common_hidden_inputs($db, $table); ?
>
87 <table border
="<?php echo $cfg['Border']; ?>">
90 <th
> 
;<?php
echo $strField; ?
> 
;</th
>
91 <th
><?php
echo $strType; ?
></th
>
92 <?php
echo PMA_MYSQL_INT_VERSION
>= 40100 ?
' <th>' . $strCharset . '</th>' . "\n" : ''; ?
>
93 <th
><?php
echo $strAttr; ?
></th
>
94 <th
><?php
echo $strNull; ?
></th
>
95 <th
><?php
echo $strDefault; ?
></th
>
96 <th
><?php
echo $strExtra; ?
></th
>
97 <th colspan
="<?php echo((PMA_MYSQL_INT_VERSION >= 32323) ? '6' : '5'); ?>"><?php
echo $strAction; ?
></th
>
101 $comments_map = array();
104 if ($GLOBALS['cfg']['ShowPropertyComments']) {
105 require('./libraries/relation.lib.php3');
106 require('./libraries/transformations.lib.php3');
108 $cfgRelation = PMA_getRelationsParam();
111 if ($cfgRelation['commwork']) {
112 $comments_map = PMA_getComments($db, $table);
114 if ($cfgRelation['mimework'] && $cfg['BrowseMIME']) {
115 $mime_map = PMA_getMIME($db, $table, true);
121 $aryFields = array();
122 $checked = (!empty($checkall) ?
' checked="checked"' : '');
124 while ($row = PMA_mysql_fetch_array($fields_rs)) {
126 $bgcolor = ($i %
2) ?
$cfg['BgcolorOne'] : $cfg['BgcolorTwo'];
127 $aryFields[] = $row['Field'];
129 $type = $row['Type'];
130 // reformat mysql query output - staybyte - 9. June 2001
131 // loic1: set or enum types: slashes single quotes inside options
132 if (eregi('^(set|enum)\((.+)\)$', $type, $tmp)) {
133 $tmp[2] = substr(ereg_replace('([^,])\'\'', '\\1\\\'', ',' . $tmp[2]), 1);
134 $type = $tmp[1] . '(' . str_replace(',', ', ', $tmp[2]) . ')';
141 $type_nowrap = ' nowrap="nowrap"';
142 $type = eregi_replace('BINARY', '', $type);
143 $type = eregi_replace('ZEROFILL', '', $type);
144 $type = eregi_replace('UNSIGNED', '', $type);
149 $binary = eregi('BLOB', $row['Type'], $test) ||
eregi('BINARY', $row['Type'], $test);
150 $unsigned = eregi('UNSIGNED', $row['Type'], $test);
151 $zerofill = eregi('ZEROFILL', $row['Type'], $test);
154 // rabus: Devide charset from the rest of the type definition (MySQL >= 4.1)
155 unset($field_charset);
156 if (PMA_MYSQL_INT_VERSION
>= 40100) {
157 if ((substr($type, 0, 4) == 'char'
158 ||
substr($type, 0, 7) == 'varchar'
159 ||
substr($type, 0, 4) == 'text'
160 ||
substr($type, 0, 8) == 'tinytext'
161 ||
substr($type, 0, 10) == 'mediumtext'
162 ||
substr($type, 0, 8) == 'longtext'
163 ||
substr($type, 0, 3) == 'set'
164 ||
substr($type, 0, 4) == 'enum'
166 if (strpos($type, ' character set ')) {
167 $type = substr($type, 0, strpos($type, ' character set '));
169 if (!empty($row['Collation'])) {
170 $field_charset = $row['Collation'];
179 // garvin: Display basic mimetype [MIME]
180 if ($cfgRelation['commwork'] && $cfgRelation['mimework'] && $cfg['BrowseMIME'] && isset($mime_map[$row['Field']]['mimetype'])) {
181 $type_mime = '<br />MIME: ' . str_replace('_', '/', $mime_map[$row['Field']]['mimetype']);
186 $strAttribute = ' ';
188 $strAttribute = 'BINARY';
191 $strAttribute = 'UNSIGNED';
194 $strAttribute = 'UNSIGNED ZEROFILL';
196 if (!isset($row['Default'])) {
197 if ($row['Null'] != '') {
198 $row['Default'] = '<i>NULL</i>';
201 $row['Default'] = htmlspecialchars($row['Default']);
204 $field_encoded = urlencode($row['Field']);
205 $field_name = htmlspecialchars($row['Field']);
207 // garvin: underline commented fields and display a hover-title (CSS only)
210 if (isset($comments_map[$row['Field']])) {
211 $field_name = '<span style="border-bottom: 1px dashed black;" title="' . htmlspecialchars($comments_map[$row['Field']]) . '">' . $field_name . '</span>';
214 if (isset($pk_array[$row['Field']])) {
215 $field_name = '<u>' . $field_name . '</u>';
220 if ($cfg['PropertiesIconic'] == true) {
221 // We need to copy the value or else the == 'both' check will always return true
222 $propicon = (string)$cfg['PropertiesIconic'];
224 if ($propicon == 'both') {
225 $iconic_spacer = '<nobr>';
230 $titles['Change'] = $iconic_spacer . '<img hspace="7" width="12" height="13" src="images/button_edit.png" alt="' . $strChange . '" title="' . $strChange . '" border="0" />';
231 $titles['Drop'] = $iconic_spacer . '<img hspace="7" width="11" height="12" src="images/button_drop.png" alt="' . $strDrop . '" title="' . $strDrop . '" border="0" />';
232 $titles['NoDrop'] = $iconic_spacer . '<img hspace="7" width="11" height="13" src="images/button_drop.png" alt="' . $strDrop . '" title="' . $strDrop . '" border="0" />';
233 $titles['Primary'] = $iconic_spacer . '<img hspace="7" width="11" height="13" src="images/button_primary.png" alt="' . $strPrimary . '" title="' . $strPrimary . '" border="0" />';
234 $titles['Index'] = $iconic_spacer . '<img hspace="7" width="11" height="13" src="images/button_index.png" alt="' . $strIndex . '" title="' . $strIndex . '" border="0" />';
235 $titles['Unique'] = $iconic_spacer . '<img hspace="7" width="11" height="13" src="images/button_unique.png" alt="' . $strUnique . '" title="' . $strUnique . '" border="0" />';
236 $titles['IdxFulltext'] = $iconic_spacer . '<img hspace="7" width="11" height="13" src="images/button_fulltext.png" alt="' . $strIdxFulltext . '" title="' . $strIdxFulltext . '" border="0" />';
237 $titles['NoPrimary'] = $iconic_spacer . '<img hspace="7" width="11" height="13" src="images/button_noprimary.png" alt="' . $strPrimary . '" title="' . $strPrimary . '" border="0" />';
238 $titles['NoIndex'] = $iconic_spacer . '<img hspace="7" width="11" height="13" src="images/button_noindex.png" alt="' . $strIndex . '" title="' . $strIndex . '" border="0" />';
239 $titles['NoUnique'] = $iconic_spacer . '<img hspace="7" width="11" height="13" src="images/button_nounique.png" alt="' . $strUnique . '" title="' . $strUnique . '" border="0" />';
240 $titles['NoIdxFulltext'] = $iconic_spacer . '<img hspace="7" width="11" height="13" src="images/button_nofulltext.png" alt="' . $strIdxFulltext . '" title="' . $strIdxFulltext . '" border="0" />';
242 if ($propicon == 'both') {
243 $titles['Change'] .= ' ' . $strChange . '</nobr>';
244 $titles['Drop'] .= ' ' . $strDrop . '</nobr>';
245 $titles['NoDrop'] .= ' ' . $strDrop . '</nobr>';
246 $titles['Primary'] .= ' ' . $strPrimary . '</nobr>';
247 $titles['Index'] .= ' ' . $strIndex . '</nobr>';
248 $titles['Unique'] .= ' ' . $strUnique . '</nobr>';
249 $titles['IdxFulltext' ] .= ' ' . $strIdxFulltext . '</nobr>';
250 $titles['NoPrimary'] .= ' ' . $strPrimary . '</nobr>';
251 $titles['NoIndex'] .= ' ' . $strIndex . '</nobr>';
252 $titles['NoUnique'] .= ' ' . $strUnique . '</nobr>';
253 $titles['NoIdxFulltext'] .= ' ' . $strIdxFulltext . '</nobr>';
256 $titles['Change'] = $strChange;
257 $titles['Drop'] = $strDrop;
258 $titles['NoDrop'] = $strDrop;
259 $titles['Primary'] = $strPrimary;
260 $titles['Index'] = $strIndex;
261 $titles['Unique'] = $strUnique;
262 $titles['IdxFulltext'] = $strIdxFulltext;
263 $titles['NoPrimary'] = $strPrimary;
264 $titles['NoIndex'] = $strIndex;
265 $titles['NoUnique'] = $strUnique;
266 $titles['NoIdxFulltext'] = $strIdxFulltext;
271 <td align
="center" bgcolor
="<?php echo $bgcolor; ?>">
272 <input type
="checkbox" name
="selected_fld[]" value
="<?php echo $field_encoded; ?>" id
="checkbox_row_<?php echo $i; ?>" <?php
echo $checked; ?
> />
274 <td bgcolor
="<?php echo $bgcolor; ?>" nowrap
="nowrap"> 
;<label
for="checkbox_row_<?php echo $i; ?>"><?php
echo $field_name; ?
></label
> 
;</td
>
275 <td bgcolor
="<?php echo $bgcolor; ?>"<?php
echo $type_nowrap; ?
>><?php
echo $type; echo $type_mime; ?
><bdo dir
="ltr"></bdo
></td
>
276 <?php
echo PMA_MYSQL_INT_VERSION
>= 40100 ?
' <td bgcolor="' . $bgcolor . '">' . (empty($field_charset) ?
' ' : '<dfn title="' . PMA_getCollationDescr($field_charset) . '">' . $field_charset . '</dfn>') . '</td>' . "\n" : '' ?
>
277 <td bgcolor
="<?php echo $bgcolor; ?>" nowrap
="nowrap"><?php
echo $strAttribute; ?
></td
>
278 <td bgcolor
="<?php echo $bgcolor; ?>"><?php
echo (($row['Null'] == '') ?
$strNo : $strYes); ?
> 
;</td
>
279 <td bgcolor
="<?php echo $bgcolor; ?>" nowrap
="nowrap"><?php
if (isset($row['Default'])) echo $row['Default']; ?
> 
;</td
>
280 <td bgcolor
="<?php echo $bgcolor; ?>" nowrap
="nowrap"><?php
echo $row['Extra']; ?
> 
;</td
>
281 <td align
="center" bgcolor
="<?php echo $bgcolor; ?>">
282 <a href
="tbl_alter.php3?<?php echo $url_query; ?>&field=<?php echo $field_encoded; ?>">
283 <?php
echo $titles['Change']; ?
></a
>
285 <td align
="center" bgcolor
="<?php echo $bgcolor; ?>">
287 // loic1: Drop field only if there is more than one field in the table
288 if ($fields_cnt > 1) {
291 <a href
="sql.php3?<?php echo $url_query; ?>&sql_query=<?php echo urlencode('ALTER TABLE ' . PMA_backquote($table) . ' DROP ' . PMA_backquote($row['Field'])); ?>&cpurge=1&purgekey=<?php echo urlencode($row['Field']); ?>&zero_rows=<?php echo urlencode(sprintf($strFieldHasBeenDropped, htmlspecialchars($row['Field']))); ?>"
292 onclick
="return confirmLink(this, 'ALTER TABLE <?php echo PMA_jsFormat($table); ?> DROP <?php echo PMA_jsFormat($row['Field']); ?>')">
293 <?php
echo $titles['Drop']; ?
></a
>
296 echo "\n" . ' ' . $titles['NoDrop'];
301 <td align
="center" bgcolor
="<?php echo $bgcolor; ?>">
303 if ($type == 'text' ||
$type == 'blob') {
304 echo $titles['NoPrimary'] . "\n";
308 <a href
="sql.php3?<?php echo $url_query; ?>&sql_query=<?php echo urlencode('ALTER TABLE ' . PMA_backquote($table) . ' DROP PRIMARY KEY, ADD PRIMARY KEY(' . $primary . PMA_backquote($row['Field']) . ')'); ?>&zero_rows=<?php echo urlencode(sprintf($strAPrimaryKey, htmlspecialchars($row['Field']))); ?>"
309 onclick
="return confirmLink(this, 'ALTER TABLE <?php echo PMA_jsFormat($table); ?> DROP PRIMARY KEY, ADD PRIMARY KEY(<?php echo PMA_jsFormat($row['Field']); ?>)')">
310 <?php
echo $titles['Primary']; ?
></a
>
316 <td align
="center" bgcolor
="<?php echo $bgcolor; ?>">
318 if ($type == 'text' ||
$type == 'blob') {
319 echo $titles['NoIndex'] . "\n";
323 <a href
="sql.php3?<?php echo $url_query; ?>&sql_query=<?php echo urlencode('ALTER TABLE ' . PMA_backquote($table) . ' ADD INDEX(' . PMA_backquote($row['Field']) . ')'); ?>&zero_rows=<?php echo urlencode(sprintf($strAnIndex ,htmlspecialchars($row['Field']))); ?>">
324 <?php
echo $titles['Index']; ?
></a
>
330 <td align
="center" bgcolor
="<?php echo $bgcolor; ?>">
332 if ($type == 'text' ||
$type == 'blob') {
333 echo $titles['NoUnique'] . "\n";
337 <a href
="sql.php3?<?php echo $url_query; ?>&sql_query=<?php echo urlencode('ALTER TABLE ' . PMA_backquote($table) . ' ADD UNIQUE(' . PMA_backquote($row['Field']) . ')'); ?>&zero_rows=<?php echo urlencode(sprintf($strAnIndex , htmlspecialchars($row['Field']))); ?>">
338 <?php
echo $titles['Unique']; ?
></a
>
345 if (PMA_MYSQL_INT_VERSION
>= 32323) {
346 if ((!empty($tbl_type) && $tbl_type == 'MYISAM')
347 && ($type == 'text' ||
strpos(' ' . $type, 'varchar'))) {
350 <td align
="center" bgcolor
="<?php echo $bgcolor; ?>" nowrap
="nowrap">
351 <a href
="sql.php3?<?php echo $url_query; ?>&sql_query=<?php echo urlencode('ALTER TABLE ' . PMA_backquote($table) . ' ADD FULLTEXT(' . PMA_backquote($row['Field']) . ')'); ?>&zero_rows=<?php echo urlencode(sprintf($strAnIndex , htmlspecialchars($row['Field']))); ?>">
352 <?php
echo $titles['IdxFulltext']; ?
></a
>
358 <td align
="center" bgcolor
="<?php echo $bgcolor; ?>" nowrap
="nowrap">
359 <?php
echo $titles['NoIdxFulltext'] . "\n"; ?
>
362 } // end if... else...
368 unset($field_charset);
373 $checkall_url = 'tbl_properties_structure.php3?' . PMA_generate_common_url($db,$table);
377 <td colspan
="<?php echo PMA_MYSQL_INT_VERSION >= 40100 ? '14' : (PMA_MYSQL_INT_VERSION >= 32323 ? '13' : '12'); ?>">
381 <img src
="./images/arrow_<?php echo $text_dir; ?>.gif" border
="0" width
="38" height
="22" alt
="<?php echo $strWithChecked; ?>" />
382 <a href
="<?php echo $checkall_url; ?>&checkall=1" onclick
="setCheckboxes('fieldsForm', true); return false;">
383 <?php
echo $strCheckAll; ?
></a
>
385 <a href
="<?php echo $checkall_url; ?>" onclick
="setCheckboxes('fieldsForm', false); return false;">
386 <?php
echo $strUncheckAll; ?
></a
>
388 <i
><?php
echo $strWithChecked; ?
></i
> 
; 
;
393 if ($cfg['PropertiesIconic']) {
394 /* Opera has trouble with <input type="image"> */
395 /* IE has trouble with <button> */
396 if (PMA_USR_BROWSER_AGENT
!= 'IE') {
397 echo '<button class="mult_submit" type="submit" name="submit_mult" value="' . $strChange . '" title="' . $strChange . '">' . "\n"
398 . '<img src="./images/button_edit.png" title="' . $strChange . '" alt="' . $strChange . '" width="12" height="13" />' . (($propicon == 'both') ?
' ' . $strChange : '') . "\n"
399 . '</button>' . "\n";
401 echo ' <input type="image" name="submit_mult_change" value="' .$strChange . '" title="' . $strChange . '" src="./images/button_edit.png" />' . (($propicon == 'both') ?
' ' . $strChange : '') . "\n";
403 // Drop button if there is at least two fields
404 if ($fields_cnt > 1) {
405 if (PMA_USR_BROWSER_AGENT
!= 'IE') {
406 echo ' <button class="mult_submit" type="submit" name="submit_mult" value="' . $strDrop . '" title="' . $strDrop . '">' . "\n"
407 . '<img src="./images/button_drop.png" title="' . $strDrop . '" alt="' . $strDrop . '" width="11" height="13" />' . (($propicon == 'both') ?
' ' . $strDrop : '') . "\n"
408 . '</button>' . "\n";
410 echo ' <input type="image" name="submit_mult_drop" value="' .$strDrop . '" title="' . $strDrop . '" src="./images/button_drop.png" />' . (($propicon == 'both') ?
' ' . $strDrop : '') . "\n";
414 echo ' <input type="submit" name="submit_mult" value="' . $strChange . '" title="' . $strChange . '" />' . "\n";
415 // Drop button if there is at least two fields
416 if ($fields_cnt > 1) {
417 echo ' <i>' . $strOr . '</i> ' . "\n"
418 . ' <input type="submit" name="submit_mult" value="' . $strDrop . '" title="' . $strDrop . '" />' . "\n";
435 * If there are more than 20 rows, displays browse/select/insert/empty/drop
438 if ($fields_cnt > 20) {
440 <!-- Browse links
-->
443 include('./tbl_properties_links.php3');
444 } // end if ($fields_cnt > 20)
452 <!-- Indexes
, space usage
and row statistics
-->
454 <table border
="0" cellspacing
="0" cellpadding
="0">
458 define('PMA_IDX_INCLUDED', 1);
459 require ('./tbl_indexes.php3');
465 * Displays Space usage and row statistics
467 // BEGIN - Calc Table Space - staybyte - 9 June 2001
468 // loic1, 22 feb. 2002: updated with patch from
469 // Joshua Nye <josh at boxcarmedia.com> to get valid
470 // statistics whatever is the table type
471 if ($cfg['ShowStats']) {
473 $is_innodb = (isset($showtable['Type']) && $showtable['Type'] == 'InnoDB');
474 if (isset($showtable['Type']) && !eregi('ISAM|HEAP', $showtable['Type'])) {
477 if (PMA_MYSQL_INT_VERSION
>= 32303 && ($nonisam == FALSE ||
$is_innodb)) {
480 if (isset($showtable['Type']) && $showtable['Type'] == 'MRG_MyISAM') {
483 list($data_size, $data_unit) = PMA_formatByteDown($showtable['Data_length']);
484 if ($mergetable == FALSE) {
485 list($index_size, $index_unit) = PMA_formatByteDown($showtable['Index_length']);
487 if (isset($showtable['Data_free']) && $showtable['Data_free'] > 0) {
488 list($free_size, $free_unit) = PMA_formatByteDown($showtable['Data_free']);
489 list($effect_size, $effect_unit) = PMA_formatByteDown($showtable['Data_length'] +
$showtable['Index_length'] - $showtable['Data_free']);
491 list($effect_size, $effect_unit) = PMA_formatByteDown($showtable['Data_length'] +
$showtable['Index_length']);
493 list($tot_size, $tot_unit) = PMA_formatByteDown($showtable['Data_length'] +
$showtable['Index_length']);
494 if ($table_info_num_rows > 0) {
495 list($avg_size, $avg_unit) = PMA_formatByteDown(($showtable['Data_length'] +
$showtable['Index_length']) / $showtable['Rows'], 6, 1);
502 <td width
="20"> 
;</td
>
504 <?php
echo $strSpaceUsage . ' :' . "\n"; ?
>
505 <a name
="showusage"></a
>
506 <table border
="<?php echo $cfg['Border']; ?>">
508 <th
><?php
echo $strType; ?
></th
>
509 <th colspan
="2" align
="center"><?php
echo $strUsage; ?
></th
>
512 <td bgcolor
="<?php echo $cfg['BgcolorTwo']; ?>" style
="padding-right: 10px"><?php
echo $strData; ?
></td
>
513 <td bgcolor
="<?php echo $cfg['BgcolorTwo']; ?>" align
="right" nowrap
="nowrap"><?php
echo $data_size; ?
></td
>
514 <td bgcolor
="<?php echo $cfg['BgcolorTwo']; ?>"><?php
echo $data_unit; ?
></td
>
517 if (isset($index_size)) {
521 <td bgcolor
="<?php echo $cfg['BgcolorTwo']; ?>" style
="padding-right: 10px"><?php
echo $strIndex; ?
></td
>
522 <td bgcolor
="<?php echo $cfg['BgcolorTwo']; ?>" align
="right" nowrap
="nowrap"><?php
echo $index_size; ?
></td
>
523 <td bgcolor
="<?php echo $cfg['BgcolorTwo']; ?>"><?php
echo $index_unit; ?
></td
>
527 if (isset($free_size)) {
530 <tr style
="color: #bb0000">
531 <td bgcolor
="<?php echo $cfg['BgcolorTwo']; ?>" style
="padding-right: 10px"><?php
echo $strOverhead; ?
></td
>
532 <td bgcolor
="<?php echo $cfg['BgcolorTwo']; ?>" align
="right" nowrap
="nowrap"><?php
echo $free_size; ?
></td
>
533 <td bgcolor
="<?php echo $cfg['BgcolorTwo']; ?>"><?php
echo $free_unit; ?
></td
>
536 <td bgcolor
="<?php echo $cfg['BgcolorOne']; ?>" style
="padding-right: 10px"><?php
echo $strEffective; ?
></td
>
537 <td bgcolor
="<?php echo $cfg['BgcolorOne']; ?>" align
="right" nowrap
="nowrap"><?php
echo $effect_size; ?
></td
>
538 <td bgcolor
="<?php echo $cfg['BgcolorOne']; ?>"><?php
echo $effect_unit; ?
></td
>
542 if (isset($tot_size) && $mergetable == FALSE) {
546 <td bgcolor
="<?php echo $cfg['BgcolorOne']; ?>" style
="padding-right: 10px"><?php
echo $strTotalUC; ?
></td
>
547 <td bgcolor
="<?php echo $cfg['BgcolorOne']; ?>" align
="right" nowrap
="nowrap"><?php
echo $tot_size; ?
></td
>
548 <td bgcolor
="<?php echo $cfg['BgcolorOne']; ?>"><?php
echo $tot_unit; ?
></td
>
552 // Optimize link if overhead
553 if (isset($free_size) && ($tbl_type == 'MYISAM' ||
$tbl_type == 'BDB')) {
557 <td colspan
="3" align
="center">
558 [<a href
="sql.php3?<?php echo $url_query; ?>&pos=0&sql_query=<?php echo urlencode('OPTIMIZE TABLE ' . PMA_backquote($table)); ?>"><?php
echo $strOptimizeTable; ?
></a
>]
568 <!-- Rows Statistic
-->
569 <td width
="20"> 
;</td
>
571 <?php
echo $strRowsStatistic . ' :' . "\n"; ?
>
572 <table border
="<?php echo $cfg['Border']; ?>">
574 <th
><?php
echo $strStatement; ?
></th
>
575 <th align
="center"><?php
echo $strValue; ?
></th
>
579 if (isset($showtable['Row_format'])) {
580 $bgcolor = ((++
$i%2
) ?
$cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
584 <td bgcolor
="<?php echo $bgcolor; ?>"><?php
echo $strFormat; ?
></td
>
585 <td bgcolor
="<?php echo $bgcolor; ?>" align
="<?php echo $cell_align_left; ?>" nowrap
="nowrap">
588 if ($showtable['Row_format'] == 'Fixed') {
591 else if ($showtable['Row_format'] == 'Dynamic') {
595 echo $showtable['Row_format'];
603 if (PMA_MYSQL_INT_VERSION
>= 40100) {
604 $bgcolor = ((++
$i%2
) ?
$cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
607 <td bgcolor
="<?php echo $bgcolor; ?>"><?php
echo $strCharset; ?
></td
>
608 <td bgcolor
="<?php echo $bgcolor; ?>" align
="<?php echo $cell_align_left; ?>" nowrap
="nowrap">
610 echo '<dfn title="' . PMA_getCollationDescr($tbl_charset) . '">' . $tbl_charset . '</dfn>';
616 if (!$is_innodb && isset($showtable['Rows'])) {
617 $bgcolor = ((++
$i%2
) ?
$cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
621 <td bgcolor
="<?php echo $bgcolor; ?>"><?php
echo $strRows; ?
></td
>
622 <td bgcolor
="<?php echo $bgcolor; ?>" align
="right" nowrap
="nowrap">
623 <?php
echo number_format($showtable['Rows'], 0, $number_decimal_separator, $number_thousands_separator) . "\n"; ?
>
628 if (!$is_innodb && isset($showtable['Avg_row_length']) && $showtable['Avg_row_length'] > 0) {
629 $bgcolor = ((++
$i%2
) ?
$cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
633 <td bgcolor
="<?php echo $bgcolor; ?>"><?php
echo $strRowLength; ?
> 
;ø
;</td
>
634 <td bgcolor
="<?php echo $bgcolor; ?>" align
="right" nowrap
="nowrap">
635 <?php
echo number_format($showtable['Avg_row_length'], 0, $number_decimal_separator, $number_thousands_separator) . "\n"; ?
>
640 if (!$is_innodb && isset($showtable['Data_length']) && $showtable['Rows'] > 0 && $mergetable == FALSE) {
641 $bgcolor = ((++
$i%2
) ?
$cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
645 <td bgcolor
="<?php echo $bgcolor; ?>"><?php
echo $strRowSize; ?
> 
;ø
;</td
>
646 <td bgcolor
="<?php echo $bgcolor; ?>" align
="right" nowrap
="nowrap">
647 <?php
echo $avg_size . ' ' . $avg_unit . "\n"; ?
>
652 if (isset($showtable['Auto_increment'])) {
653 $bgcolor = ((++
$i%2
) ?
$cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
657 <td bgcolor
="<?php echo $bgcolor; ?>"><?php
echo $strNext; ?
> 
;Autoindex
</td
>
658 <td bgcolor
="<?php echo $bgcolor; ?>" align
="right" nowrap
="nowrap">
659 <?php
echo number_format($showtable['Auto_increment'], 0, $number_decimal_separator, $number_thousands_separator) . "\n"; ?
>
666 if (isset($showtable['Create_time'])) {
667 $bgcolor = ((++
$i%2
) ?
$cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
671 <td bgcolor
="<?php echo $bgcolor; ?>"><?php
echo $strStatCreateTime; ?
></td
>
672 <td style
="font-size: <?php echo $font_smaller; ?>" align
="right" bgcolor
="<?php echo $bgcolor; ?>" nowrap
="nowrap">
673 <?php
echo PMA_localisedDate(strtotime($showtable['Create_time'])) . "\n"; ?
>
680 if (isset($showtable['Update_time'])) {
681 $bgcolor = ((++
$i%2
) ?
$cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
685 <td bgcolor
="<?php echo $bgcolor; ?>"><?php
echo $strStatUpdateTime; ?
></td
>
686 <td style
="font-size: <?php echo $font_smaller; ?>" align
="right" bgcolor
="<?php echo $bgcolor; ?>" nowrap
="nowrap">
687 <?php
echo PMA_localisedDate(strtotime($showtable['Update_time'])) . "\n"; ?
>
694 if (isset($showtable['Check_time'])) {
695 $bgcolor = ((++
$i%2
) ?
$cfg['BgcolorTwo'] : $cfg['BgcolorOne']);
699 <td bgcolor
="<?php echo $bgcolor; ?>"><?php
echo $strStatCheckTime; ?
></td
>
700 <td style
="font-size: <?php echo $font_smaller; ?>" align
="right" bgcolor
="<?php echo $bgcolor; ?>" nowrap
="nowrap">
701 <?php
echo PMA_localisedDate(strtotime($showtable['Check_time'])) . "\n"; ?
>
713 // END - Calc Table Space
729 <!-- Printable view of the table
-->
731 <div style
="margin-bottom: 10px"><a href
="tbl_printview.php3?<?php echo $url_query; ?>"><?php
echo $strPrintView; ?
></a
></div
>
734 <!-- Add some
new fields
-->
736 <form method
="post" action
="tbl_addfield.php3"
737 onsubmit
="return checkFormElementInRange(this, 'num_fields', 1)">
738 <?php
echo PMA_generate_common_hidden_inputs($db, $table); ?
>
739 <?php
echo $strAddNewField; ?
> 
;:
740 <input type
="text" name
="num_fields" size
="2" maxlength
="2" value
="1" class="textfield" style
="vertical-align: middle" onfocus
="this.select()" />
741 <select name
="after_field" style
="vertical-align: middle">
742 <option value
="--end--"><?php
echo $strAtEndOfTable; ?
></option
>
743 <option value
="--first--"><?php
echo $strAtBeginningOfTable; ?
></option
>
746 while (list($junk, $fieldname) = each($aryFields)) {
747 echo ' <option value="' . htmlspecialchars($fieldname) . '">' . sprintf($strAfter, htmlspecialchars($fieldname)) . '</option>' . "\n";
752 <input type
="submit" value
="<?php echo $strGo; ?>" style
="vertical-align: middle" />
757 if ($cfg['Server']['relation']) {
759 <!-- Work on Relations
-->
761 <div style
="margin-bottom: 10px">
762 <a href
="tbl_relation.php3?<?php echo $url_query; ?>"><?php
echo $strRelationView; ?
></a
>
770 <!-- Let MySQL propose the optimal structure
-->
772 <div style
="margin-bottom: 10px">
773 <a href
="sql.php3?<?php echo $url_query; ?>&session_max_rows=all&sql_query=<?php echo urlencode('SELECT * FROM ' . PMA_backquote($table) . ' PROCEDURE ANALYSE()'); ?>">
774 <?php
echo $strStructPropose; ?
></a
>
775 <?php
echo PMA_showMySQLDocu('Extending_MySQL', 'procedure_analyse') . "\n"; ?
>
781 * Query box, bookmark, insert data from textfile
783 $goto = 'tbl_properties_structure.php3';
784 require('./tbl_query_box.php3');
792 * Displays the footer
795 require('./footer.inc.php3');