<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<c:choose>
<c:when test="${empty isSelect}">
<c:redirect url="/order.do?orderAction=findAll">
</c:redirect>
</c:when>
<c:otherwise>
<c:if test="${isSelect}">
<c:choose>
<c:when test="${empty findorder_type}">
<c:redirect url="./order.do?orderAction=findAll"></c:redirect>
</c:when>
<c:otherwise>
<c:redirect url="./order.do?orderAction=find_orders"></c:redirect>
</c:otherwise>
</c:choose>
</c:if>
</c:otherwise>
</c:choose>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
.STYLE1 {font-size: 12px}
.STYLE3 {font-size: 12px; font-weight: bold; }
.STYLE4 {
color: #03515d;
font-size: 12px;
}
-->
</style>
<!-- 换页 -->
<script type="text/javascript">
function changePage(pNum,pCount){
if(pNum<1){
pNum=1;
}else if(pCount!=null){
if(pNum>pCount){
pNum=pCount;
}
}
var strPage='orderTab';
var url='newPage.do?action=changePage&backPage='+strPage+'&pNum='+pNum;
location.href=url;
}
</script>
<!-- 模板自带js -->
<script>
var highlightcolor='#c1ebff';
//此处clickcolor只能用win系统颜色代码才能成功,如果用#xxxxxx的代码就不行,还没搞清楚为什么:(
var clickcolor='#51b2f6';
function changeto(){
source=event.srcElement;
if (source.tagName=="TR"||source.tagName=="TABLE")
return;
while(source.tagName!="TD")
source=source.parentElement;
source=source.parentElement;
cs = source.children;
//alert(cs.length);
if (cs[1].style.backgroundColor!=highlightcolor&&source.id!="nc"&&cs[1].style.backgroundColor!=clickcolor)
for(i=0;i<cs.length;i++){
cs[i].style.backgroundColor=highlightcolor;
}
}
function changeback(){
if (event.fromElement.contains(event.toElement)||source.contains(event.toElement)||source.id=="nc")
return
if (event.toElement!=source&&cs[1].style.backgroundColor!=clickcolor)
//source.style.backgroundColor=originalcolor
for(i=0;i<cs.length;i++){
cs[i].style.backgroundColor="";
}
}
</script>
<script type="text/javascript" src="./backstage/tab/js/userOper.js"></script>
<script type="text/javascript" >
/***********************自定义部分*******************************/
/**更新状态**/
function updateStatus(stat,id){
var status=new Array('未付款','取消订单','已付款','已发货','确认收货','退款审核','交易成功','退款成功');
var value=M('updateStat'+id).value;
if(value==stat){
return;
}
if(confirm('确定要将该订单标记为'+status[value]+'吗?')){
document.order_form.orderAction.value='updateOrderStat';
document.order_form.orderId.value=id;
document.order_form.submit();
}else{
M('updateStat'+id).value=stat;
}
}
/**批量完成**/
function updateOrders(){
var bl=false;
for(var i=0;i<N('ch').length;i++){
if(N('ch')[i].checked){
bl=true;
}
}
if(bl){
document.order_form.orderAction.value='updateOrders';
document.order_form.submit();
}else{
alert('请至少选择一项');
}
}
/******显示订单详细信息*****/
function showOrderInfo(id){
document.order_form.orderAction.value='showOrderInfo';
document.order_form.orderId.value=id;
document.order_form.submit();
}
/******提交查询订单*******/
function findSubmit(){
document.select_form.submit();
}
/******动态改变查找*******/
function changeStat(){
if(document.select_form.find_type.value=='orderStatus'){
M('findorder_value').style.display='none';
M('selectStat').style.display='inline';
}else{
M('findorder_value').style.display='inline';
M('selectStat').style.display='none';
}
}
</script>
</head>
<body>
<c:set var="orderStatusValue" value="${fn:split('未付款,取消订单,已付款,已发货,已确认收货,退款审核,交易成功,退款成功',',')}" scope="page"/>
<c:set var="tStatV" value="0,1,2,3,4,5,6,7" scope="page"/>
<c:set var="orderStatusValue_c" value="${fn:split('未付款,取消订单,已发货,已确认收货,交易成功,退款成功',',')}" scope="page"/>
<c:set var="tStatV_c" value="0,1,3,4,6,7" scope="page"/>
<c:if test="${findorder_type eq 'orderStatus'}" var="isStat" scope="page"/>
<form name="order_form" action="order.do" method="post">
<input type="hidden" name="orderAction"/>
<input type="hidden" name="orderId"/>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="30" background="images/tab_05.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="12" height="30"><img src="images/tab_03.gif" width="12" height="30" /></td>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="46%" valign="middle"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="5%"><div align="center"><img src="images/tb.gif" width="16" height="16" /></div></td>
<td width="95%" class="STYLE1"><span class="STYLE3">你当前的位置</span>:[订单管理]-[查看订单]</td>
</tr>
</table></td>
<td width="54%"><table border="0" align="right" cellpadding="0" cellspacing="0">
<tr>
<td width="60"><table width="87%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="STYLE1"><div align="center">
<input type="checkbox" id="ched" οnclick="selectChange()"/>
</div></td>
<td class="STYLE1"><div align="center">全选</div></td>
</tr>
</table></td>
<td width="120" class="STYLE1"><div align="center"><a href="javascript:updateOrders()" οnclick="return confirm('确定要将选中标记为交易成功吗?');">将选中标记为交易成功</a></div></td>
<td width="1"> </td>
</tr>
</table></td>
</tr>
</table></td>
<td width="16"><img src="images/tab_07.gif" width="16" height="30" /></td>
</tr>
</table></td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="8" background="images/tab_12.gif"> </td>
<td>
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="b5d6e6" οnmοuseοver="changeto()" οnmοuseοut="changeback()">
<!----- 列表显示区 ----->
<tr>
<td width="3%" height="22" background="images/bg.gif" bgcolor="#FFFFFF"><div align="center">
选项
</div></td>
<td width="4%" height="22" background="images/bg.gif" bgcolor="#FFFFFF"><div align="center"><span class="STYLE1">序号</span></div></td>
<td width="10%" background="images/bg.gif" bgcolor="#FFFFFF"><div align="center"><span class="STYLE1">订单编号</span></div></td>
<td width="10%" background="images/bg.gif" bgcolor="#FFFFFF"><div align="center"><span class="STYLE1">订购时间</span></div></td>
<td width="6%" background="images/bg.gif" bgcolor="#FFFFFF"><div align="center"><span class="STYLE1">收货人姓名</span></div></td>
<td width="6%" background="images/bg.gif" bgcolor="#FFFFFF"><div align="center"><span class="STYLE1">收货邮编</span></div></td>
<td width="6%" background="images/bg.gif" bgcolor="#FFFFFF"><div align="center"><span class="STYLE1">联系电话</span></div></td>
<td width="8%" background="images/bg.gif" bgcolor="#FFFFFF"><div align="center"><span class="STYLE1">收货人邮箱</span></div></td>
<td width="10%" background="images/bg.gif" bgcolor="#FFFFFF"><div align="center"><span class="STYLE1">收货地址</span></div></td>
<td width="5%" background="images/bg.gif" bgcolor="#FFFFFF"><div align="center"><span class="STYLE1">用户编号</span></div></td>
<td width="6%" background="images/bg.gif" bgcolor="#FFFFFF"><div align="center"><span class="STYLE1">订单状态</span></div></td>
<td width="5%" background="images/bg.gif" bgcolor="#FFFFFF"><div align="center"><span class="STYLE1">操作员编号</span></div></td>
<td width="18%" background="images/bg.gif" bgcolor="#FFFFFF" class="STYLE1"><div align="center">基本操作</div></td>
</tr>
<c:forEach items="${list}" var="order" step="1">
<tr>
<td height="20" bgcolor="#FFFFFF"><div align="center">
<input type="checkbox" name="ch" <c:if test="${(order.orderStatus > 5)||(order.orderStatus eq 1)}">disabled</c:if> value="${order.orderId}" />
</div></td>
<td bgcolor="#FFFFFF"><div align="center"><span class="STYLE1"><c:out value="${order.orderId}">23</c:out></span></div></td>
<td bgcolor="#FFFFFF"><div align="center"><span class="STYLE1"><c:out value="${order.orderNum}">2012040613262308</c:out></span></div></td>
<td bgcolor="#FFFFFF"><div align="center"><span class="STYLE1"><c:out value="${order.orderTime}">2012-04-06</c:out></span></div></td>
<td bgcolor="#FFFFFF"><div align="center"><span class="STYLE1"><c:out value="${order.add.orderName}">名字</c:out></span></div></td>
<td bgcolor="#FFFFFF"><div align="center"><span class="STYLE1"><c:out value="${order.add.addPort}">邮编</c:out></span></div></td>
<td bgcolor="#FFFFFF"><div align="center"><span class="STYLE1"><c:out value="${order.add.addPhone}">电话</c:out></span></div></td>
<td bgcolor="#FFFFFF"><div align="center"><span class="STYLE1"><c:out value="${order.add.addEmail}">邮箱</c:out></span></div></td>
<td bgcolor="#FFFFFF"><div align="center"><span class="STYLE1"><c:out value="${order.add.addName}">地址</c:out></span></div></td>
<td bgcolor="#FFFFFF"><div align="center"><span class="STYLE1"><c:out value="${order.userId}">查看用户</c:out></span></div></td>
<td bgcolor="#FFFFFF">
<div align="center"><span class="STYLE1">
<c:out value="${orderStatusValue[order.orderStatus]}">订单取消</c:out>
</span></div>
</td>
<td bgcolor="#FFFFFF"><div align="center"><span class="STYLE1"><c:out value="${order.adminId}">操作员</c:out></span></div></td>
<td bgcolor="#FFFFFF">
<div align="center">
<span class="STYLE4">
<img src="images/icon_user01.gif" width="12" height="14" /><a href="javascript:showOrderInfo(${order.orderId})">详情</a>
<img src="images/edt.gif" width="16" height="16" />
<select <c:if test="${(order.orderStatus > 5)||(order.orderStatus eq 1)}">disabled</c:if> name="updateStat${order.orderId}" id="updateStat${order.orderId}" οnchange="updateStatus(${order.orderStatus},${order.orderId})">
<option value="d" selected>更改订单状态</option>
<c:forEach items="${tStatV_c}" var="tsv_c" step="1" varStatus="s">
<c:if test="${tsv_c > order.orderStatus}">
<option value="${tsv_c}">${orderStatusValue_c[s.index]}</option>
</c:if>
</c:forEach>
</select>
</span>
</div>
</td>
</tr>
</c:forEach>
</table>
</td>
<td width="8" background="images/tab_15.gif"> </td>
</tr>
</table></td>
</tr>
<tr>
<td height="35" background="images/tab_19.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="12" height="35"><img src="images/tab_18.gif" width="12" height="35" /></td>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="STYLE4"> 当前第 ${pageNum}/${pageCount} 页</td>
<td><table border="0" align="right" cellpadding="0" cellspacing="0">
<tr>
<c:if test="${pageNum > 1}">
<td width="40"><img src="images/first.gif" width="37" height="15" οnclick="changePage(1)" /></td>
<td width="45"><img src="images/back.gif" width="43" height="15" οnclick="changePage(${pageNum-1})" /></td>
</c:if>
<c:if test="${pageNum < pageCount}">
<td width="45"><img src="images/next.gif" width="43" height="15" οnclick="changePage(${pageNum+1},${pageCount})" /></td>
<td width="40"><img src="images/last.gif" width="37" height="15" οnclick="changePage(${pageCount})" /></td>
</c:if>
<td width="100"><div align="center"><span class="STYLE1">转到第
<input value="${pageNum}" name="textfield" type="text" οnchange="changePage(this.value,${pageCount})" size="4" style="height:20px; width:20px; border:1px solid #999999;" />
页</span></div></td>
<td width="40"> </td>
</tr>
</table></td>
</tr>
</table></td>
<td width="16"><img src="images/tab_20.gif" width="16" height="35" /></td>
</tr>
</table></td>
</tr>
</table>
</form>
<form name="select_form" method="post" action="order.do">
<input type="hidden" name="orderAction" value="newFind_orders"/>
<table align="center">
<tr>
<td><input type="button" value="查找用户" οnclick="findSubmit()"/></td>
<td>
<c:set var="typeVs" value="1,orderID,orderStatus,orderName,addPhone"/>
<c:set var="types" value="${fn:split('查询类型,订单编号,订单状态,收货人,联系电话',',')}"/>
<select name="find_type" οnchange="changeStat()">
<c:forEach items="${typeVs}" var="fv" step="1" varStatus="s">
<c:choose>
<c:when test="${findorder_type eq fv}"><option value="${fv}" selected>${types[s.index]}</option></c:when>
<c:otherwise><option value="${fv}">${types[s.index]}</option></c:otherwise>
</c:choose>
</c:forEach>
</select>
</td>
<td>
<select <c:if test="${!isStat}">style="display:none"</c:if> id="selectStat" name="selectStat">
<c:forEach items="${tStatV}" var="tsv" step="1" varStatus="s">
<c:choose>
<c:when test="${findorder_value eq tsv}"><option value="${tsv}" selected>${orderStatusValue[s.index]}</option></c:when>
<c:otherwise><option value="${tsv}">${orderStatusValue[s.index]}</option></c:otherwise>
</c:choose>
</c:forEach>
</select>
<input <c:if test="${isStat}">style="display:none;"</c:if> type="text" id="findorder_value" value="<c:out value="${findorder_value}">查询内容</c:out>" name="find_value" size="15" οnfοcus="select()"/>
</td>
<td>
<a href="./order.do?orderAction=showAllOrders">显示所有数据</a>
</td>
</tr>
</table>
</form>
<div id="userMessage" align="center"><h1>${userMessage}</h1></div>
</body>
</html>