<!--#include file="include/conn.asp"-->
<%if session("adminlev") = "1" then%>
<%Call alert("对不起您没有权限","-1")%>
<%End If%>
<%
Dim Order0,Order1,Order2,Order3,Omoney0,Omoney1
Set Order0 = oConn.Execute("SELECT COUNT(ID) as ID FROM [LstOrder] where OState = 0")
Set Order1 = oConn.Execute("SELECT COUNT(ID) as ID FROM [LstOrder] where OState = 1")
Set Order2 = oConn.Execute("SELECT COUNT(ID) as ID FROM [LstOrder] where OState = 2")
Set Order3 = oConn.Execute("SELECT COUNT(ID) as ID FROM [LstOrder] where OState = 3")
Set Omoney0 = oConn.Execute("SELECT COUNT(ID) as ID FROM [LstOrder] where Omoney = 0")
Set Omoney1 = oConn.Execute("SELECT COUNT(ID) as ID FROM [LstOrder] where Omoney = 1")
%>
<html>
<title>订单中心</title>
<head>
<link href="images/lst.css" rel="stylesheet" type="text/css" />
</head>
<body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0">
<!----头文件---->
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td width="17" height="29" valign="top" background="images/mail_leftbg.gif"><img src="images/left-top-right.gif" width="17" height="29" /></td>
<td height="29" valign="top" background="images/content-bg.gif">
<table width="100%" height="31" border="0" cellpadding="0" cellspacing="0" class="left_topbg" id="table2"><tr><td height="31"><div class="titlebt">订单中心</div></td></tr></table>
</td><td width="16" valign="top" background="images/mail_rightbg.gif"><img src="images/nav-right-bg.gif" width="16" height="29"/></td></tr>
<tr><td valign="middle" background="images/mail_leftbg.gif"></td>
<!------------------------------------------------------>
<td valign="top">
<table border="1" width="100%" cellpadding="2" style="border-collapse: collapse" bordercolor="#B5D0D9" bgcolor="#FFFFFF">
	<tr>
		<td>
		
		
		
		
<table border="0" width="100%" cellspacing="3" cellpadding="3">
	<tr><form name="ssss" action="">
		<td align="center" height="30">
输入关键字：<input name="keyword">
<input type=submit value=" 搜索 " name="sdsss">
<input type="button" value="暂未处理(<%=Order0(0)%>)" onclick="{location.href='lstorder.asp?xxx=0';}">
<input type="button" value="已经发货(<%=Order1(0)%>)" onclick="{location.href='lstorder.asp?xxx=1';}">
<input type="button" value="无效订单(<%=Order2(0)%>)" onclick="{location.href='lstorder.asp?xxx=2';}">
<input type="button" value="缺货中(<%=Order3(0)%>)" onclick="{location.href='lstorder.asp?xxx=3';}">
<input type="button" value="已付款(<%=Omoney1(0)%>)" onclick="{location.href='lstorder.asp?fff=1';}">
<input type="button" value="未付款(<%=Omoney0(0)%>)" onclick="{location.href='lstorder.asp?fff=0';}">
<input type="button" name="delete" onclick="{if(confirm('你是否确定导出Excel？')){location.href='excel.asp';}return false;}" value="导出Excel">
		</td></form>
	</tr>
	<tr>
		<td align="center" height="30"><form name="ssss" method="post" action="?action=riqi">
<input type="button" name="delete" onclick="{if(confirm('你是否确定删除所有无效订单？')){location.href='?action=wuxiaodingdans';}return false;}" value="删除所有无效订单">
<input type="button" name="delete" onclick="{if(confirm('你是否确定删除所有缺货订单？')){location.href='?action=quehuodingdan';}return false;}" value="删除所有缺货订单">
删除<input name="rq" value="365" size=5>天之前的订单<input type=submit value=" 确定删除 " name="sdsss"> <b>* 删除之后，不可逆！谨慎！</b></form>
		</td>
	</tr>
</table>
		
