radio buttons for indexes
This commit is contained in:
@@ -10,6 +10,8 @@ $Source$
|
||||
495360 (cookie with domain), experimental, thanks to
|
||||
Piotr Roszatycki (d3xter) and Christoph (certelt).
|
||||
* tbl_properties.inc.php3: clarifications
|
||||
* tbl_create.php3, tbl_addfield.php3, tbl_properties.inc.php3:
|
||||
radio buttons for indexes.
|
||||
|
||||
2002-02-09 Lo<4C>c Chapeaux <lolo@phpheaven.net>
|
||||
* libraries/functions.js: improved the "mark row" feature (it wasn't
|
||||
|
@@ -28,8 +28,20 @@ $err_url = 'tbl_properties.php3'
|
||||
if (isset($submit)) {
|
||||
$query = '';
|
||||
|
||||
// Builds the field creation statement and alters the table
|
||||
// transform the radio button field_key into 3 arrays
|
||||
$field_cnt = count($field_name);
|
||||
for ($i = 0; $i < $field_cnt; ++$i) {
|
||||
if (${'field_key_'.$i} == 'primary_'.$i) {
|
||||
$field_primary[]=$i;
|
||||
}
|
||||
if (${'field_key_'.$i} == 'index_'.$i) {
|
||||
$field_index[]=$i;
|
||||
}
|
||||
if (${'field_key_'.$i} == 'unique_'.$i) {
|
||||
$field_unique[]=$i;
|
||||
}
|
||||
}
|
||||
// Builds the field creation statement and alters the table
|
||||
for ($i = 0; $i < $field_cnt; ++$i) {
|
||||
if (get_magic_quotes_gpc()) {
|
||||
$field_name[$i] = stripslashes($field_name[$i]);
|
||||
|
@@ -34,9 +34,21 @@ mysql_select_db($db);
|
||||
if (isset($submit)) {
|
||||
$sql_query = $query_cpy = '';
|
||||
|
||||
// transform the radio button field_key into 3 arrays
|
||||
$field_cnt = count($field_name);
|
||||
for ($i = 0; $i < $field_cnt; ++$i) {
|
||||
if (${'field_key_'.$i} == 'primary_'.$i) {
|
||||
$field_primary[]=$i;
|
||||
}
|
||||
if (${'field_key_'.$i} == 'index_'.$i) {
|
||||
$field_index[]=$i;
|
||||
}
|
||||
if (${'field_key_'.$i} == 'unique_'.$i) {
|
||||
$field_unique[]=$i;
|
||||
}
|
||||
}
|
||||
// Builds the fields creation statements
|
||||
$fields_cnt = count($field_name);
|
||||
for ($i = 0; $i < $fields_cnt; $i++) {
|
||||
for ($i = 0; $i < $field_cnt; $i++) {
|
||||
if (empty($field_name[$i])) {
|
||||
continue;
|
||||
}
|
||||
@@ -87,7 +99,7 @@ if (isset($submit)) {
|
||||
$sql_query .= $query;
|
||||
$query_cpy .= "\n" . ' ' . $query;
|
||||
} // end for
|
||||
unset($fields_cnt);
|
||||
unset($field_cnt);
|
||||
unset($query);
|
||||
$sql_query = ereg_replace(', $', '', $sql_query);
|
||||
$query_cpy = ereg_replace(', $', '', $query_cpy);
|
||||
|
@@ -42,6 +42,7 @@ if (!$is_backup) {
|
||||
echo " <th>$strPrimary</th>\n";
|
||||
echo " <th>$strIndex</th>\n";
|
||||
echo " <th>$strUnique</th>\n";
|
||||
echo " <th>---</th>\n";
|
||||
echo " <th>$strIdxFulltext</th>\n";
|
||||
}
|
||||
?>
|
||||
@@ -235,13 +236,16 @@ for ($i = 0 ; $i < $num_fields; $i++) {
|
||||
echo "\n";
|
||||
?>
|
||||
<td align="center" bgcolor="<?php echo $bgcolor; ?>">
|
||||
<input type="checkbox" name="field_primary[]" value="<?php echo $i; ?>"<?php echo $checked_primary; ?> />
|
||||
<input type="radio" name="field_key_<?php echo $i; ?>" value="primary_<?php echo $i; ?>"<?php echo $checked_primary; ?> />
|
||||
</td>
|
||||
<td align="center" bgcolor="<?php echo $bgcolor; ?>">
|
||||
<input type="checkbox" name="field_index[]" value="<?php echo $i; ?>"<?php echo $checked_index; ?> />
|
||||
<input type="radio" name="field_key_<?php echo $i; ?>" value="index_<?php echo $i; ?>"<?php echo $checked_index; ?> />
|
||||
</td>
|
||||
<td align="center" bgcolor="<?php echo $bgcolor; ?>">
|
||||
<input type="checkbox" name="field_unique[]" value="<?php echo $i; ?>"<?php echo $checked_unique; ?> />
|
||||
<input type="radio" name="field_key_<?php echo $i; ?>" value="unique_<?php echo $i; ?>"<?php echo $checked_unique; ?> />
|
||||
</td>
|
||||
<td align="center" bgcolor="<?php echo $bgcolor; ?>">
|
||||
<input type="radio" name="field_key_<?php echo $i; ?>" value="none_<?php echo $i; ?>" />
|
||||
</td>
|
||||
<?php
|
||||
if (PMA_MYSQL_INT_VERSION >= 32323) {
|
||||
|
Reference in New Issue
Block a user