$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. Spring Boot - 配置信息后处理

    最近在做项目的过程中,PSS提出配置文件中类似数据库连接需要的用户名.密码等敏感信息需要加密处理(之前一直是明文的). 为了快速完成任务,网上搜刮到jasypt包,也有相应的starter,使用方法可 ...

  2. Linux基础知识之挂载详解(mount,umount及开机自动挂载)

    Linux基础知识之挂载详解(mount,umount及开机自动挂载) 转载自:http://www.linuxidc.com/Linux/2016-08/134666.htm 挂载概念简述: 根文件 ...

  3. android 二维码制作,显示到UI,并保存SD卡,拿来就能用!!

    转载请注明出处:王亟亟的大牛之路 如今二维码已经渗透了我们的生活.各种扫码关注啊.扫码下载的,今天上一个依据输入内容生成二维码的功能. 包结构: 界面截图: 功能:输入网址–>生成图片–> ...

  4. thinkPHP5.0的添加(C操作)

    首先创建表单: 后台表单用的是layui框架(模块化前端框架),有自己的表单验证,推荐大家使用,在这里表单我就不再贴代码了 其次后台处理: //接收数据并入库 $data = $this->re ...

  5. git介绍和常用指令

    Git介绍和常用指令 介绍:Git和SVN一样都是版本控制工具.不同的是Git是分布式的,SVN是集中式的.Git开始用可能感觉难点,等你用习惯了你就会觉得svn是有点恐怖.(如果一个项目有好多人一起 ...

  6. POJ1942

    Paths on a Grid Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 24236   Accepted: 6006 ...

  7. POJ1850&&POJ1496

    Code Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 9236   Accepted: 4405 Description ...

  8. WIn10远程:mstsc:出现身份验证错误,要求的函数不支持, 这可能是由于CredSSP加密Oracle修正

    a.单击 开始 > 运行,输入 regedit,单击 确定. b.定位到 HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\Syst ...

  9. Redis通过PUBLISH / SUBSCRIBE 等命令实现了订阅与发布模式

    # 切换目录 [root@localhost /]# cd /opt/redis-4.0.10 # 启动客户端 -p 指定端口 [root@localhost ~]# redis-cli -p 638 ...

  10. ABAP 面向对象(Object Orientation) OO

    [转自 http://blog.sina.com.cn/s/blog_7c7b16000101bhof.html]在程序中, 对象的识别和寻址是通过对象引用来实现的, 对象引用变量可以访问对象的属性和 ...