$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. MHA安装配置

    1. 前言 MHA可以在较短的时间内实现自己主动故障检測和故障转移,通常在10-30秒以内;在复制框架中,MHA可以非常好地解决复制过程中的数据一致性问题,因为不须要在现有的replication中加 ...

  2. python学习 04 函数参数

    1.参数可以传递元组,但是要加* 2.参数可以传递字典,但是要加**

  3. error items-9022:missing required icon file.the bundle does not contain an app icon for iPhone/iPad Touch of exactly '120x120' pixels,in.pen format for ios versions >= 7.0

    error items-9022:missing required icon file.the bundle does not contain an app icon for iPhone/iPad ...

  4. PHP-Manual的学习----【语言参考】----【类型】-----【对象】

    Object 对象1.对象初始化要创建一个新的对象 object ,使用 new 语句实例化一个类: class foo{    function do_foo(){        echo &quo ...

  5. 安装部署服务器和javaweb项目

    [说明]总算告一段落了,服务器啊服务器,你可是把我折磨的够呛,不过现在的状态我已经很满足了. [说明]下面的图片是我这两天一直在搞的,内容不能说是重复,只能说是不停地修改修改,出错出错. 1) 虚拟主 ...

  6. windows10下载

    http://care.dlservice.microsoft.com/dl/download/F/5/7/F574727C-B145-4A7D-B85B-11C4E8DC894B/9841.0.14 ...

  7. sublime 快捷键,左菜单乱码

    sublime 快捷键安装 packagecontrol https://packagecontrol.io/installation#st3 import urllib.request,os,has ...

  8. rtpdataheader.h

    #ifndef RTPDATAHEADER_H #define RTPDATAHEADER_H // For 32bit intel machines typedef short int16; typ ...

  9. 关于js sort排序方法

    sort() 方法用于对数组的元素进行排序. 语法:arrayObject.sort(sortby):参数sortby可选.规定排序顺序.必须是函数. 当方法不带参数的时候,将按照字符编码顺序进行排序 ...

  10. STM32L0 HAL库 IO读写功能

    开发环境使用 MDK5.16a + CUBEMX生成代码 开发板使用:NUCLEO-L053R8 核心芯片:STM32L053R8 今天主要学习了下最基础的IO的读写,IO使用 PA5   LED输出 ...