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 ...
随机推荐
- 获取maven下resouce中的文件为File对象
例如src/main/resources目录下面有个config/interfaces/quick-stock.xml文件我想直接在某一个Java类里面获取到这个文件的File对象,怎么整?(注意噢: ...
- ubuntu openfire Server install
1.首先登录到ubuntu server.在安装openfire 服务器之前,先确保你的系统已经更新到最新.然后输入下面的命令,一行一行执行,最后安装可用的更新 sudo apt-get update ...
- python3读取BJDA药品经营企业数据
#-*- coding:utf-8 -*- #读取北京FDA的药品经营企业数据 # 20161125 zhangshaohua import re import urllib.request impo ...
- Windows找出占用端口的进程
第一步:找出监听指定端口的进程号: C:\> netstat -ao | findstr 443 TCP 0.0.0.0:443 Sean-NotePC:0 ...
- js关于事件的一些总结(系列一)
今天小弟在这里说一下 js 关于事件的一些总结 在这里直接上代码 省去啰嗦的步骤以免看烦了 总结的不好希望大家见谅 一.事件的默认事件 事件的默认事件是什么? 就是a标签有一个链接事件 inpu ...
- [08山东省选]2298 石子合并 即POJ 1738 An old Stone Game
2298 石子合并 2008年省队选拔赛山东 时间限制: 1 s 空间限制: 256000 KB 题目等级 : 黄金 Gold 题解 查看运行结果 题目描述 Description 在 ...
- 【python】-- web开发之CSS
CSS CSS作用概述:(通俗的讲就是将HTML这个赤裸裸的“人”,穿上华丽的衣服) CSS 指层叠样式表 (Cascading Style Sheets) 样式定义如何显示 HTML 元素 样式通常 ...
- Zabbix-Agent 客户端安装配置
1.安装Zabbix官方的yum源 [root@crazy-acong ~]# rpm -ivh http://repo.zabbix.com/zabbix/2.2/rhel/6/x86_64/zab ...
- ExtJS4.2.1与Spring MVC实现Session超时控制
假设你的项目使用ExtJS作为表现层.你会发现,SESSION超时控制将是一个问题. 本文将就自己的经验.来解决这一问题.当然,解决这个问题并不是仅仅有一种方法,我仅仅是提出我的方法. 首先.做超时控 ...
- PHP中ob系列函数讲解(浏览器缓存技术) (转)
Output Control 函数可以让你自由控制脚本中数据的输出.它非常地有用,特别是对于:当你想在数据已经输出后,再输出文件头的情况. 输出控制函数不对使用 header() 或 setcooki ...