ecshop 分页是ajax请求的,必须在主文件里有个 act = query 处理,分页会请求这个act

<?php
//获取列表
if($_REQUEST['act']=='list'){ //权限设置
admin_priv('issued_invite_code'); $res = get_list(); $smarty-> assign('list',$res['list']);
$smarty-> assign('filter', $res['filter']);
$smarty-> assign('record_count', $res['filter']['record_count']);
$smarty-> assign('page_count', $res['filter']['page_count']); assign_query_info();
$smarty->display('aa.html');
} //分页ajax查询
if($_REQUEST['act'] == 'query'){ admin_priv('issued_invite_code'); $list = get_list(); $smarty-> assign('list',$res['list']);
$smarty-> assign('filter', $res['filter']);
$smarty-> assign('record_count', $res['filter']['record_count']);
$smarty-> assign('page_count', $res['filter']['page_count']); $smarty->assign('is_ajax' ,true); assign_query_info();
make_json_result($smarty->fetch('aa.html'), '',
array('filter' => $res['filter'], 'page_count' => $res['filter']['page_count']));
} function get_list(){ $filter['record_count'] = $GLOBALS['db']->getOne("select count(*) from aa");
$filter = page_and_size($filter); $sql = "select * from aa LIMIT $filter[start] , $filter[page_size]"; $list = $GLOBALS['db']-> getAll($sql); return array('list'=>$list,'filter'=>$filter);
} ?>
{insert_scripts files="jquery.js,jquery.json.js,../js/transport.js,common.js"}  //引入 必要的js
{insert_scripts files="../js/utils.js,listtable.js"} //引入 listtable.js {if !$is_ajax} //如果是ajax分页就不显示表头
<h2 class="go-list">下发记录</h2>
{/if} <div class="list-div" id="listDiv">
<table cellpadding="3" cellspacing="1">
<tr>
<th>id</th>
<th>名称</th>
</tr>
{if $list}
{foreach from=$list item=data}
<tr>
<td style="background-color: rgb(255, 255, 255);text-align: center;">{$data.id}</td>
<td style="background-color: rgb(255, 255, 255);text-align: center;">{$data.name}</td>
</tr>
{/foreach}
{else}
<tr>
<td>记录为空</td>
</tr>
{/if}
</table> <table cellpadding="4" cellspacing="0">
<tr>
<td align="right">{include file="page.htm"}</td> //引入分页模板
</tr>
</table>
</div>

ecshop 分页小记的更多相关文章

  1. ecshop分页问题1

    点解下一页时弹出 查找原因: json返回 分页查询之后返回的 filter 数据为空 问题在这: $deliveryInfo['fliter']  $deliveryInfo['page_count ...

  2. ecshop分页

    php代码 $page = $_GET['page']; //当前是第几页 $count = grab_promote_goods_count(); // 一个有多少条 $size= '; ){ $p ...

  3. ecshop 后台分页功能

    Ecshop分页规则,分以下几个步骤 1.点击类别,获取第一页获取默认分类列表数据 2.点击“下一页”,采用ajax调取分页内容 实例分析(比如订单列表分页admin/order.php) 1.先写一 ...

  4. 【ecshop后台详解】系统设置-商店设置

    商店设置是我们ecshop新用户第一步先要设置的地方,因为里面相当于网站的基础.包括公司名称,电话,地址,tittle等重要的信息都是这里修改,如果这里没有修改的话,如果有访客来到你网站可能以为走错了 ...

  5. Echop后台分页实现原理详解

    ecshop后台开发,工作中分页中遇到的问题 1.通过筛选条件筛选出数据后,点击下一页返回没有筛选(所有数据)的第二页数据 效果 结果 点击分页后效果 问题:ecshop分页利用ajax实现,在点击下 ...

  6. ecshop后台分页浅析

      既然是分页,道理都是一样的,不过ecshop前台分页的函数和后台分页的函数不同,后台分页函数为page_and_size(),在admin/includes/lib_main.php里.都是用aj ...

  7. ECShop函数列表大全

    lib_time.php gmtime() P: 获得当前格林威治时间的时间戳 /$0 server_timezone() P: 获得服务器的时区 /$0 local_mktime(hour=NULL ...

  8. Nginx 笔记与总结(12)Nginx URL Rewrite 实例(ecshop)

    访问项目地址:http://192.168.254.100/ecshop 某个商品的 URL:http://192.168.254.100/ecshop/goods.php?id=3 现在需要实现把以 ...

  9. ECSHOP二次开发指南

    ECSHOP二次开发指南 发布时间:2013-05-28 12:47:00   来源:   评论:0 点击: 次 [字号:大 中 小] QQ空间新浪微博腾讯微博人人网豆瓣网百度空间百度搜藏开心网复制更 ...

随机推荐

  1. python打包成window可执行程序

    python程序可以通过python hello.py执行,但是需要安装python的解释器,并配置环境变量,打包成exe程序之后可以直接执行. 使用setup工具和py2exe可以做到这一点. 最简 ...

  2. 在.NET Framework对于JSON本来就提供了很好的支持

    1. 使用JavaScriptSerializer,位于命名空间System.Web.Script.Serialization,使用: 序列化为JSON字符串: Code }; JavaScriptS ...

  3. 一步步学习Python-django开发-添加后台管理

    Pyhon-djano提供了一个很强大的后台管理功能,你很轻松的就可以拥有一个后台管理平台.你需要做啥呢?你只需要将需要管理员进行管理的表注册到管理site中即可: from django.contr ...

  4. error:“Unexpected namespace prefix "xmlns" found for tag LinearLayout”

    错误“Unexpected namespace prefix "xmlns" found for tag LinearLayout”的解决方法 androidUnexpected ...

  5. Java静态代理和动态代理

    今天介绍一下代理设计模式,在业务场景中使用代理模式的好处有很多,包括什么权限校验,事务管理等等,具体有什么好处大家自动百度吧,我这里只解释代理模式的设计原理.首先这个设计模式出来的时候先是静态代理模式 ...

  6. PHP5.3 里面数组的的实现方式

    typedef struct _Bucket { char *key; void *value; struct _Bucket *next; } Bucket; typedef struct _Has ...

  7. day7 面向对象编程

    编程范式 编程是程序员用特定的语法+数据结构+算法组成的代码来告诉计算机如何执行任务的过程,一个程序是程序员为了得到一个任务结果而编写的一组指令的集合,正所谓条条大路通罗马,实现一个任务的方式有很多种 ...

  8. java中outer的使用

    outer多用于嵌套循环的情况 outer: for (int i = 2 ; i <= 10 ; i++) { for (int j = 2 ; j <=10 ; j++) { if(i ...

  9. [ios2]ios RSA

    http://blog.iamzsx.me/show.html?id=155002 http://www.theosoft.net/ http://blog.sina.com.cn/s/blog_5f ...

  10. 在收购Sun六年后,Oracle终于瞄准了Java的非付费用户

    Java语言毫无疑问已经成为软件社区的一个品牌和开放的产业标准.自从2010年Oracle收购了Sun Microsystems公司之后,很多人就担心这在某种程度上是软件开源产业的一次失败,甚至会造成 ...