php 数组分页
- $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']];?> </td>
- <td>
- <?php echo $info['zs']?>
-
- </td>
- <td style="border-right:0px;">
- <?php echo empty($info['my'])?0:$info['my'];?>
-
- </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 数组分页的更多相关文章
- PHP中的数组分页实现(非数据库)
在日常开发的业务环境中,我们一般都会使用 MySQL 语句来实现分页的功能.但是,往往也有些数据并不多,或者只是获取 PHP 中定义的一些数组数据时需要分页的功能.这时,我们其实不需要每次都去查询数据 ...
- 基于thinkphp的数组分页
function array_page($array,$rows){ import("ORG.Util.Page"); //导入分页类 $count=count($array); ...
- php数组分页类
<?php class ArrayPage{ public $totalPage;//全部页数 public $lists;//每页显示数目 public $arr = array();//分页 ...
- laravel手动数组分页
laravel文档中已经有写如何自己使用分页类去分页了,但没有详细说明. 如果你想手动创建分页实例并且最终得到一个数组类型的结果,可以根据需求来创建 IlluminatePaginationPagin ...
- TP5 数组分页
需要 use think\Page; 我这个是 Page是从tp3.2的移到5.0来用的,如果你的里面没有这个也可以移动过来 PHP代码: $page= $this->request->p ...
- thinkphp几个表的数据合并,并用数组分页
控制器: //金币扣除 public function jbkc(){ $map['UG_dataType']= 'xtkc'; $list1 = M ( 'userget' )->where ...
- php数据库两个关联大表的大数组分页处理,防止内存溢出
$ret = self::$db->select($tables, $fields, $where, $bind); if (!empty($ret)) { $retIds = array(); ...
- javascript对数组分页
function pagination(pageNo, pageSize, array) { var offset = (pageNo - 1) * pageSize; return (offset ...
- laravel 框架给数组分页
//Get current page form url e.g. &page=6 $currentPage = LengthAwarePaginator::resolveCurr ...
随机推荐
- An internal error occurred during: "J2EE Component Mapping Update".
1.错误描写叙述 An internal error occurred during: "J2EE Component Mapping Update". java.lang.Nul ...
- 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 ...
- 安装SQLserver 2014(For AlwaysOn)
SQLserver 2014 AlwaysOn在SQLserver 2012的基础之上,进行了非常大程度的添加.如能够通过"加入 Azure 副本向导"简化了用于 AlwaysOn ...
- erlang的斐波那契数列
[递归和循环] 题目: 大家都知道斐波那契数列,现在要求输入一个整数N,请输出斐波那契数列的第N项,以及前N项. 如:N <=39 下面是斐波那契数列的实现: -module(feibo). - ...
- 从头认识java-17.5 堵塞队列(以生产者消费者模式为例)
这一章节我们来讨论一下堵塞队列.我们以下将通过生产者消费者模式来介绍堵塞队列. 1.什么是堵塞队列?(摘自于并发编程网对http://tutorials.jenkov.com/java-concurr ...
- Disruptor 创建过程
1 Disruptor disruptor = new Disruptor<ValueEvent>(ValueEvent.EVENT_FACTORY, ringBufferSize, ex ...
- Android 浏览器文本垂直居中问题
问题描述 在开发中,我们常使用 line-height 属性来实现文本的垂直居中,但是在安卓浏览器渲染中有一个常见的问题,就是对于小于12px的字体使用 line-height 属性进行垂直居中的时候 ...
- 利用asset存储mesh
做mesh导出的时候遇到了这个问题. 最后解决: 存储mesh数据:AssetDatabase.CreateAsset(meshfilter.mesh, "Assets/" + & ...
- C语言基础知识【程序结构】
C 程序结构1.C 程序主要包括以下部分:预处理器指令函数变量语句 & 表达式注释2.#include <stdio.h> int main(){ /* 我的第一个 C 程序 ...
- iOS tableView自定义删除按钮
// 自定义左滑显示编辑按钮 - (NSArray<UITableViewRowAction*>*)tableView:(UITableView *)tableView editActio ...