<!--#include file="head.asp"-->
<style>body{background-color: #fff;}</style>

<%
'call chkyanzheng("mydingdan_daili_all")

call logadd(request.Cookies("aynameid"),"浏览mydingdan_daili_all",9,0)

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")=""
end if


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

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 aycaiwudingdan='"&request.Cookies("dingdan")&"'"

link="mydingdan_daili_all?cact=&isb="&SafeRequest("isb")&"&did="&request.Cookies("did")&""

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

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

dingdan=trim(SafeRequestform("dingdan"))

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


end if

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

if request.Cookies("dingdan")<>"" then sqldd=sqldd&" and aycaiwudingdan='"&request.Cookies("dingdan")&"'"



%>

<script src="/Template/date.js" type="text/javascript"></script>
<main>
<div  class="container">
<div class="ui-lrctnei">
<%call userleft()%>
<div class="r"> 
<div class="ui-content">
                        
					
                            
<div class="neiye">


            <!-------------------------------------- 开始 -------------------------------------->									
            <div class="neibiaoti"></div>
            <div class="neibiaoti2">代理商订单交易记录
            </div>
           	<div class="gexian"></div>
   	 		<div class="neitablewu">
					<table>
                  		<tr>
                          <td>

            <form action="?act=cha&isb=y" method="post" name="chaxun" id="chaxun">
            
            &nbsp;订单编号：
            <input name="dingdan" type="text" id="dingdan" class="reginputd" value="<%if request.Cookies("dingdan")<>"" then response.Write server.HTMLEncode(trim(request.Cookies("dingdan")))%>" size="17" maxlength="20">

            &nbsp;起始时间：
            <input name="date1" type="text" class="reginputd" id="date1" onFocus="this.select()" onClick="fPopCalendar(event,this,this)" 
            value="<%if request.Cookies("date1")<>"" then response.Write request.Cookies("date1")%>" size="17" readonly="readonly" /> 
            &nbsp;截止时间：
            <input name="date2" type="text" class="reginputd" id="date2" onFocus="this.select()" onClick="fPopCalendar(event,this,this)" 
            value="<%if request.Cookies("date2")<>"" then response.Write request.Cookies("date2")%>" size="17" readonly="readonly" />
            &nbsp;
            <input type="submit" name="Submit" value=" 订单查询 " class="logindlregedit">
            </form>
                         </td>
                        </tr>
                    </table>
       		</div>
            <div class="gexian20"></div>

            <!-------------------------------------- 结束 -------------------------------------->
                   
                   
           
            
            
            
            <!-------------------------------------- 开始 -------------------------------------->									
                	<div class="neitable">
                    <form action="?page=<%=page%>" method="post" name="myform" id="myform"> 
					<table>
                        <tr class="hd">
                        	<td>订单编号</td>
                      		<td>商品名称</td>
                      		<td>数量</td>
                            <td>总价</td>
                            <td>订单状态</td>
                            <td>支付渠道</td>
                            <td>联系方式</td>
                            <td>完成时间</td>
                      </tr>
				    <%  set rsg=server.CreateObject("adodb.recordset")
                        set rsdd=server.CreateObject("adodb.recordset")
						
                        sql="select aycaiwuuser,aycaiwuleibie,aycaiwuid,aycaiwudate,aycailiushui,aycaiwudingdan,aycaiwuzt,aycaiwuptjy,isalipayfz,aycaiwujine,aycaiwubody,ayshouname,aycaishoubei,aycaiwuyue,aycaiwuzhifu from "&request.Cookies("cwku")&" where aycaiwuuser="&clng(request.Cookies("aynameid"))&" and aycaiwuleibie=18"&sqldd&" order by aycaiwuid desc" 
						rs.open sql,conn,1,1
                        rs.pagesize=50
                        pagecount=rs.pagecount  
                        if request("page")="" then 
                        page=1
                        else
                        page=int(request("page")) 
                        end if
                        if page<=0 then page=1 
                        if request("page")="" then page=1
                        if not(rs.bof and rs.eof) then
                        rs.absolutepage=page
                        n=0
                        do while not rs.eof

						ddku=getddku(rs("aycaiwudingdan"))
						
						rsdd.open "select aydingdanuser,aysgoodid,aydingdanzj,ayddcontact,aydingdansum,ayddquantity,dailikuo from "&ddku&" where aydingdansum='"&trim(rs("aycaiwudingdan"))&"'" ,conn,1,1
						%>
                  		<tr onmouseover=this.bgColor='#FAFAFA' onmouseout=this.bgColor='#ffffff'>
                            <td><a href="mydingdanc?id=<%=rsdd("aydingdanid")%>&ddh=<%=trim(rs("aycaiwudingdan"))%>&dl=yes"><%=trim(rs("aycaiwudingdan"))%></a>
							<%
							shangji=""
							xiaji=""
							'0序号|1上级商品ID|2上级商品代理价格|3本商户ID|4上级代理ID|5上级卡密库|6上级订单库|7上级财务库|8上级代理入款|9统计利润金额
							dailikuo=trim(rsdd("dailikuo")) 
							
							if dailikuo<>"" then           
							dailistr=split(dailikuo,"|")
							For dsum=0 To Ubound(dailistr) 
							'response.Write dailistr(dsum)&"<br>"
								dailiuserstr=split(dailistr(dsum),",")
								if clng(dailiuserstr(4))=clng(request.Cookies("aynameid")) then 
								xiaji=dailiuserstr(3)  '下级代理
								end if
								if clng(dailiuserstr(3))=clng(request.Cookies("aynameid")) then 
								shangji=dailiuserstr(4)  '上级代理
								end if
							next
							
							%>
                            <%if shangji<>"" then%>
                            <span style="color:#009933">[<%=totruename(shangji)%>]</span>
                            <%end if%>
                            <a href="mydingdan_daili_cha?did=<%=xiaji%>" title="查看该代理商订单" style="color:#009933" target="_blank">[<%=totruename(xiaji)%>]</a>
                            <%end if%>
                            </td>
                          	<td>
							<%
							if dailikuo<>"" then
                            rsg.open "select aygoodid,aygoodname from aygood where aygoodid="&clng(dailiuserstr(1))&"",conn,1,1
                            if not(rsg.bof and rsg.eof) then 
                            if len(trim(rsg("aygoodname")))>15 then
                            response.Write left(rsg("aygoodname"),15)&"…"
                            else
                            response.Write rsg("aygoodname")
                            end if
                            else
                            response.Write("商品或已删除")
                            end if
                            rsg.close
							end if
                            %>
                            </td>
                          	<td><%=rsdd("ayddquantity")%>张</td>
                			<td><%=Formatnumber(rsdd("aydingdanzj"),2,true,-1,0)%>元</td>
                            <td>
							<%
							response.Write "<font color=#00CC00>支付成功</font>"
							%>
                            </td>
                            <td>
							<%
                            if int(rs("aycaiwuzhifu"))=0 then response.Write "网银"
                            if int(rs("aycaiwuzhifu"))=1 then response.Write "充值卡"
                            if int(rs("aycaiwuzhifu"))=2 then response.Write "支付宝"
                            if int(rs("aycaiwuzhifu"))=3 then response.Write "财付通"
                            if int(rs("aycaiwuzhifu"))=4 then response.Write "微信"
                            if int(rs("aycaiwuzhifu"))=5 then response.Write "QQ钱包"
							if int(rs("aycaiwuzhifu"))=6 then response.Write "京东"
							if int(rs("aycaiwuzhifu"))=7 then response.Write "云闪付"
                            if int(rs("aycaiwuzhifu"))=10 then response.Write "<span style=color:#F3C>支付宝</span>"
                            if int(rs("aycaiwuzhifu"))=12 then response.Write "<span style=color:#F3C>财付通</span>"
                            if int(rs("aycaiwuzhifu"))=13 then response.Write "<span style=color:#F3C>微信</span>"
							if int(rs("aycaiwuzhifu"))=14 then response.Write "<span style=color:#F3C>QQ钱包</span>"
							if int(rs("aycaiwuzhifu"))=15 then response.Write "<span style=color:#F3C>京东</span>"
							if int(rs("aycaiwuzhifu"))=16 then response.Write "<span style=color:#F3C>云闪付</span>"
                            if int(rs("aycaiwuzhifu"))=99 then response.Write "账户余额"
                            %>
                            </td>
                            <td><%
							
								if trim(rsdd("ayddcontact"))<>"" then
								response.Write rsdd("ayddcontact")
								else
								response.Write("-")
								end if

							%>
                            </td>
                            <td><%=rs("aycaiwudate")%></td>
                            
                    </tr>
						<%
						rsdd.close
                        n=n+1
                        rs.movenext
                        if n>=rs.pagesize then exit do  
                        loop
                        end if
                        zongshu=rs.RecordCount
                        rs.close%>
                        
                        <tr>
                        <td colspan="8" style="text-align:left">&nbsp;
                        &nbsp;<%call pageye()%> <a style="color:#339900" href="mydingdan_daili_all?cact=&isb=<%=SafeRequest("isb")%>&did=<%=request.Cookies("did")%>">[查看所有订单]</a>
                        </td>
                      </tr>

                    </table>
                    </form>
            		</div>
            <!-------------------------------------- 结束 -------------------------------------->
                        
            
            


                                                                 
                   
            <div class="gexian20"></div>
            <div class="mzsmbox2" style="padding-top:20px;">
            重要提示：
			虚假卡密,无效卡密,重复卡密,卡密为联系QQ提卡,云盘,消极处理投诉或不回复不理睬,有以上情况者将撤销可信商家标示或停封商户号！
            </div>

            </div>
            
           




        <div class="clearfix"></div>



</div>








</div>
</div>
</div>
</div>
</main>


<footer>
<div class="container">
</div>
</footer>

</body>
</html>