本文整理汇总了PHP中PMA_pageselector函数的典型用法代码示例。如果您正苦于以下问题:PHP PMA_pageselector函数的具体用法?PHP PMA_pageselector怎么用?PHP PMA_pageselector使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PMA_pageselector函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: PMA_listNavigator
/**
* Generate navigation for a list
*
* @param int $count number of elements in the list
* @param int $pos current position in the list
* @param array $_url_params url parameters
* @param string $script script name for form target
* @param string $frame target frame
* @param int $max_count maximum number of elements to display from the list
*
* @access public
*
* @todo use $pos from $_url_params
*/
function PMA_listNavigator($count, $pos, $_url_params, $script, $frame, $max_count)
{
if ($max_count < $count) {
echo 'frame_navigation' == $frame ? '<div id="navidbpageselector">' . "\n" : '';
echo __('Page number:');
echo 'frame_navigation' == $frame ? '<br />' : ' ';
// Move to the beginning or to the previous page
if ($pos > 0) {
// patch #474210 - part 1
if ($GLOBALS['cfg']['NavigationBarIconic']) {
$caption1 = '<<';
$caption2 = ' < ';
$title1 = ' title="' . _pgettext('First page', 'Begin') . '"';
$title2 = ' title="' . _pgettext('Previous page', 'Previous') . '"';
} else {
$caption1 = _pgettext('First page', 'Begin') . ' <<';
$caption2 = _pgettext('Previous page', 'Previous') . ' <';
$title1 = '';
$title2 = '';
}
// end if... else...
$_url_params['pos'] = 0;
echo '<a' . $title1 . ' href="' . $script . PMA_generate_common_url($_url_params) . '" target="' . $frame . '">' . $caption1 . '</a>';
$_url_params['pos'] = $pos - $max_count;
echo '<a' . $title2 . ' href="' . $script . PMA_generate_common_url($_url_params) . '" target="' . $frame . '">' . $caption2 . '</a>';
}
echo "\n", '<form action="./', basename($script), '" method="post" target="', $frame, '">', "\n";
echo PMA_generate_common_hidden_inputs($_url_params);
echo PMA_pageselector($max_count, floor(($pos + 1) / $max_count) + 1, ceil($count / $max_count));
echo '</form>';
if ($pos + $max_count < $count) {
if ($GLOBALS['cfg']['NavigationBarIconic']) {
$caption3 = ' > ';
$caption4 = '>>';
$title3 = ' title="' . _pgettext('Next page', 'Next') . '"';
$title4 = ' title="' . _pgettext('Last page', 'End') . '"';
} else {
$caption3 = '> ' . _pgettext('Next page', 'Next');
$caption4 = '>> ' . _pgettext('Last page', 'End');
$title3 = '';
$title4 = '';
}
// end if... else...
$_url_params['pos'] = $pos + $max_count;
echo '<a' . $title3 . ' href="' . $script . PMA_generate_common_url($_url_params) . '" target="' . $frame . '">' . $caption3 . '</a>';
$_url_params['pos'] = floor($count / $max_count) * $max_count;
if ($_url_params['pos'] == $count) {
$_url_params['pos'] = $count - $max_count;
}
echo '<a' . $title4 . ' href="' . $script . PMA_generate_common_url($_url_params) . '" target="' . $frame . '">' . $caption4 . '</a>';
}
echo "\n";
if ('frame_navigation' == $frame) {
echo '</div>' . "\n";
}
}
}
示例2: PMA_displayTableNavigation
//.........这里部分代码省略.........
" />
<input type="hidden" name="repeat_cells" value="<?php
echo $repeat_cells;
?>
" />
<input type="hidden" name="goto" value="<?php
echo $goto;
?>
" />
<input type="hidden" name="dontlimitchars" value="<?php
echo $dontlimitchars;
?>
" />
<input type="submit" name="navig" value="<?php
echo $caption4;
?>
"<?php
echo $title4;
?>
<?php
echo empty($onclick) ? '' : $onclick;
?>
/>
</form>
</td>
<?php
}
// end move toward
//page redirection
$pageNow = @floor($pos / $session_max_rows) + 1;
$nbTotalPage = @ceil($unlim_num_rows / $session_max_rows);
if ($nbTotalPage > 1) {
//if1
?>
<td>
</td>
<td>
<?php
//<form> for keep the form alignment of button < and <<
?>
<form action="none">
<?php
echo PMA_pageselector('sql.php?sql_query=' . $encoded_query . '&session_max_rows=' . $session_max_rows . '&disp_direction=' . $disp_direction . '&repeat_cells=' . $repeat_cells . '&goto=' . $goto . '&dontlimitchars=' . $dontlimitchars . '&' . PMA_generate_common_url($db, $table) . '&', $session_max_rows, $pageNow, $nbTotalPage);
?>
</form>
</td>
<?php
}
//_if1
// Show all the records if allowed
if ($GLOBALS['cfg']['ShowAll'] && $num_rows < $unlim_num_rows) {
echo "\n";
?>
<td>
</td>
<td>
<form action="sql.php" method="post">
<?php
echo PMA_generate_common_hidden_inputs($db, $table);
?>
<input type="hidden" name="sql_query" value="<?php
echo $encoded_query;
?>
" />
<input type="hidden" name="pos" value="0" />
<input type="hidden" name="session_max_rows" value="all" />
<input type="hidden" name="disp_direction" value="<?php
echo $disp_direction;
?>
" />
<input type="hidden" name="repeat_cells" value="<?php
echo $repeat_cells;
?>
" />
<input type="hidden" name="goto" value="<?php
echo $goto;
?>
" />
<input type="hidden" name="dontlimitchars" value="<?php
echo $dontlimitchars;
?>
" />
<input type="submit" name="navig" value="<?php
echo $GLOBALS['strShowAll'];
?>
" />
</form>
</td>
<?php
}
// end show all
echo "\n";
?>
</tr>
</table>
<?php
}
示例3: PMA_generate_common_url
$title2 = ' title="' . $GLOBALS['strPrevious'] . '"';
} else {
$caption1 = $GLOBALS['strPos1'] . ' <<';
$caption2 = $GLOBALS['strPrevious'] . ' <';
$title1 = '';
$title2 = '';
}
// end if... else...
$_url_params['pos'] = 0;
echo '<a' . $title1 . 'href="server_databases.php' . PMA_generate_common_url($_url_params) . '">' . $caption1 . '</a>';
$_url_params['pos'] = $pos - $GLOBALS['cfg']['MaxDbList'];
echo '<a' . $title2 . 'href="server_databases.php' . PMA_generate_common_url($_url_params) . '">' . $caption2 . '</a>';
}
echo '<form action="./server_databases.php" method="post">' . "\n";
echo PMA_generate_common_hidden_inputs($_url_params);
echo PMA_pageselector('server_databases.php' . PMA_generate_common_url($_url_params) . '&', $GLOBALS['cfg']['MaxDbList'], floor(($pos + 1) / $GLOBALS['cfg']['MaxDbList']) + 1, ceil($databases_count / $GLOBALS['cfg']['MaxDbList']));
echo '</form>';
if ($pos + $GLOBALS['cfg']['MaxDbList'] < $databases_count) {
if ($GLOBALS['cfg']['NavigationBarIconic']) {
$caption3 = ' > ';
$caption4 = '>>';
$title3 = ' title="' . $GLOBALS['strNext'] . '"';
$title4 = ' title="' . $GLOBALS['strEnd'] . '"';
} else {
$caption3 = '> ' . $GLOBALS['strNext'];
$caption4 = '>> ' . $GLOBALS['strEnd'];
$title3 = '';
$title4 = '';
}
// end if... else...
$_url_params['pos'] = $pos + $GLOBALS['cfg']['MaxDbList'];
示例4: PMA_displayTableNavigation
//.........这里部分代码省略.........
echo $pos_next >= $unlim_num_rows ? 0 : $pos_next;
?>
" class="textfield" onfocus="this.select()" />
<br />
<?php
// Display mode (horizontal/vertical and repeat headers)
$choices = array('horizontal' => $GLOBALS['strRowsModeHorizontal'], 'horizontalflipped' => $GLOBALS['strRowsModeFlippedHorizontal'], 'vertical' => $GLOBALS['strRowsModeVertical']);
$param1 = PMA_generate_html_dropdown('disp_direction', $choices, $_SESSION['tmp_user_values']['disp_direction'], $id_for_direction_dropdown);
unset($choices);
$param2 = ' <input type="text" size="3" name="repeat_cells" value="' . $_SESSION['tmp_user_values']['repeat_cells'] . '" class="textfield" />' . "\n" . ' ';
echo ' ' . sprintf($GLOBALS['strRowsModeOptions'], "\n" . $param1, "\n" . $param2) . "\n";
?>
</form>
</td>
<td>
</td>
<?php
// Move to the next page or to the last one
if ($_SESSION['tmp_user_values']['pos'] + $_SESSION['tmp_user_values']['max_rows'] < $unlim_num_rows && $num_rows >= $_SESSION['tmp_user_values']['max_rows'] && $_SESSION['tmp_user_values']['max_rows'] != 'all') {
// display the Next button
PMA_displayTableNavigationOneButton('>', $GLOBALS['strNext'], $pos_next, $html_sql_query);
// prepare some options for the End button
if ($is_innodb && $unlim_num_rows > $GLOBALS['cfg']['MaxExactCount']) {
$input_for_real_end = '<input type="hidden" name="find_real_end" value="1" />';
// no backquote around this message
$onclick = ' onclick="return confirmAction(\'' . PMA_jsFormat($GLOBALS['strLongOperation'], false) . '\')"';
} else {
$input_for_real_end = $onclick = '';
}
// display the End button
PMA_displayTableNavigationOneButton('>>', $GLOBALS['strEnd'], @((ceil($unlim_num_rows / $_SESSION['tmp_user_values']['max_rows']) - 1) * $_SESSION['tmp_user_values']['max_rows']), $html_sql_query, 'onsubmit="return ' . ($_SESSION['tmp_user_values']['pos'] + $_SESSION['tmp_user_values']['max_rows'] < $unlim_num_rows && $num_rows >= $_SESSION['tmp_user_values']['max_rows'] ? 'true' : 'false') . '"', $input_for_real_end, $onclick);
}
// end move toward
//page redirection
// (unless we are showing all records)
if ('all' != $_SESSION['tmp_user_values']['max_rows']) {
//if1
$pageNow = @floor($_SESSION['tmp_user_values']['pos'] / $_SESSION['tmp_user_values']['max_rows']) + 1;
$nbTotalPage = @ceil($unlim_num_rows / $_SESSION['tmp_user_values']['max_rows']);
if ($nbTotalPage > 1) {
//if2
?>
<td>
</td>
<td>
<?php
//<form> for keep the form alignment of button < and <<
?>
<form action="none">
<?php
$_url_params = array('db' => $db, 'table' => $table, 'sql_query' => $sql_query, 'goto' => $goto);
echo PMA_pageselector('sql.php' . PMA_generate_common_url($_url_params) . PMA_get_arg_separator('js'), $_SESSION['tmp_user_values']['max_rows'], $pageNow, $nbTotalPage, 200, 5, 5, 20, 10, $GLOBALS['strPageNumber']);
?>
</form>
</td>
<?php
}
//_if2
}
//_if1
// Display the "Show all" button if allowed
if ($GLOBALS['cfg']['ShowAll'] && $num_rows < $unlim_num_rows) {
echo "\n";
?>
<td>
</td>
<td>
<form action="sql.php" method="post">
<?php
echo PMA_generate_common_hidden_inputs($db, $table);
?>
<input type="hidden" name="sql_query" value="<?php
echo $html_sql_query;
?>
" />
<input type="hidden" name="pos" value="0" />
<input type="hidden" name="session_max_rows" value="all" />
<input type="hidden" name="goto" value="<?php
echo $goto;
?>
" />
<input type="submit" name="navig" value="<?php
echo $GLOBALS['strShowAll'];
?>
" />
</form>
</td>
<?php
}
// end show all
echo "\n";
?>
</tr>
</table>
<?php
}
示例5: urlencode
if (isset($rownumber)) {
$rownumber_param = '&rownumber=' . urlencode($rownumber);
} else {
$rownumber_param = '';
}
$gotopage = '';
$showall = '';
if (is_array($foreignData['disp_row'])) {
if ($cfg['ShowAll'] && $foreignData['the_total'] > $GLOBALS['cfg']['MaxRows']) {
$showall = '<input type="submit" name="foreign_navig" value="' . __('Show all') . '" />';
}
$session_max_rows = $GLOBALS['cfg']['MaxRows'];
$pageNow = @floor($pos / $session_max_rows) + 1;
$nbTotalPage = @ceil($foreignData['the_total'] / $session_max_rows);
if ($foreignData['the_total'] > $GLOBALS['cfg']['MaxRows']) {
$gotopage = PMA_pageselector($session_max_rows, $pageNow, $nbTotalPage, 200, 5, 5, 20, 10, __('Page number:'));
}
}
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xml:lang="<?php
echo $available_languages[$lang][1];
?>
"
lang="<?php
echo $available_languages[$lang][1];
?>
"
dir="<?php
echo $text_dir;
示例6: PMA_displayTableNavigation
//.........这里部分代码省略.........
?>
<input type="hidden" name="sql_query" value="<?php
echo $html_sql_query;
?>
" />
<input type="hidden" name="pos" value="<?php
echo @((ceil($unlim_num_rows / $_SESSION['userconf']['max_rows']) - 1) * $_SESSION['userconf']['max_rows']);
?>
" />
<?php
if ($is_innodb && $unlim_num_rows > $GLOBALS['cfg']['MaxExactCount']) {
echo '<input type="hidden" name="find_real_end" value="1" />' . "\n";
// no backquote around this message
$onclick = ' onclick="return confirmAction(\'' . PMA_jsFormat($GLOBALS['strLongOperation'], false) . '\')"';
}
?>
<input type="hidden" name="goto" value="<?php
echo $goto;
?>
" />
<input type="submit" name="navig" value="<?php
echo $caption4;
?>
"<?php
echo $title4;
?>
<?php
echo empty($onclick) ? '' : $onclick;
?>
/>
</form>
</td>
<?php
}
// end move toward
//page redirection
// (unless we are showing all records)
if ('all' != $_SESSION['userconf']['max_rows']) {
//if1
$pageNow = @floor($_SESSION['userconf']['pos'] / $_SESSION['userconf']['max_rows']) + 1;
$nbTotalPage = @ceil($unlim_num_rows / $_SESSION['userconf']['max_rows']);
if ($nbTotalPage > 1) {
//if2
?>
<td>
</td>
<td>
<?php
//<form> for keep the form alignment of button < and <<
?>
<form action="none">
<?php
echo PMA_pageselector('sql.php?sql_query=' . urlencode($sql_query) . '&goto=' . $goto . '&' . PMA_generate_common_url($db, $table) . '&', $_SESSION['userconf']['max_rows'], $pageNow, $nbTotalPage, 200, 5, 5, 20, 10, $GLOBALS['strPageNumber']);
?>
</form>
</td>
<?php
}
//_if2
}
//_if1
// Display the "Show all" button if allowed
if ($GLOBALS['cfg']['ShowAll'] && $num_rows < $unlim_num_rows) {
echo "\n";
?>
<td>
</td>
<td>
<form action="sql.php" method="post">
<?php
echo PMA_generate_common_hidden_inputs($db, $table);
?>
<input type="hidden" name="sql_query" value="<?php
echo $html_sql_query;
?>
" />
<input type="hidden" name="pos" value="0" />
<input type="hidden" name="session_max_rows" value="all" />
<input type="hidden" name="goto" value="<?php
echo $goto;
?>
" />
<input type="submit" name="navig" value="<?php
echo $GLOBALS['strShowAll'];
?>
" />
</form>
</td>
<?php
}
// end show all
echo "\n";
?>
</tr>
</table>
<?php
}
示例7: count
<?php
} else {
$pk_uri = '';
}
$gotopage = '';
$showall = '';
if (isset($disp_row) && is_array($disp_row)) {
$count = count($disp_row);
if ($cfg['ShowAll'] && $count > $per_page) {
$showall = '<input type="submit" name="foreign_navig" value="' . $strShowAll . '" />';
}
$session_max_rows = $per_page;
$pageNow = @floor($pos / $session_max_rows) + 1;
$nbTotalPage = @ceil($count / $session_max_rows);
if ($count > $per_page) {
$gotopage = PMA_pageselector('browse_foreigners.php?field=' . urlencode($field) . '&' . PMA_generate_common_url($db, $table) . $pk_uri . '&fieldkey=' . (isset($fieldkey) ? $fieldkey : '') . '&foreign_filter=' . (isset($foreign_filter) ? htmlspecialchars($foreign_filter) : '') . '&', $session_max_rows, $pageNow, $nbTotalPage);
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xml:lang="<?php
echo $available_languages[$lang][2];
?>
"
lang="<?php
echo $available_languages[$lang][2];
?>
"
dir="<?php
示例8: PMA_pageselector
}
$session_max_rows = $per_page;
$pageNow = @floor($pos / $session_max_rows) + 1;
$nbTotalPage = @ceil($foreignData['the_total'] / $session_max_rows);
if ($foreignData['the_total'] > $per_page) {
$gotopage = PMA_pageselector(
'browse_foreigners.php?field=' . urlencode($field) .
'&' . PMA_generate_common_url($db, $table)
. $pk_uri .
'&fieldkey=' . (isset($fieldkey) ? urlencode($fieldkey) : '') .
'&foreign_filter=' . (isset($foreign_filter) ? urlencode($foreign_filter) : '') .
'&',
$session_max_rows,
$pageNow,
$nbTotalPage,
200,
5,
5,
20,
10,
$GLOBALS['strPageNumber']
);
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xml:lang="<?php echo $available_languages[$lang][2]; ?>"
示例9: PMA_displayTableNavigation
/**
* Displays a navigation bar to browse among the results of a SQL query
*
* @param integer $pos_next the offset for the "next" page
* @param integer $pos_prev the offset for the "previous" page
* @param string $sql_query the URL-encoded query
* @param string $id_for_direction_dropdown the id for the direction dropdown
*
* @return nothing
*
* @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 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 any programmatically appended "LIMIT" clause
* @global boolean $is_innodb whether its InnoDB or not
* @global array $showtable table definitions
*
* @access private
*
* @see PMA_displayTable()
*/
function PMA_displayTableNavigation($pos_next, $pos_prev, $sql_query, $id_for_direction_dropdown)
{
global $db, $table, $goto;
global $num_rows, $unlim_num_rows;
global $is_innodb;
global $showtable;
// here, using htmlentities() would cause problems if the query
// contains accented characters
$html_sql_query = htmlspecialchars($sql_query);
/**
* @todo move this to a central place
* @todo for other future table types
*/
$is_innodb = isset($showtable['Type']) && $showtable['Type'] == 'InnoDB';
?>
<!-- Navigation bar -->
<table border="0" cellpadding="0" cellspacing="0" class="navigation">
<tr>
<td class="navigation_separator"></td>
<?php
// Move to the beginning or to the previous page
if ($_SESSION['tmp_user_values']['pos'] && $_SESSION['tmp_user_values']['max_rows'] != 'all') {
PMA_displayTableNavigationOneButton('<<', _pgettext('First page', 'Begin'), 0, $html_sql_query);
PMA_displayTableNavigationOneButton('<', _pgettext('Previous page', 'Previous'), $pos_prev, $html_sql_query);
}
// end move back
$nbTotalPage = 1;
//page redirection
// (unless we are showing all records)
if ('all' != $_SESSION['tmp_user_values']['max_rows']) {
//if1
$pageNow = @floor($_SESSION['tmp_user_values']['pos'] / $_SESSION['tmp_user_values']['max_rows']) + 1;
$nbTotalPage = @ceil($unlim_num_rows / $_SESSION['tmp_user_values']['max_rows']);
if ($nbTotalPage > 1) {
//if2
?>
<td>
<?php
$_url_params = array('db' => $db, 'table' => $table, 'sql_query' => $sql_query, 'goto' => $goto);
//<form> to keep the form alignment of button < and <<
// and also to know what to execute when the selector changes
echo '<form action="sql.php' . PMA_generate_common_url($_url_params) . '" method="post">';
echo PMA_pageselector($_SESSION['tmp_user_values']['max_rows'], $pageNow, $nbTotalPage, 200, 5, 5, 20, 10);
?>
</form>
</td>
<?php
}
//_if2
}
//_if1
// Display the "Show all" button if allowed
if ($num_rows < $unlim_num_rows && ($GLOBALS['cfg']['ShowAll'] || $GLOBALS['cfg']['MaxRows'] * 5 >= $unlim_num_rows)) {
echo "\n";
?>
<td>
<form action="sql.php" method="post">
<?php
echo PMA_generate_common_hidden_inputs($db, $table);
?>
<input type="hidden" name="sql_query" value="<?php
echo $html_sql_query;
?>
" />
<input type="hidden" name="pos" value="0" />
<input type="hidden" name="session_max_rows" value="all" />
<input type="hidden" name="goto" value="<?php
echo $goto;
?>
" />
<input type="submit" name="navig" value="<?php
echo __('Show all');
?>
" />
</form>
//.........这里部分代码省略.........