<!--#include file="head.asp"-->
<!--#include file="subleft.asp"-->

<script>document.getElementById('o_4').setAttribute("class", "ed"); document.getElementById("t_4").style.display="";document.getElementById('s_4_2').setAttribute("class", "ed6");</script>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<script src="/Template/date.js" type="text/javascript"></script>
<title><%=webname%>-订单交易记录</title>

<br>
<DIV id=main2> 
<%call webleft()%>
<DIV id=main_right>
<DIV id=main_right_content>

<SCRIPT LANGUAGE="JavaScript">
var checkflag1 = "false";
function check1(field) {
if (checkflag1 == "false") {
for (i = 0; i < field.length; i++) {
field[i].checked = true;}
checkflag1 = "true";
return "false"; }
else {
for (i = 0; i < field.length; i++) {
field[i].checked = false; }
checkflag1 = "false";
return "true"; }
}

function unselectall1()
{
    if(document.myform.chkAll1.checked){
	document.myform.chkAll1.checked = document.myform.chkAll1.checked&0;
	checkflag1 = "false";
    } 	
}
</script>
<%
set rs2=server.CreateObject("adodb.recordset")


if SafeRequest("isb")<>"y" then
'if Ubound(split(trim(request.ServerVariables("HTTP_REFERER")),"mydingdan.asp"))<=0 then
response.Cookies("date1")=""
response.Cookies("date2")=""
response.Cookies("dingdan")=""
response.Cookies("shangid")=""
response.Cookies("zhuangtai")=""
response.Cookies("youhui")=""
response.Cookies("lianxifs")=""
response.Cookies("qudao")=""
end if



link="mydingdan?cact=&isb=y"

if trim(SafeRequest("dingdan"))<>"" then
response.Cookies("dingdan")=trim(SafeRequest("dingdan"))
else
response.Cookies("dingdan")=""
end if
if request.Cookies("dingdan")<>"" then sqldd=sqldd&" and aydingdansum='"&request.Cookies("dingdan")&"'"



act=SafeRequest("act")
if act="cha" then
sqldd=""

date1=SafeRequestform("date1")
date2=SafeRequestform("date2")
qudao=SafeRequestform("qudao")

dingdan=trim(SafeRequestform("dingdan"))
shangid=SafeRequestform("shangid")
zhuangtai=SafeRequestform("zhuangtai")
youhui=SafeRequestform("youhui")
lianxifs=SafeRequestform("lianxifs")

if date1<>"" then
response.Cookies("date1")=date1
else
response.Cookies("date1")=""
end if
if date2<>"" then
response.Cookies("date2")=date2
else
response.Cookies("date2")=""
end if

if dingdan<>"" then
response.Cookies("dingdan")=dingdan
else
response.Cookies("dingdan")=""
end if

if lianxifs<>"" then
response.Cookies("lianxifs")=lianxifs
else
response.Cookies("lianxifs")=""
end if

if shangid<>"0" then
response.Cookies("shangid")=shangid
else
response.Cookies("shangid")=""
end if

if zhuangtai<>"99" then
response.Cookies("zhuangtai")=zhuangtai
else
response.Cookies("zhuangtai")=""
end if

if qudao<>"999" then
response.Cookies("qudao")=qudao
else
response.Cookies("qudao")=""
end if

if youhui<>"" then
response.Cookies("youhui")=youhui
else
response.Cookies("youhui")=""
end if


end if

if request.Cookies("date1")<>"" then 
sqldd=sqldd&" and  datediff(day,aydingdansj,'"&request.Cookies("date1")&"')<=0"
end if
if request.Cookies("date2")<>"" then 
sqldd=sqldd&" and  datediff(day,aydingdansj,'"&request.Cookies("date2")&"')>=0"
end if

if request.Cookies("qudao")<>"" then sqldd=sqldd&" and ayddzffangshi='"&request.Cookies("qudao")&"'"
if request.Cookies("dingdan")<>"" then sqldd=sqldd&" and aydingdansum='"&request.Cookies("dingdan")&"'"
if request.Cookies("shangid")<>"" then sqldd=sqldd&" and ayddshangid='"&request.Cookies("shangid")&"'"
if request.Cookies("zhuangtai")<>"" then sqldd=sqldd&" and aydingdanzt='"&request.Cookies("zhuangtai")&"'"
if request.Cookies("lianxifs")<>"" then sqldd=sqldd&" and ayddcontact='"&request.Cookies("lianxifs")&"'"

if request.Cookies("youhui")<>"" then
if request.Cookies("youhui")=1 then sqldd=sqldd&" and ayddyouhuiquanzhi<>''"
if request.Cookies("youhui")=2 then sqldd=sqldd&" and ayddyouhuiquanzhi is null"
end if




%>



<H2><SPAN>订单交易记录</SPAN></H2>
<DIV class=main4>

<form action="?act=cha&isb=y" method="post" name="chaxun" id="chaxun">
<br>&nbsp;时&nbsp;&nbsp;间：
<input name="date1" type="text" class="inpcss" id="date1" onFocus="this.select()" onClick="fPopCalendar(event,this,this)" value="<%if request.Cookies("date1")<>"" then
response.Write request.Cookies("date1")
end if%>" size="17" readonly="readonly" /> 
&nbsp;&nbsp;&nbsp;截止至：
<input name="date2" type="text" class="inpcss" id="date2" onFocus="this.select()" onClick="fPopCalendar(event,this,this)" value="
<%if request.Cookies("date2")<>"" then
response.Write request.Cookies("date2")
end if%>" size="17" readonly="readonly" />
&nbsp;订单号：
<input name="dingdan" type="text" id="dingdan" class="inpcss" value="<%if request.Cookies("dingdan")<>"" then response.Write server.HTMLEncode(trim(request.Cookies("dingdan")))%>" size="17" maxlength="20">
&nbsp;
<input type="submit" name="Submit" value=" 订 单 查 询 ">

