本文整理汇总了PHP中PMA_setDisplayMode函数的典型用法代码示例。如果您正苦于以下问题:PHP PMA_setDisplayMode函数的具体用法?PHP PMA_setDisplayMode怎么用?PHP PMA_setDisplayMode使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PMA_setDisplayMode函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: PMA_displayTable
/**
* Displays a table of results returned by a sql query.
* This function is called by the "sql.php" script.
*
* @param integer the link id associated to the query which results have
* to be displayed
* @param array the display mode
* @param array the analyzed query
*
* @global string $db the database name
* @global string $table the table name
* @global string $goto the url to go back in case of errors
* @global boolean $dontlimitchars whether to limit the number of displayed
* characters of text type fields or not
* @global string $sql_query the current sql query
* @global integer $num_rows the total number of rows returned by the
* sql query
* @global integer $unlim_num_rows the total number of rows returned by the
* sql query without any programmatically
* appended "LIMIT" clause
* @global integer $pos the current postion of the first record
* to be displayed
* @global array $fields_meta the list of fields properties
* @global integer $fields_cnt the total number of fields returned by
* the sql query
* @global array $vertical_display informations used with vertical display
* mode
* @global string $disp_direction the display mode
* (horizontal/vertical/horizontalflipped)
* @global integer $repeat_cells the number of row to display between two
* table headers
* @global array $highlight_columns collumn names to highlight
* @global array $cfgRelation the relation settings
*
* @access private
*
* @see PMA_showMessage(), PMA_setDisplayMode(),
* PMA_displayTableNavigation(), PMA_displayTableHeaders(),
* PMA_displayTableBody(), PMA_displayResultsOperations()
*/
function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql)
{
global $db, $table, $goto, $dontlimitchars;
global $sql_query, $num_rows, $unlim_num_rows, $pos, $fields_meta, $fields_cnt;
global $vertical_display, $disp_direction, $repeat_cells, $highlight_columns;
global $cfgRelation;
// 1. ----- Prepares the work -----
// 1.1 Gets the informations about which functionnalities should be
// displayed
$total = '';
$is_display = PMA_setDisplayMode($the_disp_mode, $total);
if ($total == '') {
unset($total);
}
// 1.2 Defines offsets for the next and previous pages
if ($is_display['nav_bar'] == '1') {
if (!isset($pos)) {
$pos = 0;
}
if ($GLOBALS['session_max_rows'] == 'all') {
$pos_next = 0;
$pos_prev = 0;
} else {
$pos_next = $pos + $GLOBALS['cfg']['MaxRows'];
$pos_prev = $pos - $GLOBALS['cfg']['MaxRows'];
if ($pos_prev < 0) {
$pos_prev = 0;
}
}
}
// end if
// 1.3 Urlencodes the query to use in input form fields
$encoded_sql_query = urlencode($sql_query);
// 2. ----- Displays the top of the page -----
// 2.1 Displays a messages with position informations
if ($is_display['nav_bar'] == '1' && isset($pos_next)) {
if (isset($unlim_num_rows) && $unlim_num_rows != $total) {
$selectstring = ', ' . $unlim_num_rows . ' ' . $GLOBALS['strSelectNumRows'];
} else {
$selectstring = '';
}
$last_shown_rec = $GLOBALS['session_max_rows'] == 'all' || $pos_next > $total ? $total - 1 : $pos_next - 1;
PMA_showMessage($GLOBALS['strShowingRecords'] . " {$pos} - {$last_shown_rec} (" . PMA_formatNumber($total, 0) . ' ' . $GLOBALS['strTotal'] . $selectstring . ', ' . sprintf($GLOBALS['strQueryTime'], $GLOBALS['querytime']) . ')');
if (isset($table) && PMA_Table::isView($db, $table) && $total == $GLOBALS['cfg']['MaxExactCount']) {
echo '<div class="notice">' . "\n";
echo PMA_sanitize(sprintf($GLOBALS['strViewMaxExactCount'], PMA_formatNumber($GLOBALS['cfg']['MaxExactCount'], 0), '[a@./Documentation.html#cfg_MaxExactCount@_blank]', '[/a]')) . "\n";
echo '</div>' . "\n";
}
} elseif (!isset($GLOBALS['printview']) || $GLOBALS['printview'] != '1') {
PMA_showMessage($GLOBALS['strSQLQuery']);
}
// 2.3 Displays the navigation bars
if (!isset($table) || strlen(trim($table)) == 0) {
if (isset($analyzed_sql[0]['query_type']) && $analyzed_sql[0]['query_type'] == 'SELECT') {
// table does not always contain a real table name,
// for example in MySQL 5.0.x, the query SHOW STATUS
// returns STATUS as a table name
$table = $fields_meta[0]->table;
} else {
$table = '';
//.........这里部分代码省略.........
示例2: PMA_displayTable
/**
* Displays a table of results returned by a SQL query.
* This function is called by the "sql.php" script.
*
* @param integer the link id associated to the query which results have
* to be displayed
* @param array the display mode
* @param array the analyzed query
*
* @uses $_SESSION['tmp_user_values']['pos']
* @global string $db the database name
* @global string $table the table name
* @global string $goto the URL to go back in case of errors
* @global string $sql_query the current SQL query
* @global integer $num_rows the total number of rows returned by the
* SQL query
* @global integer $unlim_num_rows the total number of rows returned by the
* SQL query without any programmatically
* appended "LIMIT" clause
* @global array $fields_meta the list of fields properties
* @global integer $fields_cnt the total number of fields returned by
* the SQL query
* @global array $vertical_display informations used with vertical display
* mode
* @global array $highlight_columns column names to highlight
* @global array $cfgRelation the relation settings
*
* @access private
*
* @see PMA_showMessage(), PMA_setDisplayMode(),
* PMA_displayTableNavigation(), PMA_displayTableHeaders(),
* PMA_displayTableBody(), PMA_displayResultsOperations()
*/
function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql)
{
global $db, $table, $goto;
global $sql_query, $num_rows, $unlim_num_rows, $fields_meta, $fields_cnt;
global $vertical_display, $highlight_columns;
global $cfgRelation;
global $showtable;
// why was this called here? (already called from sql.php)
//PMA_displayTable_checkConfigParams();
/**
* @todo move this to a central place
* @todo for other future table types
*/
$is_innodb = isset($showtable['Type']) && $showtable['Type'] == 'InnoDB';
if ($is_innodb && !isset($analyzed_sql[0]['queryflags']['union']) && !isset($analyzed_sql[0]['table_ref'][1]['table_name']) && (empty($analyzed_sql[0]['where_clause']) || $analyzed_sql[0]['where_clause'] == '1 ')) {
// "j u s t b r o w s i n g"
$pre_count = '~';
$after_count = PMA_showHint(PMA_sanitize($GLOBALS['strApproximateCount']), true);
} else {
$pre_count = '';
$after_count = '';
}
// 1. ----- Prepares the work -----
// 1.1 Gets the informations about which functionalities should be
// displayed
$total = '';
$is_display = PMA_setDisplayMode($the_disp_mode, $total);
// 1.2 Defines offsets for the next and previous pages
if ($is_display['nav_bar'] == '1') {
if ($_SESSION['tmp_user_values']['max_rows'] == 'all') {
$pos_next = 0;
$pos_prev = 0;
} else {
$pos_next = $_SESSION['tmp_user_values']['pos'] + $_SESSION['tmp_user_values']['max_rows'];
$pos_prev = $_SESSION['tmp_user_values']['pos'] - $_SESSION['tmp_user_values']['max_rows'];
if ($pos_prev < 0) {
$pos_prev = 0;
}
}
}
// end if
// 1.3 Find the sort expression
// we need $sort_expression and $sort_expression_nodirection
// even if there are many table references
if (!empty($analyzed_sql[0]['order_by_clause'])) {
$sort_expression = trim(str_replace(' ', ' ', $analyzed_sql[0]['order_by_clause']));
/**
* Get rid of ASC|DESC
*/
preg_match('@(.*)([[:space:]]*(ASC|DESC))@si', $sort_expression, $matches);
$sort_expression_nodirection = isset($matches[1]) ? trim($matches[1]) : $sort_expression;
$sort_direction = isset($matches[2]) ? trim($matches[2]) : '';
unset($matches);
} else {
$sort_expression = $sort_expression_nodirection = $sort_direction = '';
}
// 1.4 Prepares display of first and last value of the sorted column
if (!empty($sort_expression_nodirection)) {
list($sort_table, $sort_column) = explode('.', $sort_expression_nodirection);
$sort_table = PMA_unQuote($sort_table);
$sort_column = PMA_unQuote($sort_column);
// find the sorted column index in row result
// (this might be a multi-table query)
$sorted_column_index = false;
foreach ($fields_meta as $key => $meta) {
if ($meta->table == $sort_table && $meta->name == $sort_column) {
$sorted_column_index = $key;
//.........这里部分代码省略.........
示例3: PMA_displayTable
/**
* Displays a table of results returned by a sql query.
* This function is called by the "sql.php" script.
*
* @param integer the link id associated to the query which results have
* to be displayed
* @param array the display mode
* @param array the analyzed query
*
* @global string the current language
* @global integer the server to use (refers to the number in the
* configuration file)
* @global array the current server config
* @global string the database name
* @global string the table name
* @global string the url to go back in case of errors
* @global string the current sql query
* @global integer the total number of rows returned by the sql query
* @global integer the total number of rows returned by the sql query
* without any programmatically appended "LIMIT" clause
* @global integer the current postion of the first record to be
* displayed
* @global array the list of fields properties
* @global integer the total number of fields returned by the sql query
* @global array informations used with vertical display mode
* @global string the display mode (horizontal/vertical/horizontalflipped)
* @global integer the number of row to display between two table headers
* @global boolean whether to limit the number of displayed characters of
* text type fields or not
* @global array the relation settings
*
* @access private
*
* @see PMA_showMessage(), PMA_setDisplayMode(),
* PMA_displayTableNavigation(), PMA_displayTableHeaders(),
* PMA_displayTableBody()
*/
function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql)
{
global $lang, $server, $cfg, $db, $table;
global $goto;
global $sql_query, $num_rows, $unlim_num_rows, $pos, $fields_meta, $fields_cnt;
global $vertical_display, $disp_direction, $repeat_cells, $highlight_columns;
global $dontlimitchars;
global $cfgRelation;
// 1. ----- Prepares the work -----
// 1.1 Gets the informations about which functionnalities should be
// displayed
$total = '';
$is_display = PMA_setDisplayMode($the_disp_mode, $total);
if ($total == '') {
unset($total);
}
// 1.2 Defines offsets for the next and previous pages
if ($is_display['nav_bar'] == '1') {
if (!isset($pos)) {
$pos = 0;
}
if ($GLOBALS['session_max_rows'] == 'all') {
$pos_next = 0;
$pos_prev = 0;
} else {
$pos_next = $pos + $GLOBALS['cfg']['MaxRows'];
$pos_prev = $pos - $GLOBALS['cfg']['MaxRows'];
if ($pos_prev < 0) {
$pos_prev = 0;
}
}
}
// end if
// 1.3 Urlencodes the query to use in input form fields
$encoded_sql_query = urlencode($sql_query);
// 2. ----- Displays the top of the page -----
// 2.1 Displays a messages with position informations
if ($is_display['nav_bar'] == '1' && isset($pos_next)) {
if (isset($unlim_num_rows) && $unlim_num_rows != $total) {
$selectstring = ', ' . $unlim_num_rows . ' ' . $GLOBALS['strSelectNumRows'];
} else {
$selectstring = '';
}
$last_shown_rec = $GLOBALS['session_max_rows'] == 'all' || $pos_next > $total ? $total - 1 : $pos_next - 1;
PMA_showMessage($GLOBALS['strShowingRecords'] . " {$pos} - {$last_shown_rec} ({$total} " . $GLOBALS['strTotal'] . $selectstring . ', ' . sprintf($GLOBALS['strQueryTime'], $GLOBALS['querytime']) . ')');
} else {
if (!isset($GLOBALS['printview']) || $GLOBALS['printview'] != '1') {
PMA_showMessage($GLOBALS['strSQLQuery']);
}
}
// 2.3 Displays the navigation bars
if (!isset($table) || strlen(trim($table)) == 0) {
$table = $fields_meta[0]->table;
}
if ($is_display['nav_bar'] == '1') {
PMA_displayTableNavigation($pos_next, $pos_prev, $encoded_sql_query);
echo "\n";
} else {
if (!isset($GLOBALS['printview']) || $GLOBALS['printview'] != '1') {
echo "\n" . '<br /><br />' . "\n";
}
}
// 2b ----- Get field references from Database -----
//.........这里部分代码省略.........
示例4: PMA_displayTable
/**
* Displays a table of results returned by a sql query.
* This function is called by the "sql.php" script.
*
* @param integer the link id associated to the query which results have
* to be displayed
* @param array the display mode
* @param array the analyzed query
*
* @global string the current language
* @global integer the server to use (refers to the number in the
* configuration file)
* @global array the current server config
* @global string the database name
* @global string the table name
* @global string the url to go back in case of errors
* @global string the current sql query
* @global integer the total number of rows returned by the sql query
* @global integer the total number of rows returned by the sql query
* without any programmatically appended "LIMIT" clause
* @global integer the current postion of the first record to be
* displayed
* @global array the list of fields properties
* @global integer the total number of fields returned by the sql query
* @global array informations used with vertical display mode
* @global string the display mode (horizontal/vertical/horizontalflipped)
* @global integer the number of row to display between two table headers
* @global boolean whether to limit the number of displayed characters of
* text type fields or not
* @global array the relation settings
*
* @access private
*
* @see PMA_showMessage(), PMA_setDisplayMode(),
* PMA_displayTableNavigation(), PMA_displayTableHeaders(),
* PMA_displayTableBody()
*/
function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql)
{
global $lang, $server, $cfg, $db, $table;
global $goto, $text_url;
global $sql_query, $num_rows, $unlim_num_rows, $pos, $fields_meta, $fields_cnt;
global $vertical_display, $disp_direction, $repeat_cells, $highlight_columns;
global $dontlimitchars;
global $cfgRelation;
// 1. ----- Prepares the work -----
// 1.1 Gets the informations about which functionnalities should be
// displayed
$total = '';
$is_display = PMA_setDisplayMode($the_disp_mode, $total);
if ($total == '') {
unset($total);
}
// 1.2 Defines offsets for the next and previous pages
if ($is_display['nav_bar'] == '1') {
if (!isset($pos)) {
$pos = 0;
}
if ($GLOBALS['session_max_rows'] == 'all') {
$pos_next = 0;
$pos_prev = 0;
} else {
$pos_next = $pos + $GLOBALS['cfg']['MaxRows'];
$pos_prev = $pos - $GLOBALS['cfg']['MaxRows'];
if ($pos_prev < 0) {
$pos_prev = 0;
}
}
}
// end if
// 1.3 Urlencodes the query to use in input form fields
$encoded_sql_query = urlencode($sql_query);
// 2. ----- Displays the top of the page -----
// 2.1 Displays a messages with position informations
if ($is_display['nav_bar'] == '1' && isset($pos_next)) {
if (isset($unlim_num_rows) && $unlim_num_rows != $total) {
$selectstring = ', ' . $unlim_num_rows . ' ' . $GLOBALS['strSelectNumRows'];
} else {
$selectstring = '';
}
$last_shown_rec = $GLOBALS['session_max_rows'] == 'all' || $pos_next > $total ? $total - 1 : $pos_next - 1;
PMA_showMessage($GLOBALS['strShowingRecords'] . " {$pos} - {$last_shown_rec} ({$total} " . $GLOBALS['strTotal'] . $selectstring . ', ' . sprintf($GLOBALS['strQueryTime'], $GLOBALS['querytime']) . ')');
} else {
if (!isset($GLOBALS['printview']) || $GLOBALS['printview'] != '1') {
PMA_showMessage($GLOBALS['strSQLQuery']);
}
}
// 2.3 Displays the navigation bars
if (!isset($table) || strlen(trim($table)) == 0) {
$table = $fields_meta[0]->table;
}
if ($is_display['nav_bar'] == '1') {
PMA_displayTableNavigation($pos_next, $pos_prev, $encoded_sql_query);
echo "\n";
} else {
if (!isset($GLOBALS['printview']) || $GLOBALS['printview'] != '1') {
echo "\n" . '<br /><br />' . "\n";
}
}
// 2b ----- Get field references from Database -----
//.........这里部分代码省略.........
示例5: PMA_displayTable
/**
* Displays a table of results returned by a sql query.
* This function is called by the "sql.php" script.
*
* @param integer the link id associated to the query which results have
* to be displayed
* @param array the display mode
*
* @global string the current language
* @global integer the server to use (refers to the number in the
* configuration file)
* @global array the current server config
* @global string the database name
* @global string the table name
* @global string the url to go back in case of errors
* @global string the current sql query
* @global integer the total number of rows returned by the sql query
* @global integer the total number of rows returned by the sql query
* without any programmatically appended "LIMIT" clause
* @global integer the current postion of the first record to be
* displayed
* @global array the list of fields properties
* @global integer the total number of fields returned by the sql query
* @global array informations used with vertical display mode
* @global string the display mode (horizontal/vertical)
* @global integer the number of row to display between two table headers
* @global boolean whether to limit the number of displayed characters of
* text type fields or not
*
* @access private
*
* @see PMA_showMessage(), PMA_setDisplayMode(),
* PMA_displayTableNavigation(), PMA_displayTableHeaders(),
* PMA_displayTableBody()
*/
function PMA_displayTable(&$dt_result, &$the_disp_mode)
{
global $lang, $server, $cfgServer, $db, $table;
global $goto;
global $sql_query, $num_rows, $unlim_num_rows, $pos, $fields_meta, $fields_cnt;
global $vertical_display, $disp_direction, $repeat_cells;
global $dontlimitchars;
//Modifié par Boris Sanègre
/*echo
"
<center>
<font size=4>
Gestion des données: "
. $table
. "
</font size>
</center>
<br>
<br>
";
*/
// 1. ----- Prepares the work -----
// 1.1 Gets the informations about which functionnalities should be
// displayed
$total = '';
$is_display = PMA_setDisplayMode($the_disp_mode, $total);
if ($total == '') {
unset($total);
}
// 1.2 Defines offsets for the next and previous pages
if ($is_display['nav_bar'] == '1') {
if (!isset($pos)) {
$pos = 0;
}
if ($GLOBALS['session_max_rows'] == 'all') {
$pos_next = 0;
$pos_prev = 0;
} else {
$pos_next = $pos + $GLOBALS['cfgMaxRows'];
$pos_prev = $pos - $GLOBALS['cfgMaxRows'];
if ($pos_prev < 0) {
$pos_prev = 0;
}
}
}
// end if
// 1.3 Urlencodes the query to use in input form fields ($sql_query
// will be stripslashed in 'sql.php' if the 'magic_quotes_gpc'
// directive is set to 'on')
if (get_magic_quotes_gpc()) {
$encoded_sql_query = urlencode(addslashes($sql_query));
} else {
$encoded_sql_query = urlencode($sql_query);
}
// 2. ----- Displays the top of the page -----
// 2.1 Displays a messages with position informations
if ($is_display['nav_bar'] == '1' && isset($pos_next)) {
if (isset($unlim_num_rows) && $unlim_num_rows != $total) {
$selectstring = ', ' . $unlim_num_rows . ' ' . $GLOBALS['strSelectNumRows'];
} else {
$selectstring = '';
}
$last_shown_rec = $GLOBALS['session_max_rows'] == 'all' || $pos_next > $total ? $total - 1 : $pos_next - 1;
PMA_showMessage($GLOBALS['strShowingRecords'] . " {$pos} - {$last_shown_rec} ({$total} " . $GLOBALS['strTotal'] . $selectstring . ')');
} else {
//.........这里部分代码省略.........