13
13
// workaround for IE problem:
14
14
if (isset($submit_mult_change_x)) {
15
15
$submit_mult = $strChange;
17
if (isset($submit_mult_drop_x)) {
16
} elseif (isset($submit_mult_drop_x)) {
18
17
$submit_mult = $strDrop;
18
} elseif (isset($submit_mult_primary_x)) {
19
$submit_mult = $strPrimary;
20
} elseif (isset($submit_mult_index_x)) {
21
$submit_mult = $strIndex;
22
} elseif (isset($submit_mult_unique_x)) {
23
$submit_mult = $strUnique;
24
} elseif (isset($submit_mult_fulltext_x)) {
25
$submit_mult = $strIdxFulltext;
21
28
if ((!empty($submit_mult) && isset($selected_fld))
43
53
if ((!empty($submit_mult) && isset($selected_fld))
44
54
|| isset($mult_btn)) {
45
PMA_showMessage($strSuccess);
55
$message = $strSuccess;
59
* Displays top menu links
61
require('./tbl_properties_links.php');
48
63
// 2. Gets table keys and retains them
49
$local_query = 'SHOW KEYS FROM ' . PMA_backquote($table);
50
$result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
64
$result = PMA_DBI_query('SHOW KEYS FROM ' . PMA_backquote($table) . ';');
52
66
$ret_keys = array();
53
67
$pk_array = array(); // will be use to emphasis prim. keys in the table view
54
while ($row = PMA_mysql_fetch_array($result)) {
68
while ($row = PMA_DBI_fetch_assoc($result)) {
55
69
$ret_keys[] = $row;
56
70
// Backups the list of primary keys
57
71
if ($row['Key_name'] == 'PRIMARY') {
59
73
$pk_array[$row['Column_name']] = 1;
62
mysql_free_result($result);
76
PMA_DBI_free_result($result);
65
$local_query = 'SHOW FULL FIELDS FROM ' . PMA_backquote($table);
66
$fields_rs = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
67
$fields_cnt = mysql_num_rows($fields_rs);
79
$fields_rs = PMA_DBI_query('SHOW FULL FIELDS FROM ' . PMA_backquote($table) . ';', NULL, PMA_DBI_QUERY_STORE);
80
$fields_cnt = PMA_DBI_num_rows($fields_rs);
78
91
<form method="post" action="tbl_properties_structure.php" name="fieldsForm">
79
92
<?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
81
<table border="<?php echo $cfg['Border']; ?>">
93
<table border="<?php echo $cfg['Border']; ?>" cellpadding="2" cellspacing="1">
84
<th> <?php echo $strField; ?> </th>
85
<th><?php echo $strType; ?></th>
95
<th id="th1"> </th>
96
<th id="th2"> <?php echo $strField; ?> </th>
97
<th id="th3"><?php echo $strType; ?></th>
86
98
<?php echo PMA_MYSQL_INT_VERSION >= 40100 ? ' <th>' . $strCollation . '</th>' . "\n" : ''; ?>
87
<th><?php echo $strAttr; ?></th>
88
<th><?php echo $strNull; ?></th>
89
<th><?php echo $strDefault; ?></th>
90
<th><?php echo $strExtra; ?></th>
91
<th colspan="6"><?php echo $strAction; ?></th>
99
<th id="th4"><?php echo $strAttr; ?></th>
100
<th id="th5"><?php echo $strNull; ?></th>
101
<th id="th6"><?php echo $strDefault; ?></th>
102
<th id="th7"><?php echo $strExtra; ?></th>
103
<th colspan="6" id="th8"><?php echo $strAction; ?></th>
115
127
$aryFields = array();
116
128
$checked = (!empty($checkall) ? ' checked="checked"' : '');
118
while ($row = PMA_mysql_fetch_array($fields_rs)) {
131
while ($row = PMA_DBI_fetch_assoc($fields_rs)) {
120
134
$bgcolor = ($i % 2) ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo'];
121
135
$aryFields[] = $row['Field'];
137
if ($GLOBALS['cfg']['BrowsePointerEnable'] == TRUE) {
138
$on_mouse = ' onmouseover="setPointer(this, ' . $i . ', \'over\', \'' . $bgcolor . '\', \'' . $GLOBALS['cfg']['BrowsePointerColor'] . '\', \'' . $GLOBALS['cfg']['BrowseMarkerColor'] . '\');"'
139
. ' onmouseout="setPointer(this, ' . $i . ', \'out\', \'' . $bgcolor . '\', \'' . $GLOBALS['cfg']['BrowsePointerColor'] . '\', \'' . $GLOBALS['cfg']['BrowseMarkerColor'] . '\');"';
143
if ($GLOBALS['cfg']['BrowseMarkerEnable'] == TRUE) {
144
$on_mouse .= ' onmousedown="setPointer(this, ' . $i . ', \'click\', \'' . $bgcolor . '\', \'' . $GLOBALS['cfg']['BrowsePointerColor'] . '\', \'' . $GLOBALS['cfg']['BrowseMarkerColor'] . '\');"';
147
$click_mouse = ' onmousedown="document.getElementById(\'checkbox_row_' . $i . '\').checked = (document.getElementById(\'checkbox_row_' . $i . '\').checked ? false : true);" ';
123
149
$type = $row['Type'];
124
150
// reformat mysql query output - staybyte - 9. June 2001
125
151
// loic1: set or enum types: slashes single quotes inside options
135
161
$type_nowrap = ' nowrap="nowrap"';
136
$type = preg_replace('@BINARY@i', '', $type);
162
// strip the "BINARY" attribute, except if we find "BINARY(" because
163
// this would be a BINARY or VARBINARY field type
164
if (!preg_match('@BINARY[\(]@i', $type)) {
165
$type = preg_replace('@BINARY@i', '', $type);
137
167
$type = preg_replace('@ZEROFILL@i', '', $type);
138
168
$type = preg_replace('@UNSIGNED@i', '', $type);
139
169
if (empty($type)) {
140
170
$type = ' ';
143
$binary = stristr($row['Type'], 'blob') || stristr($row['Type'], 'binary');
173
if (!preg_match('@BINARY[\(]@i', $row['Type'])) {
174
$binary = stristr($row['Type'], 'blob') || stristr($row['Type'], 'binary');
144
179
$unsigned = stristr($row['Type'], 'unsigned');
145
180
$zerofill = stristr($row['Type'], 'zerofill');
216
251
$propicon = (string)$cfg['PropertiesIconic'];
218
253
if ($propicon == 'both') {
219
$iconic_spacer = '<nobr>';
254
$iconic_spacer = '<div class="nowrap">';
221
256
$iconic_spacer = '';
224
$titles['Change'] = $iconic_spacer . '<img hspace="7" width="12" height="13" src="images/button_edit.png" alt="' . $strChange . '" title="' . $strChange . '" border="0" />';
225
$titles['Drop'] = $iconic_spacer . '<img hspace="7" width="11" height="12" src="images/button_drop.png" alt="' . $strDrop . '" title="' . $strDrop . '" border="0" />';
226
$titles['NoDrop'] = $iconic_spacer . '<img hspace="7" width="11" height="13" src="images/button_drop.png" alt="' . $strDrop . '" title="' . $strDrop . '" border="0" />';
227
$titles['Primary'] = $iconic_spacer . '<img hspace="7" width="11" height="13" src="images/button_primary.png" alt="' . $strPrimary . '" title="' . $strPrimary . '" border="0" />';
228
$titles['Index'] = $iconic_spacer . '<img hspace="7" width="11" height="13" src="images/button_index.png" alt="' . $strIndex . '" title="' . $strIndex . '" border="0" />';
229
$titles['Unique'] = $iconic_spacer . '<img hspace="7" width="11" height="13" src="images/button_unique.png" alt="' . $strUnique . '" title="' . $strUnique . '" border="0" />';
230
$titles['IdxFulltext'] = $iconic_spacer . '<img hspace="7" width="11" height="13" src="images/button_fulltext.png" alt="' . $strIdxFulltext . '" title="' . $strIdxFulltext . '" border="0" />';
231
$titles['NoPrimary'] = $iconic_spacer . '<img hspace="7" width="11" height="13" src="images/button_noprimary.png" alt="' . $strPrimary . '" title="' . $strPrimary . '" border="0" />';
232
$titles['NoIndex'] = $iconic_spacer . '<img hspace="7" width="11" height="13" src="images/button_noindex.png" alt="' . $strIndex . '" title="' . $strIndex . '" border="0" />';
233
$titles['NoUnique'] = $iconic_spacer . '<img hspace="7" width="11" height="13" src="images/button_nounique.png" alt="' . $strUnique . '" title="' . $strUnique . '" border="0" />';
234
$titles['NoIdxFulltext'] = $iconic_spacer . '<img hspace="7" width="11" height="13" src="images/button_nofulltext.png" alt="' . $strIdxFulltext . '" title="' . $strIdxFulltext . '" border="0" />';
259
// images replaced 2004-05-08 by mkkeck
260
$titles['Change'] = $iconic_spacer . '<img hspace="2" width="16" height="16" src="' . $pmaThemeImage . 'b_edit.png" alt="' . $strChange . '" title="' . $strChange . '" border="0" />';
261
$titles['Drop'] = $iconic_spacer . '<img hspace="2" width="16" height="16" src="' . $pmaThemeImage . 'b_drop.png" alt="' . $strDrop . '" title="' . $strDrop . '" border="0" />';
262
$titles['NoDrop'] = $iconic_spacer . '<img hspace="2" width="16" height="16" src="' . $pmaThemeImage . 'b_drop.png" alt="' . $strDrop . '" title="' . $strDrop . '" border="0" />';
263
$titles['Primary'] = $iconic_spacer . '<img hspace="2" width="16" height="16" src="' . $pmaThemeImage . 'b_primary.png" alt="' . $strPrimary . '" title="' . $strPrimary . '" border="0" />';
264
$titles['Index'] = $iconic_spacer . '<img hspace="2" width="16" height="16" src="' . $pmaThemeImage . 'b_index.png" alt="' . $strIndex . '" title="' . $strIndex . '" border="0" />';
265
$titles['Unique'] = $iconic_spacer . '<img hspace="2" width="16" height="16" src="' . $pmaThemeImage . 'b_unique.png" alt="' . $strUnique . '" title="' . $strUnique . '" border="0" />';
266
$titles['IdxFulltext'] = $iconic_spacer . '<img hspace="2" width="16" height="16" src="' . $pmaThemeImage . 'b_ftext.png" alt="' . $strIdxFulltext . '" title="' . $strIdxFulltext . '" border="0" />';
267
$titles['NoPrimary'] = $iconic_spacer . '<img hspace="2" width="16" height="16" src="' . $pmaThemeImage . 'bd_primary.png" alt="' . $strPrimary . '" title="' . $strPrimary . '" border="0" />';
268
$titles['NoIndex'] = $iconic_spacer . '<img hspace="2" width="16" height="16" src="' . $pmaThemeImage . 'bd_index.png" alt="' . $strIndex . '" title="' . $strIndex . '" border="0" />';
269
$titles['NoUnique'] = $iconic_spacer . '<img hspace="2" width="16" height="16" src="' . $pmaThemeImage . 'bd_unique.png" alt="' . $strUnique . '" title="' . $strUnique . '" border="0" />';
270
$titles['NoIdxFulltext'] = $iconic_spacer . '<img hspace="2" width="16" height="16" src="' . $pmaThemeImage . 'bd_ftext.png" alt="' . $strIdxFulltext . '" title="' . $strIdxFulltext . '" border="0" />';
236
272
if ($propicon == 'both') {
237
$titles['Change'] .= ' ' . $strChange . '</nobr>';
238
$titles['Drop'] .= ' ' . $strDrop . '</nobr>';
239
$titles['NoDrop'] .= ' ' . $strDrop . '</nobr>';
240
$titles['Primary'] .= ' ' . $strPrimary . '</nobr>';
241
$titles['Index'] .= ' ' . $strIndex . '</nobr>';
242
$titles['Unique'] .= ' ' . $strUnique . '</nobr>';
243
$titles['IdxFulltext' ] .= ' ' . $strIdxFulltext . '</nobr>';
244
$titles['NoPrimary'] .= ' ' . $strPrimary . '</nobr>';
245
$titles['NoIndex'] .= ' ' . $strIndex . '</nobr>';
246
$titles['NoUnique'] .= ' ' . $strUnique . '</nobr>';
247
$titles['NoIdxFulltext'] .= ' ' . $strIdxFulltext . '</nobr>';
273
$titles['Change'] .= ' ' . $strChange . '</div>';
274
$titles['Drop'] .= ' ' . $strDrop . '</div>';
275
$titles['NoDrop'] .= ' ' . $strDrop . '</div>';
276
$titles['Primary'] .= ' ' . $strPrimary . '</div>';
277
$titles['Index'] .= ' ' . $strIndex . '</div>';
278
$titles['Unique'] .= ' ' . $strUnique . '</div>';
279
$titles['IdxFulltext' ] .= ' ' . $strIdxFulltext . '</div>';
280
$titles['NoPrimary'] .= ' ' . $strPrimary . '</div>';
281
$titles['NoIndex'] .= ' ' . $strIndex . '</div>';
282
$titles['NoUnique'] .= ' ' . $strUnique . '</div>';
283
$titles['NoIdxFulltext'] .= ' ' . $strIdxFulltext . '</div>';
250
286
$titles['Change'] = $strChange;
300
<tr <?php echo $on_mouse; ?>>
265
301
<td align="center" bgcolor="<?php echo $bgcolor; ?>">
266
302
<input type="checkbox" name="selected_fld[]" value="<?php echo $field_encoded; ?>" id="checkbox_row_<?php echo $i; ?>" <?php echo $checked; ?> />
268
<td bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"> <label for="checkbox_row_<?php echo $i; ?>"><?php echo $field_name; ?></label> </td>
269
<td bgcolor="<?php echo $bgcolor; ?>"<?php echo $type_nowrap; ?>><?php echo $type; echo $type_mime; ?><bdo dir="ltr"></bdo></td>
270
<?php echo PMA_MYSQL_INT_VERSION >= 40100 ? ' <td bgcolor="' . $bgcolor . '">' . (empty($field_charset) ? ' ' : '<dfn title="' . PMA_getCollationDescr($field_charset) . '">' . $field_charset . '</dfn>') . '</td>' . "\n" : '' ?>
271
<td bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"><?php echo $strAttribute; ?></td>
272
<td bgcolor="<?php echo $bgcolor; ?>"><?php echo (($row['Null'] == '') ? $strNo : $strYes); ?> </td>
273
<td bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"><?php if (isset($row['Default'])) echo $row['Default']; ?> </td>
274
<td bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"><?php echo $row['Extra']; ?> </td>
304
<td <?php echo $click_mouse; ?> bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"> <label onclick="return (document.getElementById('checkbox_row_<?php echo $i; ?>') ? false : true)" for="checkbox_row_<?php echo $i; ?>"><?php echo $field_name; ?></label> </td>
305
<td <?php echo $click_mouse; ?> bgcolor="<?php echo $bgcolor; ?>"<?php echo $type_nowrap; ?>><?php echo $type; echo $type_mime; ?><bdo dir="ltr"></bdo></td>
306
<?php echo PMA_MYSQL_INT_VERSION >= 40100 ? ' <td bgcolor="' . $bgcolor . '" ' . $click_mouse . '>' . (empty($field_charset) ? ' ' : '<dfn title="' . PMA_getCollationDescr($field_charset) . '">' . $field_charset . '</dfn>') . '</td>' . "\n" : '' ?>
307
<td <?php echo $click_mouse; ?> bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"><?php echo $strAttribute; ?></td>
308
<td <?php echo $click_mouse; ?> bgcolor="<?php echo $bgcolor; ?>"><?php echo (($row['Null'] == '') ? $strNo : $strYes); ?> </td>
309
<td <?php echo $click_mouse; ?> bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"><?php if (isset($row['Default'])) echo $row['Default']; ?> </td>
310
<td <?php echo $click_mouse; ?> bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"><?php echo $row['Extra']; ?> </td>
275
311
<td align="center" bgcolor="<?php echo $bgcolor; ?>">
276
312
<a href="tbl_alter.php?<?php echo $url_query; ?>&field=<?php echo $field_encoded; ?>">
277
313
<?php echo $titles['Change']; ?></a>
302
<a href="sql.php?<?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']))); ?>"
303
onclick="return confirmLink(this, 'ALTER TABLE <?php echo PMA_jsFormat($table); ?> DROP PRIMARY KEY, ADD PRIMARY KEY(<?php echo PMA_jsFormat($row['Field']); ?>)')">
338
<a href="sql.php?<?php echo $url_query; ?>&sql_query=<?php echo urlencode('ALTER TABLE ' . PMA_backquote($table) . ( empty($primary) ? '' : ' DROP PRIMARY KEY,') . ' ADD PRIMARY KEY(' . PMA_backquote($row['Field']) . ')'); ?>&zero_rows=<?php echo urlencode(sprintf($strAPrimaryKey, htmlspecialchars($row['Field']))); ?>"
339
onclick="return confirmLink(this, 'ALTER TABLE <?php echo PMA_jsFormat($table) . ( empty($primary) ? '' : ' DROP PRIMARY KEY,'); ?> ADD PRIMARY KEY(<?php echo PMA_jsFormat($row['Field']); ?>)')">
304
340
<?php echo $titles['Primary']; ?></a>
385
421
if ($cfg['PropertiesIconic']) {
386
/* Opera has trouble with <input type="image"> */
387
/* IE has trouble with <button> */
388
if (PMA_USR_BROWSER_AGENT != 'IE') {
389
echo '<button class="mult_submit" type="submit" name="submit_mult" value="' . $strChange . '" title="' . $strChange . '">' . "\n"
390
. '<img src="./images/button_edit.png" title="' . $strChange . '" alt="' . $strChange . '" width="12" height="13" />' . (($propicon == 'both') ? ' ' . $strChange : '') . "\n"
391
. '</button>' . "\n";
393
echo ' <input type="image" name="submit_mult_change" value="' .$strChange . '" title="' . $strChange . '" src="./images/button_edit.png" />' . (($propicon == 'both') ? ' ' . $strChange : '') . "\n";
422
PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_change', $strChange, 'b_edit.png');
395
423
// Drop button if there is at least two fields
396
424
if ($fields_cnt > 1) {
397
if (PMA_USR_BROWSER_AGENT != 'IE') {
398
echo ' <button class="mult_submit" type="submit" name="submit_mult" value="' . $strDrop . '" title="' . $strDrop . '">' . "\n"
399
. '<img src="./images/button_drop.png" title="' . $strDrop . '" alt="' . $strDrop . '" width="11" height="13" />' . (($propicon == 'both') ? ' ' . $strDrop : '') . "\n"
400
. '</button>' . "\n";
402
echo ' <input type="image" name="submit_mult_drop" value="' .$strDrop . '" title="' . $strDrop . '" src="./images/button_drop.png" />' . (($propicon == 'both') ? ' ' . $strDrop : '') . "\n";
425
PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_drop', $strDrop, 'b_drop.png');
427
PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_primary', $strPrimary, 'b_primary.png');
428
PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_index', $strIndex, 'b_index.png');
429
PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_unique', $strUnique, 'b_unique.png');
430
if ((!empty($tbl_type) && $tbl_type == 'MYISAM')) {
431
PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_fulltext', $strIdxFulltext, 'b_ftext.png');
406
echo ' <input type="submit" name="submit_mult" value="' . $strChange . '" title="' . $strChange . '" />' . "\n";
434
echo '<input type="submit" name="submit_mult" value="' . $strChange . '" title="' . $strChange . '" />' . "\n";
407
435
// Drop button if there is at least two fields
408
436
if ($fields_cnt > 1) {
409
echo ' <i>' . $strOr . '</i> ' . "\n"
410
. ' <input type="submit" name="submit_mult" value="' . $strDrop . '" title="' . $strDrop . '" />' . "\n";
437
echo ' <i>' . $strOr . '</i> ' . "\n"
438
. '<input type="submit" name="submit_mult" value="' . $strDrop . '" title="' . $strDrop . '" />' . "\n";
440
echo ' <i>' . $strOr . '</i> ' . "\n"
441
. '<input type="submit" name="submit_mult" value="' . $strPrimary . '" title="' . $strPrimary . '" />' . "\n";
442
echo ' <i>' . $strOr . '</i> ' . "\n"
443
. '<input type="submit" name="submit_mult" value="' . $strIndex . '" title="' . $strIndex . '" />' . "\n";
444
echo ' <i>' . $strOr . '</i> ' . "\n"
445
. '<input type="submit" name="submit_mult" value="' . $strUnique . '" title="' . $strUnique . '" />' . "\n";
446
if ((!empty($tbl_type) && $tbl_type == 'MYISAM')) {
447
echo ' <i>' . $strOr . '</i> ' . "\n"
448
. '<input type="submit" name="submit_mult" value="' . $strIdxFulltext . '" title="' . $strIdxFulltext . '" />' . "\n";
470
<!-- Printable view of the table -->
471
<a href="tbl_printview.php?<?php echo $url_query; ?>"><?php
472
if ($cfg['PropertiesIconic']) {
473
echo '<img src="' . $pmaThemeImage . 'b_print.png" border="0" hspace="2" align="middle" width="16" height="16" alt="' . $strPrintView . '"/>';
476
?></a>
479
// if internal relations are available, or the table type is INNODB
480
// ($tbl_type comes from tbl_properties_table_info.php)
482
if ($cfg['Server']['relation'] || $tbl_type=="INNODB") {
484
<!-- Work on Relations -->
485
<a href="tbl_relation.php?<?php echo $url_query; ?>"><?php
486
if ($cfg['PropertiesIconic']) {
487
echo '<img src="' . $pmaThemeImage . 'b_relations.png" border="0" hspace="2" align="middle" width="16" height="16" alt="' . $strRelationView . '"/>';
489
echo $strRelationView;
490
?></a>
494
<!-- Let MySQL propose the optimal structure -->
495
<a href="sql.php?<?php echo $url_query; ?>&session_max_rows=all&sql_query=<?php echo urlencode('SELECT * FROM ' . PMA_backquote($table) . ' PROCEDURE ANALYSE()'); ?>"><?php
496
if ($cfg['PropertiesIconic']) {
497
echo '<img src="' . $pmaThemeImage . 'b_tblanalyse.png" border="0" hspace="2" align="middle" width="16" height="16" alt="' . $strStructPropose . '" />';
499
echo $strStructPropose;
501
echo PMA_showMySQLDocu('Extending_MySQL', 'procedure_analyse') . "\n";
503
<!-- Add some new fields -->
504
<form method="post" action="tbl_addfield.php"
505
onsubmit="return checkFormElementInRange(this, 'num_fields', 1)">
507
echo PMA_generate_common_hidden_inputs($db, $table);
508
if ($cfg['PropertiesIconic']) {
509
echo '<img src="' . $pmaThemeImage . 'b_insrow.png" width="16" height="16" border="0" hspace="2" align="middle" alt="' . $strAddNewField . '"/>';
511
echo sprintf($strAddFields, '<input type="text" name="num_fields" size="2" maxlength="2" value="1" style="vertical-align: middle" onfocus="this.select()" />');
513
<input type="radio" name="field_where" id="radio_field_where_last" value="last" checked="checked" /><label for="radio_field_where_last"><?php echo $strAtEndOfTable; ?></label>
514
<input type="radio" name="field_where" id="radio_field_where_first" value="first" /><label for="radio_field_where_first"><?php echo $strAtBeginningOfTable; ?></label>
515
<input type="radio" name="field_where" id="radio_field_where_after" value="after" /><?php
516
$fieldOptions = '</label><select name="after_field" style="vertical-align: middle" onclick="this.form.field_where[2].checked=true" onchange="this.form.field_where[2].checked=true">';
517
foreach ($aryFields AS $fieldname) {
518
$fieldOptions .= '<option value="' . htmlspecialchars($fieldname) . '">' . htmlspecialchars($fieldname) . '</option>' . "\n";
521
$fieldOptions .= '</select><label for="radio_field_where_after">';
522
echo str_replace('<label for="radio_field_where_after"></label>', '', '<label for="radio_field_where_after">' . sprintf($strAfter, $fieldOptions) . '</label>') . "\n";
524
<input type="submit" value="<?php echo $strGo; ?>" style="vertical-align: middle" />
721
<!-- Printable view of the table -->
723
<div style="margin-bottom: 10px"><a href="tbl_printview.php?<?php echo $url_query; ?>"><?php echo $strPrintView; ?></a></div>
726
<!-- Add some new fields -->
728
<form method="post" action="tbl_addfield.php"
729
onsubmit="return checkFormElementInRange(this, 'num_fields', 1)">
730
<?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
731
<?php echo $strAddNewField; ?> :
732
<input type="text" name="num_fields" size="2" maxlength="2" value="1" class="textfield" style="vertical-align: middle" onfocus="this.select()" />
733
<select name="after_field" style="vertical-align: middle">
734
<option value="--end--"><?php echo $strAtEndOfTable; ?></option>
735
<option value="--first--"><?php echo $strAtBeginningOfTable; ?></option>
737
foreach($aryFields AS $junk => $fieldname) {
738
echo ' <option value="' . htmlspecialchars($fieldname) . '">' . sprintf($strAfter, htmlspecialchars($fieldname)) . '</option>' . "\n";
743
<input type="submit" value="<?php echo $strGo; ?>" style="vertical-align: middle" />
748
if ($cfg['Server']['relation']) {
750
<!-- Work on Relations -->
752
<div style="margin-bottom: 10px">
753
<a href="tbl_relation.php?<?php echo $url_query; ?>"><?php echo $strRelationView; ?></a>
761
<!-- Let MySQL propose the optimal structure -->
763
<div style="margin-bottom: 10px">
764
<a href="sql.php?<?php echo $url_query; ?>&session_max_rows=all&sql_query=<?php echo urlencode('SELECT * FROM ' . PMA_backquote($table) . ' PROCEDURE ANALYSE()'); ?>">
765
<?php echo $strStructPropose; ?></a>
766
<?php echo PMA_showMySQLDocu('Extending_MySQL', 'procedure_analyse') . "\n"; ?>
772
821
* Query box, bookmark, insert data from textfile
774
823
$goto = 'tbl_properties_structure.php';
775
824
require('./tbl_query_box.php');
783
827
* Displays the footer