⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tbl_change.php

📁 WEBGAME源码,有架设说明,只是非常简单
💻 PHP
📖 第 1 页 / 共 3 页
字号:
                <input type="hidden" name="fields_type<?php echo $field_name_appendix; ?>" value="enum" />                <input type="hidden" name="fields<?php echo $field_name_appendix; ?>" value="" />            <?php            echo "\n" . '            ' . $backup_field;            // show dropdown or radio depend on length            if (strlen($row_table_def['Type']) > 20) {                echo "\n";                ?>                <select name="field_<?php echo $field_name_appendix_md5; ?>"                    <?php echo $unnillify_trigger; ?>                    tabindex="<?php echo ($tabindex + $tabindex_for_value); ?>"                    id="field_<?php echo ($idindex); ?>_3">                    <option value=""></option>                <?php                echo "\n";                for ($j = 0; $j < $enum_cnt; $j++) {                    // Removes automatic MySQL escape format                    $enum_atom = str_replace('\'\'', '\'', str_replace('\\\\', '\\', $enum[$j]));                    echo '                ';                    //echo '<option value="' . htmlspecialchars($enum_atom) . '"';                    echo '<option value="' . htmlspecialchars($enum_atom) . '"';                    if ($data == $enum_atom                        || ($data == '' && (!isset($primary_key) || $row_table_def['Null'] != 'YES')                            && isset($row_table_def['Default']) && $enum_atom == $row_table_def['Default'])) {                        echo ' selected="selected"';                    }                    echo '>' . htmlspecialchars($enum_atom) . '</option>' . "\n";                } // end for                ?>                </select>                <?php            } else {                echo "\n";                for ($j = 0; $j < $enum_cnt; $j++) {                    // Removes automatic MySQL escape format                    $enum_atom = str_replace('\'\'', '\'', str_replace('\\\\', '\\', $enum[$j]));                    echo '            ';                    echo '<input type="radio" name="field_' . $field_name_appendix_md5 . '"';                    echo ' value="' . htmlspecialchars($enum_atom) . '"';                    echo ' id="field_' . ($idindex) . '_3_'  . $j . '"';                    echo ' onclick="';                    echo "if (typeof(document.forms['insertForm'].elements['fields_null"                        . $field_name_appendix . "']) != 'undefined') {document.forms['insertForm'].elements['fields_null"                        . $field_name_appendix . "'].checked = false}";                    echo '"';                    if ($data == $enum_atom                        || ($data == '' && (!isset($primary_key) || $row_table_def['Null'] != 'YES')                            && isset($row_table_def['Default']) && $enum_atom == $row_table_def['Default'])) {                        echo ' checked="checked"';                    }                    echo 'tabindex="' . ($tabindex + $tabindex_for_value) . '" />';                    echo '<label for="field_' . $idindex . '_3_' . $j . '">'                        . htmlspecialchars($enum_atom) . '</label>' . "\n";                } // end for            } // end else            echo "\n";            ?>            </td>            <?php            echo "\n";        } elseif ($type == 'set') {            $set = PMA_getEnumSetOptions($row_table_def['Type']);            if (isset($vset)) {                unset($vset);            }            for ($vals = explode(',', $data); list($t, $k) = each($vals);) {                $vset[$k] = 1;            }            $countset = count($set);            $size = min(4, $countset);            ?>            <td>                <?php echo $backup_field . "\n"; ?>                <input type="hidden" name="fields_type<?php echo $field_name_appendix; ?>" value="set" />                <input type="hidden" name="fields<?php echo $field_name_appendix; ?>" value="" />                <select name="field_<?php echo $field_name_appendix_md5; ?>"                    size="<?php echo $size; ?>"                    multiple="multiple" <?php echo $unnillify_trigger; ?>                    tabindex="<?php echo ($tabindex + $tabindex_for_value); ?>"                    id="field_<?php echo ($idindex); ?>_3">            <?php            echo "\n";            for ($j = 0; $j < $countset; $j++) {                echo '                ';                //echo '<option value="'. htmlspecialchars($set[$j]) . '"';                echo '<option value="'. htmlspecialchars($set[$j]) . '"';                if (isset($vset[$set[$j]]) && $vset[$set[$j]]) {                    echo ' selected="selected"';                }                echo '>' . htmlspecialchars($set[$j]) . '</option>' . "\n";            } // end for            ?>                </select>            </td>            <?php        }        // Change by Bernard M. Piller <bernard@bmpsystems.com>        // We don't want binary data destroyed        elseif ($is_binary || $is_blob) {            if (($cfg['ProtectBinary'] && $is_blob)                || ($cfg['ProtectBinary'] == 'all' && $is_binary)) {                echo "\n";                ?>            <td>                <?php                    echo $strBinaryDoNotEdit;                    if (isset($data)) {                        $data_size = PMA_formatByteDown(strlen(stripslashes($data)), 3, 1);                        echo ' ('. $data_size [0] . ' ' . $data_size[1] . ')';                        unset($data_size);                    }                    echo "\n";                ?>                <input type="hidden" name="fields_type<?php echo $field_name_appendix; ?>" value="protected" />                <input type="hidden" name="fields<?php echo $field_name_appendix; ?>" value="" />                <?php            } elseif ($is_blob) {                echo "\n";                ?>            <td>                <?php echo $backup_field . "\n"; ?>                <textarea name="fields<?php echo $field_name_appendix; ?>"                    rows="<?php echo $cfg['TextareaRows']; ?>"                    cols="<?php echo $cfg['TextareaCols']; ?>"                    dir="<?php echo $text_dir; ?>"                    id="field_<?php echo ($idindex); ?>_3"                    <?php echo $unnillify_trigger; ?>                    tabindex="<?php echo ($tabindex + $tabindex_for_value); ?>"                    ><?php echo $special_chars; ?></textarea>                <?php            } else {                if ($len < 4) {                    $fieldsize = $maxlength = 4;                } else {                    $fieldsize = (($len > 40) ? 40 : $len);                    $maxlength = $len;                }                echo "\n";                ?>            <td>                <?php echo $backup_field . "\n"; ?>                <input type="text" name="fields<?php echo $field_name_appendix; ?>"                    value="<?php echo $special_chars; ?>" size="<?php echo $fieldsize; ?>"                    maxlength="<?php echo $maxlength; ?>"                    class="textfield" <?php echo $unnillify_trigger; ?>                    tabindex="<?php echo ($tabindex + $tabindex_for_value); ?>"                    id="field_<?php echo ($idindex); ?>_3" />                <?php            } // end if...elseif...else            // Upload choice (only for BLOBs because the binary            // attribute does not imply binary contents)            // (displayed whatever value the ProtectBinary has)            if ($is_upload && $is_blob) {                echo '<br />';                echo '<input type="file" name="fields_upload_' . $field_html . $vkey . '" class="textfield" id="field_' . $idindex . '_3" size="10" />&nbsp;';                // find maximum upload size, based on field type                /**                 * @todo with functions this is not so easy, as you can basically                 * process any data with function like MD5                 */                $max_field_sizes = array(                    'tinyblob'   =>        '256',                    'blob'       =>      '65536',                    'mediumblob' =>   '16777216',                    'longblob'   => '4294967296'); // yeah, really                $this_field_max_size = $max_upload_size; // from PHP max                if ($this_field_max_size > $max_field_sizes[$type]) {                   $this_field_max_size = $max_field_sizes[$type];                }                echo PMA_displayMaximumUploadSize($this_field_max_size) . "\n";                // do not generate here the MAX_FILE_SIZE, because we should                // put only one in the form to accommodate the biggest field                if ($this_field_max_size > $biggest_max_file_size) {                    $biggest_max_file_size = $this_field_max_size;                }            }            if (!empty($cfg['UploadDir'])) {                $files = PMA_getFileSelectOptions(PMA_userDir($cfg['UploadDir']));                if ($files === FALSE) {                    echo '        <font color="red">' . $strError . '</font><br />' . "\n";                    echo '        ' . $strWebServerUploadDirectoryError . "\n";                } elseif (!empty($files)) {                    echo "<br />\n";                    echo '    <i>' . $strOr . '</i>' . ' ' . $strWebServerUploadDirectory . ':<br />' . "\n";                    echo '        <select size="1" name="fields_uploadlocal_' . $field_html . $vkey . '">' . "\n";                    echo '            <option value="" selected="selected"></option>' . "\n";                    echo $files;                    echo '        </select>' . "\n";                }            } // end if (web-server upload directory)            echo '</td>';        } // end elseif ( binary or blob)        else {            // For char or varchar, respect the maximum length (M); for other            // types (int or float), the length is not a limit on the values that            // can be entered, so let's be generous (20) (we could also use the            // real limits for each numeric type)            // 2004-04-07, it turned out that 20 was not generous enough            // for the maxlength            if ($is_char) {                $fieldsize = (($len > 40) ? 40 : $len);                $maxlength = $len;            } else {                $fieldsize = 20;                $maxlength = 99;            } // end if... else...            ?>            <td>            <?php            echo $backup_field . "\n";            if ($is_char && ($cfg['CharEditing'] == 'textarea' || strpos($data, "\n") !== FALSE)) {                echo "\n";                ?>                <textarea name="fields<?php echo $field_name_appendix; ?>"                    rows="<?php echo $cfg['CharTextareaRows']; ?>"                    cols="<?php echo $cfg['CharTextareaCols']; ?>"                    dir="<?php echo $text_dir; ?>"                    id="field_<?php echo ($idindex); ?>_3"                    <?php echo $unnillify_trigger; ?>                    tabindex="<?php echo ($tabindex + $tabindex_for_value); ?>"                    ><?php echo $special_chars; ?></textarea>                <?php            } else {                ?>                <input type="text" name="fields<?php echo $field_name_appendix; ?>"                    value="<?php echo $special_chars; ?>" size="<?php echo $fieldsize; ?>"                    maxlength="<?php echo $maxlength; ?>"                    class="textfield" <?php echo $unnillify_trigger; ?>                    tabindex="<?php echo ($tabindex + $tabindex_for_value); ?>"                    id="field_<?php echo ($idindex); ?>_3" />                <?php                if ($row_table_def['Extra'] == 'auto_increment') {                    ?>                    <input type="hidden" name="auto_increment<?php echo $field_name_appendix; ?>" value="1" />                    <?php                } // end if                if (substr($type, 0, 9) == 'timestamp') {                    ?>                    <input type="hidden" name="fields_type<?php echo $field_name_appendix; ?>" value="timestamp" />                    <?php                }                if ($type == 'date' || $type == 'datetime' || substr($type, 0, 9) == 'timestamp') {                    ?>                    <script type="text/javascript" language="javascript">                    //<![CDATA[                    document.write('<a title="<?php echo $strCalendar;?>" href="javascript:openCalendar(\'<?php echo PMA_generate_common_url();?>\', \'insertForm\', \'field_<?php echo ($idindex); ?>_3\', \'<?php echo (PMA_MYSQL_INT_VERSION >= 40100 && substr($type, 0, 9) == 'timestamp') ? 'datetime' : substr($type, 0, 9); ?>\')"><img class="calendar" src="<?php echo $pmaThemeImage; ?>b_calendar.png" alt="<?php echo $strCalendar; ?>"/></a>');                    //]]>                    </script>                    <?php                }            }            ?>            </td>            <?php        }        ?>        </tr>        <?php        $odd_row = !$odd_row;    } // end for    $o_rows++;    echo '  </table><br />';} // end foreach on multi-edit?>    <br />    <table border="0" cellpadding="5" cellspacing="0">    <tr>        <td valign="middle" nowrap="nowrap">            <select name="submit_type" tabindex="<?php echo ($tabindex + $tabindex_for_value + 1); ?>"><?phpif (isset($primary_key)) {    ?>                <option value="<?php echo $strSave; ?>"><?php echo $strSave; ?></option>    <?php}    ?>                <option value="<?php echo $strInsertAsNewRow; ?>"><?php echo $strInsertAsNewRow; ?></option>            </select>    <?phpecho "\n";if (!isset($after_insert)) {    $after_insert = 'back';}?>        </td>        <td valign="middle">            &nbsp;&nbsp;&nbsp;<b><?php echo $strAndThen; ?></b>&nbsp;&nbsp;&nbsp;        </td>        <td valign="middle" nowrap="nowrap">            <select name="after_insert">                <option value="back" <?php echo ($after_insert == 'back' ? 'selected="selected"' : ''); ?>><?php echo $strAfterInsertBack; ?></option>                <option value="new_insert" <?php echo ($after_insert == 'new_insert' ? 'selected="selected"' : ''); ?>><?php echo $strAfterInsertNewInsert; ?></option><?phpif (isset($primary_key)) {    ?>                <option value="same_insert" <?php echo ($after_insert == 'same_insert' ? 'selected="selected"' : ''); ?>><?php echo $strAfterInsertSame; ?></option>    <?php    // If we have just numeric primary key, we can also edit next    // in 2.8.2, we were looking for `field_name` = numeric_value    //if (preg_match('@^[\s]*`[^`]*` = [0-9]+@', $primary_key)) {    // in 2.9.0, we are looking for `table_name`.`field_name` = numeric_value    if (preg_match('@^[\s]*`[^`]*`[\.]`[^`]*` = [0-9]+@', $primary_key)) {        ?>                <option value="edit_next"><?php echo $strAfterInsertNext; ?></option>        <?php    }}?>            </select>        </td>    </tr>    <tr>        <td><?php echo PMA_showHint($strUseTabKey); ?>        </td>        <td colspan="3" align="right" valign="middle">            <input type="submit" value="<?php echo $strGo; ?>" tabindex="<?php echo ($tabindex + $tabindex_for_value + 6); ?>" id="buttonYes" />            <input type="reset" value="<?php echo $strReset; ?>" tabindex="<?php echo ($tabindex + $tabindex_for_value + 7); ?>" />        </td>    </tr>    </table>    <?php if ($biggest_max_file_size > 0) {            echo '        ' . PMA_generateHiddenMaxFileSize($biggest_max_file_size) . "\n";          } ?></form><?php/** * Displays the footer */require_once './libraries/footer.inc.php';?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -