當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。