$p = max(1, I('param.p',1,'intval'));
$count = count($date);
$Page = new Page($count,15);
$Page->setConfig('theme','<li class="head">共%TOTAL_ROW%条记录</li> %FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% <li class="ender">共 %TOTAL_PAGE%页,当前显示第'.$p.'页</li>'); $lists = array_slice($date, $Page->firstRow,$Page->listRows);
$pages = $Page->show(); $this->assign('pages',$pages);
$this->assign('list',$lists);
$this->assign('p', $p);
<table width="100%" cellpadding="0" cellspacing="0" border="0" class="formtable oelight" style="margin-top:10px;margin-bottom:100px;">
<thead>
<tr>
<th>name</th>
<th>dw</th>
<th>jj</th>
<th>wts</th>
<th>jjs</th>
</tr>
</thead>
<tbody>
<?php if(empty($list)){?>
<tr>
<td colspan="5" style="border-right:0px;">暂无信息记录</td>
</tr>
<?php }else{foreach($list as $info){?>
<tr>
<td><?php echo $users[$info['tid']];?></td> <td>
<?php echo $dpts[$info['code']]?>
</td>
<td><?php echo $users1[$info['toid']];?>&nbsp;&nbsp;</td>
<td>
<?php echo $info['zs']?>
&nbsp;&nbsp;
</td>
<td style="border-right:0px;">
<?php echo empty($info['my'])?0:$info['my'];?> &nbsp;&nbsp;
</td>
</tr>
<?php }?>
<?php }?>
<tr>
<td colspan="3" style="border-right:0px;border-top:1px solid #eee;text-align:right;">
<?php echo $pages;?>
</td>
</tr>
</tbody>
</table>

php 数组分页的更多相关文章

  1. PHP中的数组分页实现(非数据库)

    在日常开发的业务环境中,我们一般都会使用 MySQL 语句来实现分页的功能.但是,往往也有些数据并不多,或者只是获取 PHP 中定义的一些数组数据时需要分页的功能.这时,我们其实不需要每次都去查询数据 ...

  2. 基于thinkphp的数组分页

    function array_page($array,$rows){ import("ORG.Util.Page"); //导入分页类 $count=count($array); ...

  3. php数组分页类

    <?php class ArrayPage{ public $totalPage;//全部页数 public $lists;//每页显示数目 public $arr = array();//分页 ...

  4. laravel手动数组分页

    laravel文档中已经有写如何自己使用分页类去分页了,但没有详细说明. 如果你想手动创建分页实例并且最终得到一个数组类型的结果,可以根据需求来创建 IlluminatePaginationPagin ...

  5. TP5 数组分页

    需要 use think\Page; 我这个是 Page是从tp3.2的移到5.0来用的,如果你的里面没有这个也可以移动过来 PHP代码: $page= $this->request->p ...

  6. thinkphp几个表的数据合并,并用数组分页

    控制器: //金币扣除 public function jbkc(){ $map['UG_dataType']= 'xtkc'; $list1 = M ( 'userget' )->where ...

  7. php数据库两个关联大表的大数组分页处理,防止内存溢出

    $ret = self::$db->select($tables, $fields, $where, $bind); if (!empty($ret)) { $retIds = array(); ...

  8. javascript对数组分页

    function pagination(pageNo, pageSize, array) { var offset = (pageNo - 1) * pageSize; return (offset ...

  9. laravel 框架给数组分页

    //Get current page form url e.g. &page=6        $currentPage = LengthAwarePaginator::resolveCurr ...

随机推荐

  1. iOS collectionView添加类似tableView的tableHeaderView

    我们都知道UITableview有一个tableHeaderFooterView,这样我们在布局页面的时候,如果顶部有轮播图,可以直接把轮播图设置为tableView的HeaderFooterView ...

  2. 下载并导出数据到execl中

    下载poi-3.6-20091214.jar.下载地址例如以下: http://download.csdn.net/detail/evangel_z/3895051 1.jsp <button ...

  3. Apache中KeepAlive 配置

    引子 先来分析一个Yslow 测试的一个页面的前端性能. 这里所有的请求是指http请求,对于一个请求各个阶段的划分,阻挡->域名解析->建立连接->发送请求->等待响应-&g ...

  4. junit spring 测试

    http://my.oschina.net/dlpinghailinfeng/blog/336694 http://blog.csdn.net/zhangzikui/article/details/1 ...

  5. PHP-Manual的学习----【语言参考】----【类型】-----【Interger类型】

    2017年7月20日15:48:46Integer 整型 1.什么是整数?正数 0 负数2.整型值可以使用十进制,十六进制,八进制或二进制表示,前面可以加上可选的符号(- 或者 +). 二进制表达的 ...

  6. 【BZOJ5018】[Snoi2017]英雄联盟 背包

    [BZOJ5018][Snoi2017]英雄联盟 Description 正在上大学的小皮球热爱英雄联盟这款游戏,而且打的很菜,被网友们戏称为「小学生」.现在,小皮球终于受不了网友们的嘲讽,决定变强了 ...

  7. Is this its limit?

    import sys import os curPath = os.path.abspath(os.path.dirname(__file__)) rootPath = os.path.split(c ...

  8. CentOS6下安装PHP7

    更新软件源[1] wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm wget http://rpm ...

  9. 14.Django自带的admin配置

    admin有自己的默认显示,要自定义显示的样式,一般需要自己定义一个类,在自己定义的类里进行相应的设置,然后,把自己的类交给装饰器 交给装饰器的方法有两种: 1.@admin.register(Pub ...

  10. bd存储

    var sessionData = new Array();var setSessionData=function(key,val){ if(sessionStorage){ sessionStora ...