<table border="1" width="100%" id="table3" cellspacing="0" style="border-collapse: collapse" bordercolor="#F6F6F6" cellpadding="0">
<tr>
<td height="30" align="center" bgcolor="#F6F6F6"><b>订单编号</b></td>
<td height="30" align="center" bgcolor="#F6F6F6"><b>电话</b></td>
<td height="30" align="center" bgcolor="#F6F6F6"><b>联系人</b></td>
<td height="30" align="center" bgcolor="#F6F6F6"><b>订购时间</b></td>
<td height="30" align="center" bgcolor="#F6F6F6"><b>处理结果</b></td>
<td height="30" align="center" bgcolor="#F6F6F6"><b>付款状态</b></td>
<td height="30" align="center" bgcolor="#F6F6F6"><b>商品总价</b></td>
<td height="30" align="center" bgcolor="#F6F6F6"><b>运费</b></td>
<td height="30" align="center" bgcolor="#F6F6F6"><b>总价</b></td>
<td height="30" align="center" bgcolor="#F6F6F6"><b>详情</b></td>
<td height="30" align="center" bgcolor="#F6F6F6"><b>操作</b></td>
<td height="30" align="center" bgcolor="#F6F6F6"><b>处理</b></td>
<td height="30" align="center" bgcolor="#F6F6F6"><b>发货</b></td>
<td height="30" align="center" bgcolor="#F6F6F6"><b>打印</b></td>
</tr>
<%
Dim kkk,xxx,fff
kkk = Trim(request("kkk"))
xxx = Trim(request("xxx"))
fff = Trim(request("fff"))
If kkk="" And sKey="" And kkk="" And xxx="" And fff="" Then
sSql="select * from [LstOrder] order by Id desc"
ElseIf sKey<>"" Then
sSql="select * from [LstOrder] where ONo like '%"&sKey&"%' order by Id desc"
ElseIf kkk<>"" Then
sSql="select * from [LstOrder] where ONo ='"&kkk&"' order by Id desc"
ElseIf xxx<>"" Then 
sSql="select * from [LstOrder] where OState ="&xxx&" order by Id desc"
ElseIf fff<>"" Then 
sSql="select * from [LstOrder] where Omoney ="&fff&" order by Id desc"
Else
sSql="select * from [LstOrder] order by Id desc"
End If
Set oRs = Server.CreateObject("ADODB.Recordset")
oRs.Open sSql, oconn, 1, 1
If oRs.eof and oRs.bof then
Response.Write "暂时没有信息！"
Else
Call Showpage("1",25)
for i=1 to mypage
dim ARRPRO,ARRPNUM,ARRPCCC,ARRPYYY
ARRPNUM = split(oRs("ONum"),",") 
ARRPRO = split(oRs("OPro"),",")
ARRPCCC = split(oRs("Occc"),",") 
ARRPYYY = split(oRs("Oyyy"),",") 
%>
<tr>
<td height="30" align="center" bgcolor="#FFFFFF"><b><%=oRs("ONo")%></b></td>
<td height="30" align="center" bgcolor="#FFFFFF" style="line-height:25px;"><%=oRs("OTel")%></td>
<td height="30" align="center" bgcolor="#FFFFFF" style="line-height:25px;"><%=oRs("OName")%></td>
<td height="30" align="center" bgcolor="#FFFFFF"><%=FormatTime(oRs("OAddtime"),9)%></td>
<td height="30" align="center" bgcolor="#FFFFFF"><%=CHULINNN(oRs("OState"))%></td>
<td height="30" align="center" bgcolor="#FFFFFF"><%If oRs("Omoney") = 0 Then%><b>未付款</b><%Else%><b style="color:#ff0033">已付款</b><%End If%></td>
<td height="30" align="center" bgcolor="#FFFFFF"><%=oRs("Ozongjia")%>元</td>
<td height="30" align="center" bgcolor="#FFFFFF"><%=oRs("OYun")%>元</td>
<td height="30" align="center" bgcolor="#FFFFFF"><%=oRs("Ozongjia")+oRs("OYun")%>元</td>
<td height="30" align="center" bgcolor="#FFFFFF"><a href=lstorderInfo.asp?Id=<%=oRs("Id")%>>查看</a></td>
<td height="30" align="center" bgcolor="#FFFFFF">
<%if session("adminlev") ="9" then%><img src="images/del2.gif" class="input" onclick="{if(confirm('你是否确定删除？')){location.href='?action=delorder&Id=<%=oRs("Id")%>';}return false;}"><%end if%></td>
<td height="30" width="450" align="center" bgcolor="#FFFFFF">
<!---
Omoney 是否付款
Oth 是否无效
OState 处理的结果
-->
<table border="0" width="100%" id="table1" cellspacing="0" cellpadding="0">
<tr><form action="?action=eddorder&Id=<%=oRs("Id")%>" method=post>
<td>
<input name="ooozzz" type="hidden" value="<%=oRs("Ozongjia")%>" size="8">
<input name="uuuu" type="hidden" value="<%=oRs("OUserId")%>">
<input name="a1000" type="hidden" value="<%=oRs("ONo")%>">
<select name="llll" <%If oRs("Oth")=1 Or oRs("OState")=1 Or oRs("Omoney")=0 Then%>disabled<%End If%>>
<option value="0">选择发货</option>
<option value="1">已经发货</option>
</select><input name="rr" <%If oRs("Oth")=1 Or oRs("OState")=1 Or oRs("Omoney")=0 Then%>disabled<%End If%> value="立即处理" type="submit">
</td></form>











