当前位置: 首页>>代码示例>>PHP>>正文


PHP Util::pageselector方法代码示例

本文整理汇总了PHP中PMA\libraries\Util::pageselector方法的典型用法代码示例。如果您正苦于以下问题:PHP Util::pageselector方法的具体用法?PHP Util::pageselector怎么用?PHP Util::pageselector使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PMA\libraries\Util的用法示例。


在下文中一共展示了Util::pageselector方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _getHtmlPageSelector

 /**
  * Possibly return a page selector for table navigation
  *
  * @param string $table_navigation_html the current navigation HTML
  *
  * @return array ($table_navigation_html, $nbTotalPage)
  *
  * @access  private
  *
  */
 private function _getHtmlPageSelector($table_navigation_html)
 {
     $pageNow = @floor($_SESSION['tmpval']['pos'] / $_SESSION['tmpval']['max_rows']) + 1;
     $nbTotalPage = @ceil($this->__get('unlim_num_rows') / $_SESSION['tmpval']['max_rows']);
     if ($nbTotalPage > 1) {
         $table_navigation_html .= '<td>';
         $_url_params = array('db' => $this->__get('db'), 'table' => $this->__get('table'), 'sql_query' => $this->__get('sql_query'), 'goto' => $this->__get('goto'), 'is_browse_distinct' => $this->__get('is_browse_distinct'));
         //<form> to keep the form alignment of button < and <<
         // and also to know what to execute when the selector changes
         $table_navigation_html .= '<form action="sql.php' . PMA_URL_getCommon($_url_params) . '" method="post">';
         $table_navigation_html .= Util::pageselector('pos', $_SESSION['tmpval']['max_rows'], $pageNow, $nbTotalPage, 200, 5, 5, 20, 10);
         $table_navigation_html .= '</form>' . '</td>';
     }
     return array($table_navigation_html, $nbTotalPage);
 }
开发者ID:rugbyprof,项目名称:phpmyadmin,代码行数:25,代码来源:DisplayResults.php

示例2: PMA_getHTMLforTableNavigation

/**
 * get the html for table navigation in Central columns page
 *
 * @param int    $total_rows total number of rows in complete result set
 * @param int    $pos        offset of first result with complete result set
 * @param string $db         current database
 *
 * @return string html for table navigation in Central columns page
 */
function PMA_getHTMLforTableNavigation($total_rows, $pos, $db)
{
    $max_rows = $GLOBALS['cfg']['MaxRows'];
    $pageNow = $pos / $max_rows + 1;
    $nbTotalPage = ceil($total_rows / $max_rows);
    $table_navigation_html = '<table style="display:inline-block;max-width:49%" ' . 'class="navigation nospacing nopadding">' . '<tr>' . '<td class="navigation_separator"></td>';
    if ($pos - $max_rows >= 0) {
        $table_navigation_html .= '<td>' . '<form action="db_central_columns.php" method="post">' . PMA_URL_getHiddenInputs($db) . '<input type="hidden" name="pos" value="' . ($pos - $max_rows) . '" />' . '<input type="hidden" name="total_rows" value="' . $total_rows . '"/>' . '<input type="submit" name="navig"' . ' class="ajax" ' . 'value="&lt" />' . '</form>' . '</td>';
    }
    if ($nbTotalPage > 1) {
        $table_navigation_html .= '<td>';
        $table_navigation_html .= '<form action="db_central_columns.php' . '" method="post">' . PMA_URL_getHiddenInputs($db) . '<input type="hidden" name="total_rows" value="' . $total_rows . '"/>';
        $table_navigation_html .= Util::pageselector('pos', $max_rows, $pageNow, $nbTotalPage);
        $table_navigation_html .= '</form>' . '</td>';
    }
    if ($pos + $max_rows < $total_rows) {
        $table_navigation_html .= '<td>' . '<form action="db_central_columns.php" method="post">' . PMA_URL_getHiddenInputs($db) . '<input type="hidden" name="pos" value="' . ($pos + $max_rows) . '" />' . '<input type="hidden" name="total_rows" value="' . $total_rows . '"/>' . '<input type="submit" name="navig"' . ' class="ajax" ' . 'value="&gt" />' . '</form>' . '</td>';
    }
    $table_navigation_html .= '</form>' . '</td>' . '<td class="navigation_separator"></td>' . '<td>' . '<span>' . __('Filter rows') . ':</span>' . '<input type="text" class="filter_rows" placeholder="' . __('Search this table') . '">' . '</td>' . '<td class="navigation_separator"></td>' . '</tr>' . '</table>';
    return $table_navigation_html;
}
开发者ID:itgsod-philip-skalander,项目名称:phpmyadmin,代码行数:30,代码来源:central_columns.lib.php


注:本文中的PMA\libraries\Util::pageselector方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。