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. 如何简单而优雅地升级Visual NMP中的PHP版本

    需求:自己想测试下不同版本的PHP性能,就想升级下 Visual 这个集成环境中PHP的版本 网上: 升级PHP到5.6.11 1.下载新的nts版的PHP并解压缩到bin\PHP下,保留原文件夹的名 ...

  2. 浅谈XSS

    最近在做项目中的漏洞修复工作,在短时间内接触到很多关于web开发需要防范的漏洞,例如SQL injection , XSS, CSRF等等,这些漏洞对web开发的项目来说的破坏还是比较大的,其实在网上 ...

  3. openssh6.7.deb download packed for debian7/ubuntu12.04 amd64

    openssh the openssh-server on debian7/ubuntu12.04 is too old and out of date. so now we replace and ...

  4. django admin.py settings 操作

    dango, 怎么说呢,什么东西都内置了,什么东西都是自己的东西.用过flask, cherrypy, web.py, pyramid 等等python 框架后,再选用dango 觉得,理念有很大的区 ...

  5. 【Chrome】如何在C++中增加给JavaScript调用的API

    本文示例说明了如何在Chrome浏览器中增加JavaScript API.为了简化,先假设是在已有的namespace中增加一个新的API,文章的最后将指出如果增加一下全新的namespace所需注意 ...

  6. ios-王云鹤 把UIdatePicker 嵌入到 UIActionSheet中

    这里简单的解释一下: -(void) setUpDatePicker方法用于调用UIDatePicker -(void) DatePickerDoneClick:(id) sender方法用于实现隐藏 ...

  7. 【汇编语言】新手第一步——HelloWorld & A+B

    国际惯例,HelloWorld. 这个程序是masm for windows里面的样例程序.按照我自己的理解,对其加上了注释. ;完整段的Hello World程序 DATAS SEGMENT STR ...

  8. windows全系列激活脚本-改良版.cmd

    @ECHO OFFTITLE Windows 全版本系统激活cscript //nologo %Systemroot%\system32\slmgr.vbs -skms 10.1.1.12ECHO 检 ...

  9. [hystar整理]Entity Framework 教程

    参考页面: http://www.yuanjiaocheng.net/entity/entity-relations.html http://www.yuanjiaocheng.net/entity/ ...

  10. JavaScript :memory leak [转]

    Memory leak patterns in JavaScript Handling circular references in JavaScript applications Abhijeet ...