<form action="?action=xiugaijiage&Id=<%=oRs("Id")%>" method=post>
<td>
<input name="a1000" type="hidden" value="<%=oRs("ONo")%>">
<input name="uuuu" type="hidden" value="<%=oRs("OUserId")%>">
<input name="oldzongjia" type="hidden" value="<%=oRs("Ozongjia")%>" size="5">
<input name="newzongjia" <%If oRs("Oth")=1 Or oRs("OState")=1 Or oRs("Omoney")=1 Then%>disabled<%End If%> value="<%=oRs("Ozongjia")%>" size="5">
<input name="rr" <%If oRs("Oth")=1 Or oRs("OState")=1 Or oRs("Omoney")=1 Then%>disabled<%End If%> value="修改价格" type="submit">
</td></form>







<form action="?action=wuxiaodingdan&Id=<%=oRs("Id")%>" method=post>
<td>
<input name="uuuu" type="hidden" value="<%=oRs("OUserId")%>">
<input name="oldzongjia" type="hidden" value="<%=oRs("Ozongjia")%>" size="5">
<input name="Omoney" type="hidden" value="<%=oRs("Omoney")%>" size="5">
<input name="a1000" type="hidden" value="<%=oRs("ONo")%>">
<select name="llll" <%If oRs("Oth")=1 Or oRs("OState")=1 Then%>disabled<%End If%>>
<option value="0">选择类型</option>
<option value="2">无效订单</option>
<option value="3">缺货中</option>
</select><input name="rr" <%If oRs("Oth")=1 Or oRs("OState")=1 Then%>disabled<%End If%> value="退还金币" type="submit">
</td></form>
</tr>
</table>

</td>
<td height="30" align="center" bgcolor="#FFFFFF"><%=FAHUOS(oRs("OHUO"))%></td>
<td height="30" align="center" bgcolor="#FFFFFF"><%If oRs("OPPPP")=1 Then%><a target=_blank href=lstorderprintInfo.asp?Id=<%=oRs("Id")%>><s>打印</s></a><%Else%><a target=_blank href=lstorderprintInfo.asp?Id=<%=oRs("Id")%>>打印</a><%End If%></td>
</tr>
<%
oRs.MoveNext
Next
End If
%>
</table>

<table border="0" width="100%" cellspacing="3" cellpadding="3" >
	<tr>
		<td align="center" height="30"><%Call Showpage("?g=z",25)%></td>
	</tr>
</table>	

	
		
		
		
		
		
		</td>
	</tr>
</table>
</td>
<!------------------------------------------------------>
<!----尾文件---->
<td background="images/mail_rightbg.gif"></td></tr><tr>
<td valign="middle" background="images/mail_leftbg.gif"><img src="images/buttom_left2.gif" width="17" height="17" /></td>
<td height="17" valign="top" background="images/buttom_bgs.gif"><img src="images/buttom_bgs.gif" width="17" height="17" /></td>
<td background="images/mail_rightbg.gif"><img src="images/buttom_right2.gif" width="16" height="17" /></td></tr>
</table>
</body>
</html>
<!--#include file="v.asp"-->