Орла
Области
Компаний
Пользователи
Галерея
Фиксированные новости
Орла
Отзывы о фирмах
Тарифы
Пользователи
Области
Банкоматы
Торговые точки
Доска объявлений
Курсы валют
Скидки
организации Орла
организации области
товары
сайты
сайты Орел
Данные
Разделы
Поиск
Поиск запросы
Статистика
Показы каталога организаций
Статистика клиенты
Пользователи
Сайты
Управление сайтом
Анкета
Аптеки
Афиша
Афиша новая
Баннеры
Бизнес >
Викторина
Голосование
Гость на сайте
Истории
Календарь событий
Каталоги >
Конкурс красоты
Конкурс аудио
Консультации
Меню
Новое на сайте
Новости >
Организации >
Программа ТВ
Публикации
Разделы сайта
Рассылка
Рестораны
Секрет фирмы >
Сервисы >
Ссылки
Тесты
Файловый менеджер
Форум
Фотогалерея
Обратная связь
Недвижимость
Новый год
Тексты
Пользователи
Юридический рейтинг
Отзывы на товары
Бан пользователей
Жалобы
Новые тесты
Коронавирус
Файловый менеджер
Имя файла
tbl_addfield.php
Содержимое
<?php /* vim: set expandtab sw=4 ts=4 sts=4: */ /** * * @version $Id$ */ /** * Get some core libraries */ require_once './libraries/common.inc.php'; require_once './libraries/Table.class.php'; $js_to_run = 'functions.js'; require_once './libraries/header.inc.php'; // Check parameters PMA_checkParameters(array('db', 'table')); /** * Defines the url to return to in case of error in a sql statement */ $err_url = 'tbl_sql.php?' . PMA_generate_common_url($db, $table); /** * The form used to define the field to add has been submitted */ $abort = false; if (isset($submit_num_fields)) { if (isset($orig_after_field)) { $after_field = $orig_after_field; } if (isset($orig_field_where)) { $field_where = $orig_field_where; } $num_fields = $orig_num_fields + $added_fields; $regenerate = TRUE; } elseif (isset($do_save_data)) { $query = ''; // Transforms the radio button field_key into 3 arrays $field_cnt = count($field_name); for ($i = 0; $i < $field_cnt; ++$i) { if (isset(${'field_key_' . $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; } } // end if } // end for // Builds the field creation statement and alters the table for ($i = 0; $i < $field_cnt; ++$i) { // '0' is also empty for php :-( if (empty($field_name[$i]) && $field_name[$i] != '0') { continue; } $query .= PMA_Table::generateFieldSpec($field_name[$i], $field_type[$i], $field_length[$i], $field_attribute[$i], isset($field_collation[$i]) ? $field_collation[$i] : '', $field_null[$i], $field_default[$i], isset($field_default_current_timestamp[$i]), $field_extra[$i], isset($field_comments[$i]) ? $field_comments[$i] : '', $field_primary, $i); if ($field_where != 'last') { // Only the first field can be added somewhere other than at the end if ($i == 0) { if ($field_where == 'first') { $query .= ' FIRST'; } else { $query .= ' AFTER ' . PMA_backquote(urldecode($after_field)); } } else { $query .= ' AFTER ' . PMA_backquote($field_name[$i-1]); } } $query .= ', ADD '; } // end for $query = preg_replace('@, ADD $@', '', $query); // To allow replication, we first select the db to use and then run queries // on this db. PMA_DBI_select_db($db) or PMA_mysqlDie(PMA_getError(), 'USE ' . PMA_backquotes($db), '', $err_url); $sql_query = 'ALTER TABLE ' . PMA_backquote($table) . ' ADD ' . $query; $error_create = FALSE; PMA_DBI_try_query($sql_query) or $error_create = TRUE; if ($error_create == false) { $sql_query_cpy = $sql_query . ';'; // Builds the primary keys statements and updates the table $primary = ''; if (isset($field_primary)) { $primary_cnt = count($field_primary); for ($i = 0; $i < $primary_cnt; $i++) { $j = $field_primary[$i]; if (isset($field_name[$j]) && strlen($field_name[$j])) { $primary .= PMA_backquote($field_name[$j]) . ', '; } } // end for $primary = preg_replace('@, $@', '', $primary); if (strlen($primary)) { $sql_query = 'ALTER TABLE ' . PMA_backquote($table) . ' ADD PRIMARY KEY (' . $primary . ');'; $result = PMA_DBI_query($sql_query); $sql_query_cpy .= "\n" . $sql_query . ';'; } } // end if // Builds the indexes statements and updates the table $index = ''; if (isset($field_index)) { $index_cnt = count($field_index); for ($i = 0; $i < $index_cnt; $i++) { $j = $field_index[$i]; if (isset($field_name[$j]) && strlen($field_name[$j])) { $index .= PMA_backquote($field_name[$j]) . ', '; } } // end for $index = preg_replace('@, $@', '', $index); if (strlen($index)) { $sql_query = 'ALTER TABLE ' . PMA_backquote($table) . ' ADD INDEX (' . $index . ')'; $result = PMA_DBI_query($sql_query); $sql_query_cpy .= "\n" . $sql_query . ';'; } } // end if // Builds the uniques statements and updates the table $unique = ''; if (isset($field_unique)) { $unique_cnt = count($field_unique); for ($i = 0; $i < $unique_cnt; $i++) { $j = $field_unique[$i]; if (isset($field_name[$j]) && strlen($field_name[$j])) { $unique .= PMA_backquote($field_name[$j]) . ', '; } } // end for $unique = preg_replace('@, $@', '', $unique); if (strlen($unique)) { $sql_query = 'ALTER TABLE ' . PMA_backquote($table) . ' ADD UNIQUE (' . $unique . ')'; $result = PMA_DBI_query($sql_query); $sql_query_cpy .= "\n" . $sql_query . ';'; } } // end if // Builds the fulltext statements and updates the table $fulltext = ''; if (isset($field_fulltext)) { $fulltext_cnt = count($field_fulltext); for ($i = 0; $i < $fulltext_cnt; $i++) { $j = $field_fulltext[$i]; $fulltext .= PMA_backquote($field_name[$j]) . ', '; } // end for $fulltext = preg_replace('@, $@', '', $fulltext); if (strlen($fulltext)) { $sql_query = 'ALTER TABLE ' . PMA_backquote($table) . ' ADD FULLTEXT (' . $fulltext . ')'; $result = PMA_DBI_query($sql_query); $sql_query_cpy .= "\n" . $sql_query . ';'; } } // end if // garvin: If comments were sent, enable relation stuff require_once './libraries/relation.lib.php'; require_once './libraries/transformations.lib.php'; $cfgRelation = PMA_getRelationsParam(); // garvin: Update comment table, if a comment was set. if (isset($field_comments) && is_array($field_comments) && $cfgRelation['commwork'] && PMA_MYSQL_INT_VERSION < 40100) { foreach ($field_comments AS $fieldindex => $fieldcomment) { if (isset($field_name[$fieldindex]) && strlen($field_name[$fieldindex])) { PMA_setComment($db, $table, $field_name[$fieldindex], $fieldcomment, '', 'pmadb'); } } } // garvin: Update comment table for mime types [MIME] if (isset($field_mimetype) && is_array($field_mimetype) && $cfgRelation['commwork'] && $cfgRelation['mimework'] && $cfg['BrowseMIME']) { foreach ($field_mimetype AS $fieldindex => $mimetype) { if (isset($field_name[$fieldindex]) && strlen($field_name[$fieldindex])) { PMA_setMIME($db, $table, $field_name[$fieldindex], $mimetype, $field_transformation[$fieldindex], $field_transformation_options[$fieldindex]); } } } // Go back to the structure sub-page $sql_query = $sql_query_cpy; unset($sql_query_cpy); $message = $strTable . ' ' . htmlspecialchars($table) . ' ' . $strHasBeenAltered; $active_page = 'tbl_structure.php'; require './tbl_structure.php'; } else { PMA_mysqlDie('', '', '', $err_url, FALSE); // garvin: An error happened while inserting/updating a table definition. // to prevent total loss of that data, we embed the form once again. // The variable $regenerate will be used to restore data in libraries/tbl_properties.inc.php $num_fields = $orig_num_fields; if (isset($orig_after_field)) { $after_field = $orig_after_field; } if (isset($orig_field_where)) { $field_where = $orig_field_where; } $regenerate = true; } } // end do alter table /** * Displays the form used to define the new field */ if ($abort == FALSE) { /** * Gets tables informations */ require_once './libraries/tbl_common.php'; require_once './libraries/tbl_info.inc.php'; /** * Displays top menu links */ $active_page = 'tbl_structure.php'; require_once './libraries/tbl_links.inc.php'; /** * Display the form */ $action = 'tbl_addfield.php'; require_once './libraries/tbl_properties.inc.php'; // Diplays the footer echo "\n"; require_once './libraries/footer.inc.php'; } ?>
/admin/myadmin2/
Имя
Дата
Размер
..
2026-10-02
contrib
2013-06-28
js
2013-06-28
lang
2013-06-28
libraries
2015-04-04
pmd
2013-06-28
scripts
2013-06-28
themes
2013-06-28
CREDITS
2013-06-28
127 байт
ChangeLog
2013-06-28
32 кб.
Documentation.html
2013-06-28
218 кб.
Documentation.txt
2013-06-28
154 кб.
INSTALL
2013-06-28
137 байт
LICENSE
2013-06-28
18 кб.
README
2013-06-28
3 кб.
RELEASE-DATE-2.11.11.3
2013-06-28
29 байт
TODO
2013-06-28
196 байт
browse_foreigners.php
2013-06-28
11 кб.
calendar.php
2013-06-28
711 байт
changelog.php
2013-06-28
4 кб.
chk_rel.php
2013-06-28
410 байт
config.inc.php
2013-06-28
2 кб.
config.sample.inc.php
2013-06-28
2 кб.
db_create.php
2013-06-28
1 кб.
db_datadict.php
2013-06-28
10 кб.
db_export.php
2013-06-28
2 кб.
db_import.php
2013-06-28
419 байт
db_operations.php
2013-06-28
19 кб.
db_printview.php
2013-06-28
7 кб.
db_qbe.php
2013-06-28
34 кб.
db_search.php
2013-06-28
14 кб.
db_sql.php
2013-06-28
972 байт
db_structure.php
2013-06-28
22 кб.
docs.css
2013-06-28
4 кб.
error.php
2013-06-28
2 кб.
export.php
2013-06-28
24 кб.
favicon.ico
2013-06-28
18 кб.
import.php
2013-06-28
14 кб.
index.php
2013-06-28
6 кб.
license.php
2013-06-28
618 байт
main.php
2013-06-28
15 кб.
navigation.php
2013-06-28
26 кб.
pdf_pages.php
2013-06-28
27 кб.
pdf_schema.php
2013-06-28
51 кб.
phpinfo.php
2013-06-28
310 байт
phpmyadmin.css.php
2013-06-28
16 кб.
pmd_common.php
2013-06-28
11 кб.
pmd_display_field.php
2013-06-28
2 кб.
pmd_general.php
2013-06-28
18 кб.
pmd_help.php
2013-06-28
829 байт
pmd_pdf.php
2013-06-28
3 кб.
pmd_relation_new.php
2013-06-28
4 кб.
pmd_relation_upd.php
2013-06-28
2 кб.
pmd_save_pos.php
2013-06-28
2 кб.
print.css
2013-06-28
1 кб.
querywindow.php
2013-06-28
9 кб.
readme.php
2013-06-28
610 байт
server_binlog.php
2013-06-28
7 кб.
server_collations.php
2013-06-28
3 кб.
server_databases.php
2013-06-28
13 кб.
server_engines.php
2013-06-28
5 кб.
server_export.php
2013-06-28
2 кб.
server_import.php
2013-06-28
430 байт
server_privileges.php
2013-06-28
108 кб.
server_processlist.php
2013-06-28
3 кб.
server_sql.php
2013-06-28
528 байт
server_status.php
2013-06-28
20 кб.
server_variables.php
2013-06-28
2 кб.
show_config_errors.php
2013-06-28
256 байт
sql.php
2013-06-28
29 кб.
tbl_addfield.php
2013-06-28
9 кб.
tbl_alter.php
2013-06-28
9 кб.
tbl_change.php
2013-06-28
45 кб.
tbl_create.php
2013-06-28
9 кб.
tbl_export.php
2013-06-28
2 кб.
tbl_import.php
2013-06-28
582 байт
tbl_indexes.php
2013-06-28
16 кб.
tbl_move_copy.php
2013-06-28
2 кб.
tbl_operations.php
2013-06-28
19 кб.
tbl_printview.php
2013-06-28
18 кб.
tbl_relation.php
2013-06-28
24 кб.
tbl_replace.php
2013-06-28
12 кб.
tbl_row_action.php
2013-06-28
4 кб.
tbl_select.php
2013-06-28
17 кб.
tbl_sql.php
2013-06-28
911 байт
tbl_structure.php
2013-06-28
34 кб.
themes.php
2013-06-28
1 кб.
transformation_overview.php
2013-06-28
2 кб.
transformation_wrapper.php
2013-06-28
4 кб.
translators.html
2013-06-28
8 кб.
user_password.php
2013-06-28
3 кб.
view_create.php
2013-06-28
4 кб.
/admin/myadmin2
Загрузить файлы
Файл 1
Файл 2
Файл 3