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. 《C++游戏开发》笔记十二 战争迷雾:初步实现

    本系列文章由七十一雾央编写,转载请注明出处.  http://blog.csdn.net/u011371356/article/details/9475979 作者:七十一雾央 新浪微博:http:/ ...

  2. Arduino 各种模块篇 motor shield

    根据arduino官方网站出的shield, 类似的情况有很多中motor shield 这里测试采用的是http://www.seeedstudio.com/wiki/Motor_Shield_V1 ...

  3. Shell 获取当前执行脚本的路径

    filepath=$(cd "$(dirname "$0")"; pwd) 脚本文件的绝对路径存在了环境变量filepath中,可以用 echo $filepa ...

  4. HNCU1324:算法2-2:有序线性表的有序合并(线性表)

    http://hncu.acmclub.com/index.php?app=problem_title&id=111&problem_id=1324 题目描述 已知线性表 LA 和 L ...

  5. 弃用个人博客站重返CSDN缘由

    最近悄然关闭了自己的个人博客小站,重新返回了CSDN写博客.恰逢周末,闲暇尚有,敲击键盘记录一下. 其实最初关闭个人基于SAE的个人博客站是一周前开始的,想想自己的博客已经有两周年多的时间了,刚刚创建 ...

  6. 学习ORM框架—hibernate(三):跟踪持久化对象状态,掌握对象持久化

    准备工作 在上篇博客中学习ORM框架—hibernate(一):初识hibernate,通过简单的实例说明O和R的映射过程.本篇博客将要介绍hibernate中持久化对象的状态,并使用hibernat ...

  7. quagga源码分析--大内总管zebra

    zebra,中文翻译是斑马,于是我打开了宋冬野的<斑马,斑马>作为BGM来完成这个篇章,嘿嘿,小资一把! zebra姑且戏称它是quagga项目的大内总管. 因为它负责管理其他所有协议进程 ...

  8. java基础练习 4

    import java.util.Scanner; public class Forth { public static void main(String[] args){ /*请输入星期几的第一个字 ...

  9. 个人PE流程备忘

    insmod memdisk     linux16 /boot/memdisk iso raw   initrd16 /iso/Win8PE.iso

  10. input失效后,怎么改变它默认就有的灰色

    ☆☆☆☆☆ input:disabled { -webkit-text-fill-color: rgba(0, 0, 0, 1); -webkit-opacity: 1; } 去掉button/sel ...