6 <form method
="post" action
="<?php echo $action; ?>">
7 <input type
="hidden" name
="server" value
="<?php echo $server; ?>" />
8 <input type
="hidden" name
="lang" value
="<?php echo $lang; ?>" />
9 <input type
="hidden" name
="convcharset" value
="<?php echo $convcharset; ?>" />
10 <input type
="hidden" name
="db" value
="<?php echo $db; ?>" />
11 <input type
="hidden" name
="table" value
="<?php echo $table; ?>" />
13 if ($action == 'tbl_create.php3') {
15 <input type
="hidden" name
="reload" value
="1" />
18 else if ($action == 'tbl_addfield.php3') {
21 <input type
="hidden" name
="after_field" value
="<?php echo $after_field; ?>" />
25 $is_backup = ($action != 'tbl_create.php3' && $action != 'tbl_addfield.php3');
28 <table border
="<?php echo $cfg['Border']; ?>">
30 <th
><?php
echo $strField; ?
></th
>
31 <th
><?php
echo $strType . '<br /><span style="font-weight: normal">' . PMA_showMySQLDocu('Reference', 'Column_types'); ?
></span
></th
>
32 <th
><?php
echo $strLengthSet; ?
></th
>
33 <th
><?php
echo $strAttr; ?
></th
>
34 <th
><?php
echo $strNull; ?
></th
>
35 <th
><?php
echo $strDefault; ?
></th
>
36 <th
><?php
echo $strExtra; ?
></th
>
38 // lem9: We could remove this 'if' and let the key information be shown and
39 // editable. However, for this to work, tbl_alter must be modified to use the
40 // key fields, as tbl_addfield does.
43 echo " <th>$strPrimary</th>\n";
44 echo " <th>$strIndex</th>\n";
45 echo " <th>$strUnique</th>\n";
46 echo " <th>---</th>\n";
47 echo " <th>$strIdxFulltext</th>\n";
53 for ($i = 0 ; $i < $num_fields; $i++
) {
54 if (isset($fields_meta)) {
55 $row = $fields_meta[$i];
57 $bgcolor = ($i %
2) ?
$cfg['BgcolorOne'] : $cfg['BgcolorTwo'];
60 <td bgcolor
="<?php echo $bgcolor; ?>">
65 <input type
="hidden" name
="field_orig[]" value
="<?php if (isset($row) && isset($row['Field'])) echo urlencode($row['Field']); ?>" />
70 <input type
="text" name
="field_name[]" size
="10" maxlength
="64" value
="<?php if (isset($row) && isset($row['Field'])) echo str_replace('"', '"
;', $row['Field
']); ?>" class="textfield" />
72 <td bgcolor="<?php echo $bgcolor; ?>">
73 <select name="field_type[]">
76 if (empty($row['Type
'])) {
80 else if (get_magic_quotes_gpc()) {
81 $type = stripslashes($row['Type
']);
86 $type = eregi_replace('BINARY
', '', $type);
87 $type = eregi_replace('ZEROFILL
', '', $type);
88 $type = eregi_replace('UNSIGNED
', '', $type);
89 // set or enum types: slashes single quotes inside options
90 if (eregi('^
(set|enum
)\
((.+
)\
)$
', $type, $tmp)) {
92 $length = substr(ereg_replace('([^
,])\'\'', '\\
1\\\'', ',' . $tmp[2]), 1);
95 $type = chop(eregi_replace('\\
(.*\\)', '', $type));
97 $length = eregi_replace("^$type\(", '', $length);
98 $length = eregi_replace('\
)$
', '', trim($length));
100 if ($length == $type) {
105 for ($j = 0; $j < count($cfg['ColumnTypes
']); $j++) {
106 echo ' <option value
="'. $cfg['ColumnTypes'][$j] . '"';
107 if (strtoupper($type) == strtoupper($cfg['ColumnTypes
'][$j])) {
108 echo ' selected
="selected"';
110 echo '>' . $cfg['ColumnTypes
'][$j] . '</option
>' . "\n";
115 <td bgcolor="<?php echo $bgcolor; ?>">
120 <input type="hidden" name="field_length_orig[]" value="<?php echo urlencode($length); ?>" />
125 <input type="text" name="field_length[]" size="8" value="<?php echo str_replace('"', '"', $length); ?>" class="textfield" />
127 <td bgcolor
="<?php echo $bgcolor; ?>">
128 <select name
="field_attribute[]">
131 $binary = eregi('BINARY', $row['Type'], $test_attribute1);
132 $unsigned = eregi('UNSIGNED', $row['Type'], $test_attribute2);
133 $zerofill = eregi('ZEROFILL', $row['Type'], $test_attribute3);
136 $strAttribute = 'BINARY';
139 $strAttribute = 'UNSIGNED';
142 $strAttribute = 'UNSIGNED ZEROFILL';
144 for ($j = 0;$j < count($cfg['AttributeTypes']); $j++
) {
145 echo ' <option value="'. $cfg['AttributeTypes'][$j] . '"';
146 if (strtoupper($strAttribute) == strtoupper($cfg['AttributeTypes'][$j])) {
147 echo ' selected="selected"';
149 echo '>' . $cfg['AttributeTypes'][$j] . '</option>' . "\n";
154 <td bgcolor
="<?php echo $bgcolor; ?>">
155 <select name
="field_null[]">
157 if (!isset($row) ||
empty($row['Null'])) {
160 <option value
="NOT NULL">not
null</option
>
161 <option value
="">null</option
>
166 <option value
="">null</option
>
167 <option value
="NOT NULL">not
null</option
>
176 && !isset($row['Default']) && !empty($row['Null'])) {
177 $row['Default'] = 'NULL';
181 <td bgcolor
="<?php echo $bgcolor; ?>">
186 <input type
="hidden" name
="field_default_orig[]" size
="8" value
="<?php if(isset($row) && isset($row['Default'])) echo urlencode($row['Default']); ?>" />
191 <input type
="text" name
="field_default[]" size
="8" value
="<?php if(isset($row) && isset($row['Default'])) echo str_replace('"', '"
;', $row['Default']); ?>" class="textfield" />
193 <td bgcolor="<?php echo $bgcolor; ?>">
194 <select name="field_extra[]">
196 if(!isset($row) || empty($row['Extra
'])) {
199 <option value=""></option>
200 <option value="AUTO_INCREMENT">auto_increment</option>
205 <option value="AUTO_INCREMENT">auto_increment</option>
206 <option value=""></option>
214 // lem9: See my other comment about removing this 'if'.
216 if (isset($row) && isset($row['Key
']) && $row['Key
'] == 'PRI
') {
217 $checked_primary = ' checked
="checked"';
219 $checked_primary = '';
221 if (isset($row) && isset($row['Key
']) && $row['Key
'] == 'MUL
') {
222 $checked_index = ' checked
="checked"';
226 if (isset($row) && isset($row['Key
']) && $row['Key
'] == 'UNI
') {
227 $checked_unique = ' checked
="checked"';
229 $checked_unique = '';
231 if (empty($checked_primary)
232 && empty($checked_index)
233 && empty($checked_unique)) {
234 $checked_none = ' checked
="checked"';
236 if (PMA_MYSQL_INT_VERSION >= 32323
237 &&(isset($row) && isset($row['Comment
']) && $row['Comment
'] == 'FULLTEXT
')) {
238 $checked_fulltext = ' checked
="checked"';
240 $checked_fulltext = '';
244 <td align="center" bgcolor="<?php echo $bgcolor; ?>">
245 <input type="radio" name="field_key_<?php echo $i; ?>" value="primary_<?php echo $i; ?>"<?php echo $checked_primary; ?> />
247 <td align="center" bgcolor="<?php echo $bgcolor; ?>">
248 <input type="radio" name="field_key_<?php echo $i; ?>" value="index_<?php echo $i; ?>"<?php echo $checked_index; ?> />
250 <td align="center" bgcolor="<?php echo $bgcolor; ?>">
251 <input type="radio" name="field_key_<?php echo $i; ?>" value="unique_<?php echo $i; ?>"<?php echo $checked_unique; ?> />
253 <td align="center" bgcolor="<?php echo $bgcolor; ?>">
254 <input type="radio" name="field_key_<?php echo $i; ?>" value="none_<?php echo $i; ?>"<?php echo $checked_none; ?> />
257 if (PMA_MYSQL_INT_VERSION >= 32323) {
260 <td bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap">
261 <input type="checkbox" name="field_fulltext[]" value="<?php echo $i; ?>"<?php echo $checked_fulltext; ?> />
264 } // end if (PMA_MYSQL_INT_VERSION >= 32323)
266 } // end if ($action ==...)
278 if ($action == 'tbl_create
.php3
' && PMA_MYSQL_INT_VERSION >= 32300) {
283 <td><?php echo $strTableComments; ?> :</td>
285 if ($action == 'tbl_create
.php3
') {
288 <td width="25"> </td>
289 <td><?php echo $strTableType; ?> :</td>
297 <input type="text" name="comment" size="40" maxlength="80" class="textfield" />
300 // BEGIN - Table Type - 2 May 2001 - Robbat2
301 // change by staybyte - 11 June 2001
302 if ($action == 'tbl_create
.php3
') {
303 // find mysql capability - staybyte - 11. June 2001
304 $query = 'SHOW VARIABLES LIKE \'have_%\'
';
305 $result = PMA_mysql_query($query);
306 if ($result != FALSE && mysql_num_rows($result) > 0) {
307 while ($tmp = PMA_mysql_fetch_array($result)) {
308 if (isset($tmp['Variable_name
'])) {
309 switch ($tmp['Variable_name
']) {
311 if (isset($tmp['Variable_name
']) && $tmp['Value
'] == 'YES
') {
316 if (isset($tmp['Variable_name
']) && $tmp['Value
'] == 'YES
') {
321 if (isset($tmp['Variable_name
']) && $tmp['Value
'] == 'YES
') {
326 if (isset($tmp['Variable_name
']) && $tmp['Value
'] == 'YES
') {
334 mysql_free_result($result);
338 <td width="25"> </td>
340 <select name="tbl_type">
341 <option value="Default"><?php echo $strDefault; ?></option>
342 <option value="MYISAM">MyISAM</option>
343 <option value="HEAP">Heap</option>
344 <option value="MERGE">Merge</option>
345 <?php if (isset($tbl_bdb)) { ?><option value="BDB">Berkeley DB</option><?php } ?>
346 <?php if (isset($tbl_gemini)) { ?><option value="GEMINI">Gemini</option><?php } ?>
347 <?php if (isset($tbl_innodb)) { ?><option value="InnoDB">INNO DB</option><?php } ?>
348 <?php if (isset($tbl_isam)) { ?><option value="ISAM">ISAM</option><?php } ?>
361 // END - Table Type - 2 May 2001 - Robbat2
364 <input type="submit" name="submit" value="<?php echo $strSave; ?>" />
369 <td valign="top">* </td>
371 <?php echo $strSetEnumVal . "\n"; ?>
377 <center><?php echo PMA_showMySQLDocu('Reference
', 'CREATE_TABLE
'); ?></center>