1. $p = max(1, I('param.p',1,'intval'));
  2. $count = count($date);
  3. $Page = new Page($count,15);
  4. $Page->setConfig('theme','<li class="head">共%TOTAL_ROW%条记录</li> %FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% <li class="ender">共 %TOTAL_PAGE%页,当前显示第'.$p.'页</li>');
  5.  
  6. $lists = array_slice($date, $Page->firstRow,$Page->listRows);
  7. $pages = $Page->show();
  8.  
  9. $this->assign('pages',$pages);
  10. $this->assign('list',$lists);
  11. $this->assign('p', $p);
  1. <table width="100%" cellpadding="0" cellspacing="0" border="0" class="formtable oelight" style="margin-top:10px;margin-bottom:100px;">
  2. <thead>
  3. <tr>
  4. <th>name</th>
  5. <th>dw</th>
  6. <th>jj</th>
  7. <th>wts</th>
  8. <th>jjs</th>
  9. </tr>
  10. </thead>
  11. <tbody>
  12. <?php if(empty($list)){?>
  13. <tr>
  14. <td colspan="5" style="border-right:0px;">暂无信息记录</td>
  15. </tr>
  16. <?php }else{foreach($list as $info){?>
  17. <tr>
  18. <td><?php echo $users[$info['tid']];?></td>
  19.  
  20. <td>
  21. <?php echo $dpts[$info['code']]?>
  22. </td>
  23. <td><?php echo $users1[$info['toid']];?>&nbsp;&nbsp;</td>
  24. <td>
  25. <?php echo $info['zs']?>
  26. &nbsp;&nbsp;
  27. </td>
  28. <td style="border-right:0px;">
  29. <?php echo empty($info['my'])?0:$info['my'];?>
  30.  
  31. &nbsp;&nbsp;
  32. </td>
  33. </tr>
  34. <?php }?>
  35. <?php }?>
  36. <tr>
  37. <td colspan="3" style="border-right:0px;border-top:1px solid #eee;text-align:right;">
  38. <?php echo $pages;?>
  39. </td>
  40. </tr>
  41. </tbody>
  42. </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. An internal error occurred during: &quot;J2EE Component Mapping Update&quot;.

    1.错误描写叙述 An internal error occurred during: "J2EE Component Mapping Update". java.lang.Nul ...

  2. Harvard数据库课程CS 265: Research Topics in Database Systems

    CS 265: Research Topics in Database Systems Announcements Quiz 3 will be posted. Good luck! Quiz 2 h ...

  3. 安装SQLserver 2014(For AlwaysOn)

    SQLserver 2014 AlwaysOn在SQLserver 2012的基础之上,进行了非常大程度的添加.如能够通过"加入 Azure 副本向导"简化了用于 AlwaysOn ...

  4. erlang的斐波那契数列

    [递归和循环] 题目: 大家都知道斐波那契数列,现在要求输入一个整数N,请输出斐波那契数列的第N项,以及前N项. 如:N <=39 下面是斐波那契数列的实现: -module(feibo). - ...

  5. 从头认识java-17.5 堵塞队列(以生产者消费者模式为例)

    这一章节我们来讨论一下堵塞队列.我们以下将通过生产者消费者模式来介绍堵塞队列. 1.什么是堵塞队列?(摘自于并发编程网对http://tutorials.jenkov.com/java-concurr ...

  6. Disruptor 创建过程

    1 Disruptor disruptor = new Disruptor<ValueEvent>(ValueEvent.EVENT_FACTORY, ringBufferSize, ex ...

  7. Android 浏览器文本垂直居中问题

    问题描述 在开发中,我们常使用 line-height 属性来实现文本的垂直居中,但是在安卓浏览器渲染中有一个常见的问题,就是对于小于12px的字体使用 line-height 属性进行垂直居中的时候 ...

  8. 利用asset存储mesh

    做mesh导出的时候遇到了这个问题. 最后解决: 存储mesh数据:AssetDatabase.CreateAsset(meshfilter.mesh, "Assets/" + & ...

  9. C语言基础知识【程序结构】

    C 程序结构1.C 程序主要包括以下部分:预处理器指令函数变量语句 & 表达式注释2.#include <stdio.h> int main(){   /* 我的第一个 C 程序 ...

  10. iOS tableView自定义删除按钮

    // 自定义左滑显示编辑按钮 - (NSArray<UITableViewRowAction*>*)tableView:(UITableView *)tableView editActio ...