本文整理汇总了PHP中PMA_getHtmlForCreateTable函数的典型用法代码示例。如果您正苦于以下问题:PHP PMA_getHtmlForCreateTable函数的具体用法?PHP PMA_getHtmlForCreateTable怎么用?PHP PMA_getHtmlForCreateTable使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PMA_getHtmlForCreateTable函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testPMAGetHtmlForCreateTable
/**
* Test for PMA_getHtmlForCreateTable
*
* @return void
*/
public function testPMAGetHtmlForCreateTable()
{
$db = "pma_db";
//Call the test function
$html = PMA_getHtmlForCreateTable($db);
//getImage
$this->assertContains(PMA\libraries\Util::getImage('b_table_add.png'), $html);
//__('Create table')
$this->assertContains(__('Create table'), $html);
//PMA_URL_getHiddenInputs
$this->assertContains(PMA_URL_getHiddenInputs($db), $html);
//label
$this->assertContains(__('Name'), $html);
$this->assertContains(__('Number of columns'), $html);
//button
$this->assertContains(__('Go'), $html);
}
示例2: indexAction
/**
* Index action
*
* @return void
*/
public function indexAction()
{
// Add/Remove favorite tables using Ajax request.
if ($GLOBALS['is_ajax_request'] && !empty($_REQUEST['favorite_table'])) {
$this->addRemoveFavoriteTablesAction();
return;
}
$this->response->getHeader()->getScripts()->addFiles(array('db_structure.js', 'tbl_change.js', 'jquery/jquery-ui-timepicker-addon.js'));
// Drops/deletes/etc. multiple tables if required
if (!empty($_POST['submit_mult']) && isset($_POST['selected_tbl']) || isset($_POST['mult_btn'])) {
$action = 'db_structure.php';
$err_url = 'db_structure.php' . PMA_URL_getCommon(array('db' => $this->db));
// see bug #2794840; in this case, code path is:
// db_structure.php -> libraries/mult_submits.inc.php -> sql.php
// -> db_structure.php and if we got an error on the multi submit,
// we must display it here and not call again mult_submits.inc.php
if (!isset($_POST['error']) || false === $_POST['error']) {
include 'libraries/mult_submits.inc.php';
}
if (empty($_POST['message'])) {
$_POST['message'] = PMA_Message::success();
}
}
$this->_url_query .= '&goto=db_structure.php';
// Gets the database structure
$sub_part = '_structure';
list($tables, $num_tables, $total_num_tables, $sub_part, $is_show_stats, $db_is_system_schema, $tooltip_truename, $tooltip_aliasname, $pos) = PMA_Util::getDbInfo($GLOBALS['db'], isset($sub_part) ? $sub_part : '');
$this->_tables = $tables;
// updating $tables seems enough for #11376, but updating other
// variables too in case they may cause some other problem.
$this->_num_tables = $num_tables;
$this->_pos = $pos;
$this->_db_is_system_schema = $db_is_system_schema;
$this->_total_num_tables = $total_num_tables;
$this->_is_show_stats = $is_show_stats;
// If there is an Ajax request for real row count of a table.
if ($GLOBALS['is_ajax_request'] && isset($_REQUEST['real_row_count']) && $_REQUEST['real_row_count'] == true) {
$this->handleRealRowCountRequestAction();
return;
}
if (!PMA_DRIZZLE) {
include_once 'libraries/replication.inc.php';
} else {
$GLOBALS['replication_info']['slave']['status'] = false;
}
PMA_PageSettings::showGroup('DbStructure');
$db_collation = PMA_getDbCollation($this->db);
$titles = PMA_Util::buildActionTitles();
// 1. No tables
if ($this->_num_tables == 0) {
$this->response->addHTML(PMA_message::notice(__('No tables found in database.')));
if (empty($db_is_system_schema)) {
$this->response->addHTML(PMA_getHtmlForCreateTable($this->db));
}
return;
}
// else
// 2. Shows table information
/**
* Displays the tables list
*/
$this->response->addHTML('<div id="tableslistcontainer">');
$_url_params = array('pos' => $this->_pos, 'db' => $this->db);
// Add the sort options if they exists
if (isset($_REQUEST['sort'])) {
$_url_params['sort'] = $_REQUEST['sort'];
}
if (isset($_REQUEST['sort_order'])) {
$_url_params['sort_order'] = $_REQUEST['sort_order'];
}
$this->response->addHTML(PMA_Util::getListNavigator($this->_total_num_tables, $this->_pos, $_url_params, 'db_structure.php', 'frame_content', $GLOBALS['cfg']['MaxTableList']));
// table form
$this->response->addHTML(Template::get('database/structure/table_header')->render(array('db' => $this->db, 'db_is_system_schema' => $this->_db_is_system_schema, 'replication' => $GLOBALS['replication_info']['slave']['status'])));
$i = $sum_entries = 0;
$overhead_check = '';
$create_time_all = '';
$update_time_all = '';
$check_time_all = '';
$num_columns = $GLOBALS['cfg']['PropertiesNumColumns'] > 1 ? ceil($this->_num_tables / $GLOBALS['cfg']['PropertiesNumColumns']) + 1 : 0;
$row_count = 0;
$sum_size = (double) 0;
$overhead_size = (double) 0;
$hidden_fields = array();
$odd_row = true;
$overall_approx_rows = false;
// Instance of PMA_RecentFavoriteTable class.
$fav_instance = PMA_RecentFavoriteTable::getInstance('favorite');
foreach ($this->_tables as $keyname => $current_table) {
// Get valid statistics whatever is the table type
$drop_query = '';
$drop_message = '';
$already_favorite = false;
$overhead = '';
$table_is_view = false;
$table_encoded = urlencode($current_table['TABLE_NAME']);
//.........这里部分代码省略.........
开发者ID:TheBlackBloodyUnicorn,项目名称:pico_wanderblog,代码行数:101,代码来源:DatabaseStructureController.class.php
示例3: indexAction
/**
* Index action
*
* @return void
*/
public function indexAction()
{
// Add/Remove favorite tables using Ajax request.
if ($GLOBALS['is_ajax_request'] && !empty($_REQUEST['favorite_table'])) {
$this->addRemoveFavoriteTablesAction();
return;
}
// If there is an Ajax request for real row count of a table.
if ($GLOBALS['is_ajax_request'] && isset($_REQUEST['real_row_count']) && $_REQUEST['real_row_count'] == true) {
$this->handleRealRowCountRequestAction();
return;
}
// Drops/deletes/etc. multiple tables if required
if (!empty($_POST['submit_mult']) && isset($_POST['selected_tbl']) || isset($_POST['mult_btn'])) {
$this->multiSubmitAction();
}
$this->response->getHeader()->getScripts()->addFiles(array('db_structure.js', 'tbl_change.js', 'jquery/jquery-ui-timepicker-addon.js'));
$this->_url_query .= '&goto=db_structure.php';
// Gets the database structure
$sub_part = '_structure';
list($tables, $num_tables, $total_num_tables, , $is_show_stats, $db_is_system_schema, , , $pos) = Util::getDbInfo($GLOBALS['db'], $sub_part);
$this->_tables = $tables;
// updating $tables seems enough for #11376, but updating other
// variables too in case they may cause some other problem.
$this->_num_tables = $num_tables;
$this->_pos = $pos;
$this->_db_is_system_schema = $db_is_system_schema;
$this->_total_num_tables = $total_num_tables;
$this->_is_show_stats = $is_show_stats;
include_once 'libraries/replication.inc.php';
PageSettings::showGroup('DbStructure');
// 1. No tables
if ($this->_num_tables == 0) {
$this->response->addHTML(Message::notice(__('No tables found in database.')));
if (empty($db_is_system_schema)) {
$this->response->addHTML(PMA_getHtmlForCreateTable($this->db));
}
return;
}
// else
// 2. Shows table information
/**
* Displays the tables list
*/
$this->response->addHTML('<div id="tableslistcontainer">');
$_url_params = array('pos' => $this->_pos, 'db' => $this->db);
// Add the sort options if they exists
if (isset($_REQUEST['sort'])) {
$_url_params['sort'] = $_REQUEST['sort'];
}
if (isset($_REQUEST['sort_order'])) {
$_url_params['sort_order'] = $_REQUEST['sort_order'];
}
$this->response->addHTML(Util::getListNavigator($this->_total_num_tables, $this->_pos, $_url_params, 'db_structure.php', 'frame_content', $GLOBALS['cfg']['MaxTableList']));
$this->displayTableList();
// display again the table list navigator
$this->response->addHTML(Util::getListNavigator($this->_total_num_tables, $this->_pos, $_url_params, 'db_structure.php', 'frame_content', $GLOBALS['cfg']['MaxTableList']));
$this->response->addHTML('</div><hr />');
/**
* Work on the database
*/
/* DATABASE WORK */
/* Printable view of a table */
$this->response->addHTML(Template::get('database/structure/print_view_data_dictionary_link')->render(array('url_query' => $this->_url_query)));
if (empty($this->_db_is_system_schema)) {
$this->response->addHTML(PMA_getHtmlForCreateTable($this->db));
}
}
示例4: elseif
PMA\libraries\Message::success(__('Tracking data deleted successfully.'))->display();
} elseif ($_REQUEST['submit_mult'] == 'track') {
echo PMA_getHtmlForDataDefinitionAndManipulationStatements('db_tracking.php' . $url_query, 0, $GLOBALS['db'], $_REQUEST['selected_tbl']);
exit;
}
} else {
PMA\libraries\Message::notice(__('No tables selected.'))->display();
}
}
// Get tracked data about the database
$data = Tracker::getTrackedData($_REQUEST['db'], '', '1');
// No tables present and no log exist
if ($num_tables == 0 && count($data['ddlog']) == 0) {
echo '<p>', __('No tables found in database.'), '</p>', "\n";
if (empty($db_is_system_schema)) {
echo PMA_getHtmlForCreateTable($db);
}
exit;
}
// ---------------------------------------------------------------------------
$cfgRelation = PMA_getRelationsParam();
// Prepare statement to get HEAD version
$all_tables_query = ' SELECT table_name, MAX(version) as version FROM ' . PMA\libraries\Util::backquote($cfgRelation['db']) . '.' . PMA\libraries\Util::backquote($cfgRelation['tracking']) . ' WHERE db_name = \'' . PMA\libraries\Util::sqlAddSlashes($_REQUEST['db']) . '\' ' . ' GROUP BY table_name' . ' ORDER BY table_name ASC';
$all_tables_result = PMA_queryAsControlUser($all_tables_query);
// If a HEAD version exists
if (is_object($all_tables_result) && $GLOBALS['dbi']->numRows($all_tables_result) > 0) {
PMA_displayTrackedTables($GLOBALS['db'], $all_tables_result, $url_query, $pmaThemeImage, $text_dir, $cfgRelation);
}
$untracked_tables = PMA_getUntrackedTables($GLOBALS['db']);
// If untracked tables exist
if (count($untracked_tables) > 0) {
示例5: unset
if (isset($message)) {
echo PMA\libraries\Util::getMessage($message, $sql_query);
unset($message);
}
$_REQUEST['db_collation'] = PMA_getDbCollation($GLOBALS['db']);
$is_information_schema = $GLOBALS['dbi']->isSystemSchema($GLOBALS['db']);
$response->addHTML('<div id="boxContainer" data-box-width="300">');
if (!$is_information_schema) {
if ($cfgRelation['commwork']) {
/**
* database comment
*/
$response->addHTML(PMA_getHtmlForDatabaseComment($GLOBALS['db']));
}
$response->addHTML('<div class="operations_half_width">');
$response->addHTML(PMA_getHtmlForCreateTable($db));
$response->addHTML('</div>');
/**
* rename database
*/
if ($GLOBALS['db'] != 'mysql') {
$response->addHTML(PMA_getHtmlForRenameDatabase($GLOBALS['db']));
}
// Drop link if allowed
// Don't even try to drop information_schema.
// You won't be able to. Believe me. You won't.
// Don't allow to easily drop mysql database, RFE #1327514.
if (($is_superuser || $GLOBALS['cfg']['AllowUserDropDatabase']) && !$db_is_system_schema && $GLOBALS['db'] != 'mysql') {
$response->addHTML(PMA_getHtmlForDropDatabaseLink($GLOBALS['db']));
}
/**
示例6: indexAction
/**
* Index action
*
* @return void
*/
public function indexAction()
{
// Database structure
if ($this->_type == 'db') {
// Add/Remove favorite tables using Ajax request.
if ($GLOBALS['is_ajax_request'] && !empty($_REQUEST['favorite_table'])) {
$this->addRemoveFavoriteTables();
return;
}
$this->response->getHeader()->getScripts()->addFiles(array('db_structure.js', 'tbl_change.js', 'jquery/jquery-ui-timepicker-addon.js'));
// Drops/deletes/etc. multiple tables if required
if (!empty($_POST['submit_mult']) && isset($_POST['selected_tbl']) || isset($_POST['mult_btn'])) {
$action = 'db_structure.php';
$err_url = 'db_structure.php' . PMA_URL_getCommon(array('db' => $this->_db));
// see bug #2794840; in this case, code path is:
// db_structure.php -> libraries/mult_submits.inc.php -> sql.php
// -> db_structure.php and if we got an error on the multi submit,
// we must display it here and not call again mult_submits.inc.php
if (!isset($_POST['error']) || false === $_POST['error']) {
include 'libraries/mult_submits.inc.php';
}
if (empty($_POST['message'])) {
$_POST['message'] = PMA_Message::success();
}
}
$this->_url_query .= '&goto=db_structure.php';
// Gets the database structure
$sub_part = '_structure';
// If there is an Ajax request for real row count of a table.
if ($GLOBALS['is_ajax_request'] && isset($_REQUEST['real_row_count']) && $_REQUEST['real_row_count'] == true) {
$this->handleRealRowCountRequestAction();
return;
}
if (!PMA_DRIZZLE) {
include_once 'libraries/replication.inc.php';
} else {
$GLOBALS['replication_info']['slave']['status'] = false;
}
PMA_PageSettings::showGroup('DbStructure');
$db_collation = PMA_getDbCollation($this->_db);
$titles = PMA_Util::buildActionTitles();
// 1. No tables
if ($this->_num_tables == 0) {
$this->response->addHTML(PMA_message::notice(__('No tables found in database.')));
if (empty($db_is_system_schema)) {
$this->response->addHTML(PMA_getHtmlForCreateTable($this->_db));
}
return;
}
// else
// 2. Shows table information
/**
* Displays the tables list
*/
$this->response->addHTML('<div id="tableslistcontainer">');
$_url_params = array('pos' => $this->_pos, 'db' => $this->_db);
// Add the sort options if they exists
if (isset($_REQUEST['sort'])) {
$_url_params['sort'] = $_REQUEST['sort'];
}
if (isset($_REQUEST['sort_order'])) {
$_url_params['sort_order'] = $_REQUEST['sort_order'];
}
$this->response->addHTML(PMA_Util::getListNavigator($this->_total_num_tables, $this->_pos, $_url_params, 'db_structure.php', 'frame_content', $GLOBALS['cfg']['MaxTableList']));
// table form
$this->response->addHTML(Template::get('structure/table_header')->render(array('db' => $this->_db, 'db_is_system_schema' => $this->_db_is_system_schema, 'replication' => $GLOBALS['replication_info']['slave']['status'])));
$i = $sum_entries = 0;
$overhead_check = '';
$create_time_all = '';
$update_time_all = '';
$check_time_all = '';
$num_columns = $GLOBALS['cfg']['PropertiesNumColumns'] > 1 ? ceil($this->_num_tables / $GLOBALS['cfg']['PropertiesNumColumns']) + 1 : 0;
$row_count = 0;
$sum_size = (double) 0;
$overhead_size = (double) 0;
$hidden_fields = array();
$odd_row = true;
$overall_approx_rows = false;
// Instance of PMA_RecentFavoriteTable class.
$fav_instance = PMA_RecentFavoriteTable::getInstance('favorite');
foreach ($this->_tables as $keyname => $current_table) {
// Get valid statistics whatever is the table type
$drop_query = '';
$drop_message = '';
$already_favorite = false;
$overhead = '';
$table_is_view = false;
$table_encoded = urlencode($current_table['TABLE_NAME']);
// Sets parameters for links
$tbl_url_query = $this->_url_query . '&table=' . $table_encoded;
// do not list the previous table's size info for a view
list($current_table, $formatted_size, $unit, $formatted_overhead, $overhead_unit, $overhead_size, $table_is_view, $sum_size) = $this->getStuffForEngineTypeTable($current_table, $this->_db_is_system_schema, $this->_is_show_stats, $sum_size, $overhead_size);
if (!$this->dbi->getTable($this->_db, $current_table['TABLE_NAME'])->isMerge()) {
$sum_entries += $current_table['TABLE_ROWS'];
}
//.........这里部分代码省略.........