page show
controller
public function record()
{
$r = ;
$m = M();
$query = $m->query('select count(1) as count from winner');
$total = $query[]['count'];
$page = new \Think\Page($total,$r);// 实例化分页类 传入总记录数和每页显示的记录数(25)
$show = $page->show();// 分页显示输出
$list = $m->query("select w.id, w.uid, w.create_time, u.username, i.name from winner as w, user as u, item as i where u.id=w.uid and i.id=w.prize_id order by w.create_time limit $page->firstRow, $page->listRows");
$this->assign('list',$list);// 赋值数据集
$this->assign('page',$show);// 赋值分页输出
$this->display(T('Winner@Admin/record'));
}
view
<extend name="Public/base"/> <block name="body">
<div class="main-title">
<h2>中奖纪录</h2>
</div> <div class="with-padding">
<form id="export-form" method="post" action="{:U('export')}">
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>序号</th>
<th>ID</th>
<th>用户名</th>
<th>奖品</th>
<th>时间</th>
</tr>
</thead>
<tbody>
<volist name="list" id="table">
<tr>
<td>{$i}</td>
<td>{$table.id}</td>
<td><a href='/xxx/index.php?s=/admin/user/expandinfo_details/uid/{$table.uid}.html'> {$table.username}</a></td>
<td>{$table.name}</td>
<td><?php echo date('Y-m-d H:i:s', $table['create_time']);?></td>
</tr>
</volist>
</tbody>
</table>
</form>
</div>
{$page}
</block>
page show的更多相关文章
- 我这么玩Web Api(一):帮助页面或用户手册(Microsoft and Swashbuckle Help Page)
前言 你需要为客户编写Api调用手册?你需要测试你的Api接口?你需要和前端进行接口对接?那么这篇文章应该可以帮到你.本文将介绍创建Web Api 帮助文档页面的两种方式,Microsoft Help ...
- HTML5 Page Visibility
什么是 Page Visibility ? Page Visibility 即页面可见性,通过 visibilityState 的值检测页面当前是否可见.当一个网站是可见或点击选中的状态时 Page ...
- angularjs 1 开发简单案例(包含common.js,service.js,controller.js,page)
common.js var app = angular.module('app', ['ngFileUpload']) .factory('SV_Common', function ($http) { ...
- Selenium的PO模式(Page Object Model)[python版]
Page Object Model 简称POM 普通的测试用例代码: .... #测试用例 def test_login_mail(self): driver = self.driver driv ...
- SharePoint2013 Set a custom application page as site welcome page
本文主要介绍如何添加一个custom application page as site welcome page 1.首先创建一个sharepoint 2013 empty solution, add ...
- 使用page object模式抓取几个主要城市的pm2.5并从小到大排序后写入txt文档
#coding=utf-8from time import sleepimport unittestfrom selenium import webdriverfrom selenium.webdri ...
- github page+jekyll搭博客初体验
div.oembedall-githubrepos { border: 1px solid #DDD; list-style-type: none; margin: 0 0 10px; padding ...
- selenium page object & Page Factory
package demo; import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import org.openqa ...
- <%@ page trimDirectiveWhitespaces="true" %>
我们经常会在JSP页面上使用: <%@ page trimDirectiveWhitespaces="true" %> 这个命令可以使jsp输出的html时去除多余的空 ...
- MIT 6.828 JOS学习笔记18. Lab 3.2 Part B: Page Faults, Breakpoints Exceptions, and System Calls
现在你的操作系统内核已经具备一定的异常处理能力了,在这部分实验中,我们将会进一步完善它,使它能够处理不同类型的中断/异常. Handling Page Fault 缺页中断是一个非常重要的中断,因为我 ...
随机推荐
- poj 1459 多源多汇点最大流
Sample Input 2 1 1 2 (0,1)20 (1,0)10 (0)15 (1)20 7 2 3 13 (0,0)1 (0,1)2 (0,2)5 (1,0)1 (1,2)8 (2,3)1 ...
- Azure Blob Storage从入门到精通
今天推荐的是一个系列文章,让读者阅读完成后可以对Azure Blob Storage的开发有一个全面的了解,可谓是从入门到精通. Azure在最初的版本里面就提供了非结构化数据的存储服务,也即Blob ...
- Android 电池电量进度条,上下滚动图片的进度条(battery)
最近,制作一个app,需要模拟一个电池电量的进度条,根据电量多少来设置百分比,进度条不断上下滚动,就像平时手机充电一样的电池电量进度条.我就自定义view实现了电量进度条.修改图片就可以达到自己想要的 ...
- more命令
more 命令 用于分屏显示 more命令一般用于显示内容超过一屏的文件.其他命令经常和more匹配使用,但more命令也客单独使用. (1)其他命令和more命令匹配使用: 格式: 其他命令格 ...
- mvc-3模型和数据(1)
MVC和命名空间 var User = function(atts) { this.attribute = atts || {}; } //和具体user相关的方法 User.prototype.de ...
- js:语言精髓笔记8--对象系统
封装: 一把对象系统,封装是由语法解析来实现的,即语法作用域:但js是动态语言,因此只能依赖变量作用域: js的变量作用域只有表达式,函数,全局三种:所以js只能实现public和private两种封 ...
- StringUtils中 isNotEmpty 和isNotBlank的区别【java字符串判空】
isNotEmpty(str)等价于 str != null && str.length > 0 isNotBlank(str) 等价于 str != null &&am ...
- python 代码片段
print 'dongshen' for word in ['capitalize','these','words']: print word.upper() for i in range(0,5): ...
- BZOJ3787 : Gty的文艺妹子序列
将序列分成$\sqrt{n}$块,预处理出每两块之间的逆序对数,以及ap[i]表示前i块内数字出现次数的树状数组 预处理:$O(n\sqrt{n}\log n)$ 修改时,ap[i]可以在$O(\sq ...
- 【wikioi】1004 四子连棋
题目链接 算法:BFS //2014-02-05更新 *******************************2013-10-15******************************* ...