<?php
/**
* ECSHOP 订单管理
* ============================================================================
* 版权所有 2005-2010 上海商派网络科技有限公司,并保留所有权利。
* 网站地址: http://www.ecshop.com;
* ----------------------------------------------------------------------------
* 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和
* 使用;不允许对程序代码以任何形式任何目的的再发布。
* ============================================================================
* $Author: sxc_shop $
* $Id: order.php 17151 2010-05-05 08:58:23Z sxc_shop $
*/
define('IN_ECS', true);
require(dirname(__FILE__) . '/includes/init.php');
require_once(ROOT_PATH . 'includes/lib_order.php');
require_once(ROOT_PATH . 'includes/lib_group.php');
/*------------------------------------------------------ */
//-- 订单查询
/*------------------------------------------------------ */
if ($_REQUEST['act'] == 'order_query')
{
/* 检查权限 */
admin_priv('order_view');
/* 载入配送方式 */
$smarty->assign('shipping_list', shipping_list());
/* 载入支付方式 */
$smarty->assign('pay_list', payment_list());
/* 载入国家 */
$smarty->assign('country_list', get_regions());
/* 载入订单状态、付款状态、发货状态 */
$smarty->assign('os_list', get_status_list('order'));
$smarty->assign('ps_list', get_status_list('payment'));
$smarty->assign('ss_list', get_status_list('shipping'));
/* 模板赋值 */
$smarty->assign('ur_here', $_LANG['03_order_query']);
$smarty->assign('action_link', array('href' => 'order.php?act=list', 'text' => $_LANG['02_order_list']));
/* 显示模板 */
assign_query_info();
$smarty->display('order_query.htm');
}
/*------------------------------------------------------ */
//-- 订单列表
/*------------------------------------------------------ */
elseif ($_REQUEST['act'] == 'list')
{
/* 检查权限 */
admin_priv('order_view');
/* 模板赋值 */
$smarty->assign('ur_here', $_LANG['02_order_list']);
$smarty->assign('action_link', array('href' => 'order.php?act=order_query', 'text' => $_LANG['03_order_query']));
$smarty->assign('status_list', $_LANG['cs']); // 订单状态
$smarty->assign('os_unconfirmed', OS_UNCONFIRMED);
$smarty->assign('cs_await_pay', CS_AWAIT_PAY);
$smarty->assign('cs_await_ship', CS_AWAIT_SHIP);
$smarty->assign('full_page', 1);
$order_list = order_list();
$smarty->assign('todaynum', get_today_ordernum());
$smarty->assign('order_list', $order_list['orders']);
$smarty->assign('filter', $order_list['filter']);
$smarty->assign('record_count', $order_list['record_count']);
$smarty->assign('page_count', $order_list['page_count']);
$smarty->assign('sort_order_time', '<img src="images/sort_desc.gif">');
/* 显示模板 */
assign_query_info();
$smarty->display('order_list.htm');
}
/*------------------------------------------------------ */
//-- 排序、分页、查询
/*------------------------------------------------------ */
elseif ($_REQUEST['act'] == 'query')
{
/* 检查权限 */
admin_priv('order_view');
$order_list = order_list();
$smarty->assign('order_list', $order_list['orders']);
$smarty->assign('filter', $order_list['filter']);
$smarty->assign('record_count', $order_list['record_count']);
$smarty->assign('page_count', $order_list['page_count']);
$sort_flag = sort_flag($order_list['filter']);
$smarty->assign($sort_flag['tag'], $sort_flag['img']);
make_json_result($smarty->fetch('order_list.htm'), '', array('filter' => $order_list['filter'], 'page_count' => $order_list['page_count']));
}
/*------------------------------------------------------ */
//-- 订单详情页面
/*------------------------------------------------------ */
elseif ($_REQUEST['act'] == 'info')
{
/* 根据订单id或订单号查询订单信息 */
if (isset($_REQUEST['order_id']))
{
$order_id = intval($_REQUEST['order_id']);
$order = order_info($order_id);
}
elseif (isset($_REQUEST['order_sn']))
{
$order_sn = trim($_REQUEST['order_sn']);
$order = order_info(0, $order_sn);
}
else
{
/* 如果参数不存在,退出 */
die('invalid parameter');
}
/* 如果订单不存在,退出 */
if (empty($order))
{
die('order does not exist');
}
/* 根据订单是否完成检查权限 */
if (order_finished($order))
{
admin_priv('order_view_finished');
}
else
{
admin_priv('order_view');
}
/* 如果管理员属于某个办事处,检查该订单是否也属于这个办事处 */
$sql = "SELECT agency_id FROM " . $ecs->table('admin_user') . " WHERE user_id = '$_SESSION[admin_id]'";
$agency_id = $db->getOne($sql);
if ($agency_id > 0)
{
if ($order['agency_id'] != $agency_id)
{
sys_msg($_LANG['priv_error']);
}
}
/* 取得上一个、下一个订单号 */
if (!empty($_COOKIE['ECSCP']['lastfilter']))
{
$filter = unserialize(urldecode($_COOKIE['ECSCP']['lastfilter']));
if (!empty($filter['composite_status']))
{
$where = '';
//综合状态
switch($filter['composite_status'])
{
case CS_AWAIT_PAY :
$where .= order_query_sql('await_pay');
break;
case CS_AWAIT_SHIP :
$where .= order_query_sql('await_ship');
break;
case CS_FINISHED :
$where .= order_query_sql('finished');
break;
default:
if ($filter['composite_status'] != -1)
{
$where .= " AND o.order_status = '$filter[composite_status]' ";
}
}
}
}
$sql = "SELECT MAX(order_id) FROM " . $ecs->table('order_info') . " as o WHERE order_id < '$order[order_id]'";
if ($agency_id > 0)
{
$sql .= " AND agency_id = '$agency_id'";
}
if (!empty($where))
{
$sql .= $where;
}
$smarty->assign('prev_id', $db->getOne($sql));
$sql = "SELECT MIN(order_id) FROM " . $ecs->table('order_info') . " as o WHERE order_id > '$order[order_id]'";
if ($agency_id > 0)
{
$sql .= " AND agency_id = '$agency_id'";
}
if (!empty($where))
{
$sql .= $where;
}
$smarty->assign('next_id', $db->getOne($sql));
/* 取得用户名 */
if ($order['user_id'] > 0)
{
$user = user_info($order['user_id']);
if (!empty($user))
{
$order['user_name'] = $user['user_name'];
}
}
/* 取得所有办事处 */
$sql = "SELECT agency_id, agency_name FROM " . $ecs->table('agency');
$smarty->assign('agency_list', $db->getAll($sql));
/* 取得区域名 */
$sql = "SELECT concat(IFNULL(c.region_name, ''), ' ', IFNULL(p.region_name, ''), " .
"' ', IFNULL(t.region_name, ''), ' ', IFNULL(d.region_name, '')) AS region " .
"FROM " . $ecs->table('order_info') . " AS o " .
"LEFT JOIN " . $ecs->table('region') . " AS c ON o.country = c.region_id " .
"LEFT JOIN " . $ecs->table('region') . " AS p ON o.province = p.region_id " .
"LEFT JOIN " . $ecs->table('region') . " AS t ON o.city = t.region_id " .
"LEFT JOIN " . $ecs->table('region') . " AS d ON o.district = d.region_id " .
"WHERE o.order_id = '$order[order_id]'";
$order['region'] = $db->getOne($sql);
/* 格式化金额 */
if ($order['order_amount'] < 0)
{
$order['money_refund'] = abs($order['order_amount']);
$order['formated_money_refund'] = price_format(abs($order['order_amount']));
}
/*
没有合适的资源?快使用搜索试试~ 我知道了~
最新团购网站合集最新的哦
共742个文件
php:261个
htm:176个
gif:108个
需积分: 0 2 下载量 30 浏览量
2011-07-23
16:45:09
上传
评论 1
收藏 2.11MB ZIP 举报
温馨提示
集合ECshop 和ECG最新团购网站合集最新的哦 最新团购网站合集最新的哦
资源推荐
资源详情
资源评论
收起资源包目录
最新团购网站合集最新的哦 (742个子文件)
index.php.bak 4KB
style.css 17KB
main.css 12KB
lightbox.css 5KB
general.css 877B
slides.css 414B
group_merchant.dwt 15KB
group_account.dwt 10KB
group_cart.dwt 8KB
group_team.dwt 6KB
group_order.dwt 6KB
group_forum.dwt 5KB
topman.dwt 4KB
login.dwt 4KB
group_myorders_info.dwt 4KB
group_coupons.dwt 4KB
signup.dwt 4KB
group_invite.dwt 4KB
group_ask.dwt 4KB
group_thread.dwt 3KB
group_seller.dwt 3KB
group_dream.dwt 3KB
group_login.dwt 3KB
group_stage.dwt 3KB
group_more.dwt 3KB
group_brander.dwt 3KB
group_seconds.dwt 3KB
group_hots.dwt 3KB
group_subscribe.dwt 3KB
group_partner.dwt 3KB
group_myorders.dwt 2KB
group_myask.dwt 2KB
links.dwt 2KB
group_print.dwt 2KB
group_pay.dwt 2KB
help.dwt 2KB
group_message.dwt 2KB
message.dwt 2KB
respond.dwt 2KB
group_pmess.dwt 723B
ajax_loader.gif 11KB
loading.gif 9KB
filecheck.gif 5KB
big_login.gif 4KB
temp-ditu.gif 4KB
ecshop_logo.gif 4KB
but-over.gif 3KB
but-no.gif 3KB
but-ms-noopen.gif 3KB
groupon_logo.gif 3KB
small_login.gif 3KB
stepnum.gif 3KB
over-sb.gif 2KB
icons-share.gif 2KB
big_login.gif 2KB
ms-open.gif 2KB
ms-noopen.gif 2KB
bg-deal-expired-success.gif 2KB
over.gif 2KB
big_login.gif 2KB
ms-close.gif 2KB
hot-open.gif 2KB
big_login.gif 2KB
kong.gif 2KB
chinabank.gif 2KB
top_loader.gif 2KB
small_login.gif 2KB
small_login.gif 2KB
menu_minus.gif 1KB
menu_plus.gif 1KB
confirm.gif 1KB
information.gif 1KB
warning.gif 1KB
logo.gif 1KB
button-custom-qq.gif 1KB
alipay.gif 1KB
icon_down_d.gif 1KB
icon_view_d.gif 1KB
picnoflag.gif 1KB
icon_trash.gif 1KB
icon_output.gif 1017B
book_open.gif 1012B
menu-bg-bottom.gif 950B
start.gif 932B
close.gif 882B
loader.gif 842B
bg-share-corner.gif 773B
area_link.gif 761B
icon_down_j.gif 642B
icon_edit.gif 640B
but1.gif 628B
picflag.gif 618B
icon_drop.gif 616B
icon_view.gif 612B
notice.gif 612B
icon_priv.gif 603B
icon_account.gif 603B
footer-bg.gif 588B
warning_small.gif 569B
icon_send_bonus.gif 558B
共 742 条
- 1
- 2
- 3
- 4
- 5
- 6
- 8
资源评论
qq380815415
- 粉丝: 0
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功