<!--#include file="conn.asp"-->
<!--#include file="inc/cook2.asp"-->
<!--#include file="inc/dimflag.asp"-->
<!--#include file="inc/page.asp"-->
<!--#include file="top.asp"-->
<%
word=trim(request("word"))
zhuangtai=int(request("zhuangtai"))
tid = int(Request("tid"))
canshu1="tid="&tid&""
canshu3="word="&word&"&zhuangtai="&zhuangtai&"&"&canshu1&""
canshu2="page="&page&"&"&canshu3&""

if zhuangtai="" then zhuangtai=request.QueryString("zhuangtai")
if word="" then word=request.querystring("word")
%>
<div id="container">
<div class="top_but">
 <li class="left">&nbsp;</li>
 <li><a href="?tid=<%=tid%>"><img src="images/but_7.gif" alt="全部" ></a></li>
 <li><img src="images/but_8.gif" alt="刷新" onClick="window.location.reload(true);"></li>
 <li><img src="images/but_9.gif" alt="打印" onClick="window.print() "/></li>
<form name="form_search" method="post" action="?<%=canshu1%>">
 <li class="right">
<select name="select" onChange="var jmpURL=this.options[this.selectedIndex].value ; if(jmpURL!='') {window.location=jmpURL;} else {this.selectedIndex=0 ;}" class="s_a" > 
 <option value="?zhuangtai=0&<%=canshu1%>" selected>--选择查讯状态--</option>
 <option value="?zhuangtai=0&<%=canshu1%>" >全部订单状态</option>
 <option value="?zhuangtai=1&<%=canshu1%>" >未作任何处理</option>
 <option value="?zhuangtai=2&<%=canshu1%>" >用户已经划出款</option>
 <option value="?zhuangtai=3&<%=canshu1%>" >服务商已经收到款</option>
 <option value="?zhuangtai=4&<%=canshu1%>" >服务商已经发货</option>
 <option value="?zhuangtai=5&<%=canshu1%>" >用户已经收到货</option>
</select>
<input name="word" type="text" id="word" class="s_b"><input type="image" name="Submit22" src="images/ss_b.gif" class="s_c" value="搜索" align="absmiddle">
</li>
</form>
</div>
<%
set rs=server.CreateObject("adodb.recordset")
if word="" then
'//按状态查询
if zhuangtai=0 or zhuangtai="" then
select case zhuangtai
case "0"
rs.open "select distinct(dingdan),niming,username,pay_class,actiondate,userid,zhuangtai,shopxp_shfs,zhifufangshi from shopxp_action where zhuangtai<6 and niming="&tid&" order by actiondate desc",conn,1,1
case ""
rs.open "select distinct(dingdan),niming,username,pay_class,actiondate,userid,zhuangtai,shopxp_shfs,zhifufangshi from shopxp_action where zhuangtai<6 and niming="&tid&" order by actiondate desc",conn,1,1
end select
else
rs.open "select distinct(dingdan),niming,username,pay_class,actiondate,userid,zhuangtai,shopxp_shfs,zhifufangshi from shopxp_action where zhuangtai="&zhuangtai&" and niming="&tid&" order by actiondate desc",conn,1,1
end if
else
'//按用户查询
rs.open "select distinct(dingdan),niming,username,pay_class,actiondate,userid,zhuangtai,shopxp_shfs,zhifufangshi from shopxp_action where zhuangtai<6 and username='"&trim(word)&"' and niming="&tid&" order by actiondate desc",conn,1,1
end if
 
if rs.eof And rs.bof then
response.write conn_eof
else
page1("20")
i=1	
%>
<div class="tableAll titlebgcolor">
  <li style="width:30px;">&nbsp;</li>
 <li style="width:50px">操作</li>
 <li style="width:200px">订单号</li>
 <li style="width:200px">下单用户</li>
 <li style="width:120px">付款方式</li>
 <li style="width:120px">收货方式</li>
 <li style="width:120px">订单状态</li>
</div>
<%
do while not rs.eof and i<=rs.pagesize
username=trim(rs("username"))
%>
<div class="tableAll trbgcolor">
  <li style="width:30px;">&nbsp;</li>
 <li style="width:50px"><a href="dingdan_view.asp?dan=<%=trim(rs("dingdan"))%>&username=<%=username%>&tid=<%=tid%>">查看</a></li>
 <li style="width:200px"><%=trim(rs("dingdan"))%></li>
 <li style="width:200px"><%=username%></li>
 <li style="width:120px"><%
select case rs("pay_class")
case 1
response.write("支付宝交易")
case 2
response.write("财付通交易")
case 3
response.write("快钱交易")
case else
	if rs("shopxp_shfs")=1 then
	response.write("货到付款")
	else
	response.write("未付款")
	end if
end select
 %>&nbsp;</li>
 <li style="width:120px;"><%
          set rs2=server.CreateObject("adodb.recordset")
          rs2.Open "select * from com_songhuo where id="&int(rs("shopxp_shfs")),conn,1,1
		  if not(rs2.eof and rs2.bof) then
          response.Write trim(rs2("subject"))
		  end if
		  rs2.close
          set rs2=nothing%></li>
 <li style="width:120px;"><%
		  select case rs("zhuangtai")
	case "1"
	response.write "未作任何处理"
	case "2"
	response.write "用户已经划出款"
	case "3"
		if rs("shopxp_shfs")=1 then
		response.write "等待发货"
		else
		response.write "服务商已经收到款"
		end if
	case "4"
	response.write "服务商已经发货"
	case "5"
	response.write "<font color=#999999>用户已经收到货</font>"
	end select%></li>
</div>
<%
i=i+1
rs.movenext
loop
%>
<div id="divStayTop" class="bottom titlebgcolor">
<%call page2(5,""&canshu3&"&")%>
</div>

<%
end if
rs.close
set rs=nothing
%>
</div>
<!--#include file="footer.asp"-->