<br>
&nbsp;
</form>
  <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="table_style_a2">
     <form action="" method="post" name="myform" id="myform"> 
       <tr>
        <td height="35" align="center" class="border_bottom" style="font-weight: bold" >订单编号 </td>       
        <td align="center" class="border_bottom" style="font-weight: bold" >商品名称</td>
        <td align="center" class="border_bottom" style="font-weight: bold">总价(元)</td>
        <td align="center" class="border_bottom" style="font-weight: bold">支付渠道</td>        
        <td align="center" class="border_bottom" style="font-weight: bold">商家QQ</td>
        <td align="center" class="border_bottom" style="font-weight: bold">订单状态</td>
        <td align="center" class="border_bottom" style="font-weight: bold">提取卡密</td>
        <td align="center" class="border_bottom" style="font-weight: bold">订单投诉</td>
        <td align="center" class="border_bottom" style="font-weight: bold">订单时间</td>
       </tr>
<%
ddhstr=""
zong=0

		sql2="select top 15 aylxcon,aylxku,aylogdate,aydddsum,aylxbuyid from aybuylx where aylxbuyid="&request.Cookies("aynameid")&" order by aylogdate desc"
		rs2.open sql2,conn,1,1
		if not(rs2.bof and rs2.eof) then
		do while not(rs2.eof) 
		ddhstr=ddhstr&trim(rs2("aydddsum"))&","
		rs2.movenext
		loop
		end if
		rs2.close


		if ddhstr<>"" then
		
		

		ddhstr=mid(ddhstr,1,len(ddhstr)-1)

		aykustr=split(ddhstr,",")
		zong=Ubound(aykustr)
		if zong<0 then zong=0


		For sum=0 To zong

		sql="select * from "&getddku(trim(aykustr(sum)))&" where aydingdansum='"&trim(aykustr(sum))&"'" 
		rs.open sql,conn,1,1
		if not(rs.bof and rs.eof) then
%>

	  <tr <%if sum mod 2 = 0 then response.Write "bgcolor=#F7FFFF" %> >
        <td height="40" align="center" class="border_bottom"><%=trim(rs("aydingdansum"))%></td>
        <td align="center" class="border_bottom">
		<%
        set rsgood=server.CreateObject("adodb.recordset")
        rsgood.open "select aygoodid,aygoodname from aygood where aygoodid="&clng(rs("ayddshangid"))&"",conn,1,1
        if not(rsgood.bof and rsgood.eof) then 
        if len(trim(rsgood("aygoodname")))>15 then
        response.Write left(rsgood("aygoodname"),15)&"…"
        else
        response.Write rsgood("aygoodname")
        end if
        
        else
        response.Write("商品或已删除")
        end if
        rsgood.close
        %>
        </td>
        <td align="center" class="border_bottom" style="color: #FF0000; font-weight: bold">
          <%
		if trim(rs("aydingdanzj"))<>"" then
		response.Write Formatnumber(rs("aydingdanzj"),2,true,-1,0)
		else
		response.Write ("-")
		end if
		%>
        </td>
        <td align="center" class="border_bottom">
          <%
		if int(rs("ayddzffangshi"))=0 then response.Write "网银"
		if int(rs("ayddzffangshi"))=1 then response.Write "充值卡"
		if int(rs("ayddzffangshi"))=2 then response.Write "支付宝"
		if int(rs("ayddzffangshi"))=3 then response.Write "财付通"
		if int(rs("ayddzffangshi"))=4 then response.Write "微信"
		if int(rs("ayddzffangshi"))=5 then response.Write "手Q"
		if int(rs("ayddzffangshi"))=10 then response.Write "<span style=color:#F3C>支付宝WAP</span>"
		if int(rs("ayddzffangshi"))=12 then response.Write "<span style=color:#F3C>财付通WAP</span>"
		if int(rs("ayddzffangshi"))=13 then response.Write "<span style=color:#F3C>微信WAP</span>"
		if int(rs("ayddzffangshi"))=99 then response.Write "账户余额"
		%>
        </td>
        <td align="center" class="border_bottom"><%=rs("shangqq")%></td>
        <td align="center" class="border_bottom"><%
		istiquok="no"
		
			if cint(rs("aydingdanzt"))=0 then response.Write("未付款")
			if cint(rs("aydingdanzt"))=1 then 
			istiquok="yes"
			response.Write("<font color=#00CC00>支付成功</font>")
			end if
			if cint(rs("aydingdanzt"))=2 then response.Write("<font color=red>支付失败</font>")
			if cint(rs("aydingdanzt"))=4 then response.Write"<font color=red>[已支付,卡密不足]</font>"


		%></td>
        <td align="center" class="border_bottom">
          <%
		if istiquok="yes" then
		response.Write("<a style=color:#00CC00 href=/tika?ka="&rs("aydingdansum")&" target=_blank>提取卡密</a>")
		else
		response.Write "-"
		end if
		%>
        </td>
        <td align="center" class="border_bottom"><a style="color:#F60" href="tousu?ka=<%=trim(rs("aydingdansum"))%>">投诉退款</a></td>
        <td align="center" class="border_bottom"><%=rs("aydingdansj")%></td>
	  </tr>
      
<%
		end if
		rs.close
		
		next
		end if
%>
      </form>
    </table>
</DIV>


</DIV></DIV>
<DIV class=clear></DIV></DIV>
</DIV>

<br>
	<!--#include virtual="/show/foot.asp"-->


