<?php
/**
* ECSHOP 管理中心文章处理程序文件
* ============================================================================
* 版权所有 2005-2010 上海商派网络科技有限公司,并保留所有权利。
* 网站地址: http://www.ecshop.com;
* ----------------------------------------------------------------------------
* 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和
* 使用;不允许对程序代码以任何形式任何目的的再发布。
* ============================================================================
* $Author: liuhui $
* $Id: article.php 17095 2010-04-12 10:26:10Z liuhui $
*/
define('IN_ECS', true);
require(dirname(__FILE__) . '/includes/init.php');
/*------------------------------------------------------ */
//-- 文章列表
/*------------------------------------------------------ */
if ($_REQUEST['act'] == 'list')
{
/* 取得过滤条件 */
$filter = array();
$smarty->assign('ur_here', $_LANG['03_article_list']);
$smarty->assign('action_link', array('text' => $_LANG['article_add'], 'href' => 'article.php?act=add'));
$smarty->assign('full_page', 1);
$smarty->assign('filter', $filter);
$order_list = get_orderlist();
$smarty->assign('order_list', $order_list['arr']);
$smarty->assign('filter', $order_list['filter']);
$smarty->assign('record_count', $order_list['record_count']);
$smarty->assign('page_count', $order_list['page_count']);
assign_query_info();
$smarty->display('article_list.htm');
}
/*------------------------------------------------------ */
//-- 翻页,排序
/*------------------------------------------------------ */
elseif ($_REQUEST['act'] == 'query')
{
check_authz_json('article_manage');
$order_list = get_orderlist();
$smarty->assign('order_list', $order_list['arr']);
$smarty->assign('filter', $order_list['filter']);
$smarty->assign('record_count', $order_list['record_count']);
$smarty->assign('page_count', $order_list['page_count']);
make_json_result($smarty->fetch('article_list.htm'), '',
array('filter' => $order_list['filter'], 'page_count' => $order_list['page_count']));
}
/* 获得文章列表 */
function get_orderlist()
{
$result = get_filter();
if ($result === false)
{
$filter = array();
/* 文章总数 */
$sql = 'SELECT COUNT(*) FROM ' .$GLOBALS['ecs']->table('orders');
$filter['record_count'] = $GLOBALS['db']->getOne($sql);
$filter = page_and_size($filter);
/* 获取文章数据 */
$sql = 'SELECT * FROM ' .$GLOBALS['ecs']->table('orders');
set_filter($filter, $sql);
}
else
{
$sql = $result['sql'];
$filter = $result['filter'];
}
$arr = array();
$res = $GLOBALS['db']->selectLimit($sql, $filter['page_size'], $filter['start']);
while ($rows = $GLOBALS['db']->fetchRow($res))
{
$rows['date'] = local_date($GLOBALS['_CFG']['time_format'], $rows['add_time']);
$arr[] = $rows;
}
return array('arr' => $arr, 'filter' => $filter, 'page_count' => $filter['page_count'], 'record_count' => $filter['record_count']);
}
?>
ecshop后台分页示例代码
4星 · 超过85%的资源 需积分: 9 193 浏览量
2011-12-14
16:38:10
上传
评论
收藏 3KB RAR 举报
hesir
- 粉丝: 1
- 资源: 8
最新资源
- 常用工具集参考用于图像等数据处理
- 音乐展示网页、基于Stenography的图像数字水印添加与提取,以及基于颜色矩和Tamura算法的图像相似度评估算法py源码
- 基于EmguCV(OpenCV .net封装),图像数字水印加解密算法的实现,其中包含最低有效位算法,离散傅里叶变换算法+文档书
- 基于matlab+DWT的图像水印项目,数字水印+源代码+文档说明+图片+报告pdf
- (优秀毕业设计)基于python实现的数字图像可视化水印系统的设计与实现,多种数字算法实现+源代码+文档说明+理论演示pdf
- 基于DWT-DCT-SVD和deflate压缩的数字水印方法python源码+Gui界面+演示视频(高分毕业设计)
- 基于matlab实现DWT、DCT、SVD算法数字图像水印可视化系统+GUI界面+文档说明+详细注释(高分毕业设计)
- NCIAE-Data-Structure大一大二笔记
- 学习wireshark笔记
- digital-image-数据可视化笔记
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