zoukankan      html  css  js  c++  java
  • thinkPHP 分页样式增加下拉列表

    $linkPage="  <select name='sldd' style='40px;height:30px;border:1px red block;' onchange='location.href=this.options[this.selectedIndex].value;'>";
            
            for($i=1;$i<=$this->totalPages;$i++)//rollpages=>totalPages
            {
                if(($this->nowPage - $now_cool_page) <= 0 )
                {
                    $page = $i;
                }
                elseif(($this->nowPage + $now_cool_page - 1) >= $this->totalPages)
                {
                    $page = $this->totalPages + $i;
                }
                else
                {
                    $page = $this->nowPage - $now_cool_page_ceil + $i;
                }
            
                if($page!=$this->nowPage)
                {
                    if($page<=$this->totalPages)
                    {
                        $linkPage .= "<option value='".$this->url($page)."'>".$page."</option>";
                    }else{
                        break;
                    }
                }else{
                    if($this->totalPages != 1)
                    {
                        $linkPage .= "<option value='".$this->url($page)."' selected='selected'>".$page."</option>";
                    }
                }
            }
            $linkPage.="</select>";

    $page_str = str_replace(
                array('%HEADER%', '%NOW_PAGE%', '%UP_PAGE%', '%DOWN_PAGE%', '%FIRST%', '%LINK_PAGE%', '%END%', '%TOTAL_ROW%', '%TOTAL_PAGE%','%SELECT_PAGE%'),
                array($this->config['header'], $this->nowPage, $up_page, $down_page, $the_first, $link_page, $the_end, $this->totalRows, $this->totalPages,$linkPage),
                $this->config['theme']);
    return "<div class='pager'>{$page_str}</div>";

            $p = new ThinkPage($article_sum,C(PAGESIZE));
            $p->rollPage = 1;
            $p->setConfig('header', '<li class="rows">共<b>%TOTAL_ROW%</b>条记录&nbsp;第<b>%NOW_PAGE%</b>页/共<b>%TOTAL_PAGE%</b>页</li><li>%SELECT_PAGE%</li>');
            $p->setConfig('prev', '上一页');
            $p->setConfig('next', '下一页');
            $p->setConfig('last', '末页');
            $p->setConfig('first', '首页');
            $p->setConfig('theme', '%FIRST%%UP_PAGE%%LINK_PAGE%%DOWN_PAGE%%END%%HEADER%','%SELECT_PAGE%');
            
            $article_info=array_slice($article_info,$p->firstRow,$p->listRows);
            $this->assign('page',$p->show());

  • 相关阅读:
    点击退出 防止回退
    AngularJS select中ngOptions用法详解
    git hub
    .ashx datatable转excel
    写日志 log 到文件夹
    easyui layout 布局title
    easyui tree 折叠节点
    转json using指令
    Qt QWindow转QWidget
    CEF 重写弹窗事件
  • 原文地址:https://www.cnblogs.com/jhy-ocean/p/7477718.html
Copyright © 2011-2022 走看看