<!--#include virtual="/show/userhead.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" />

<title><%=webname%>-订单详情</title>

<br>
<DIV id=main2> 
<%
call chkyanzhengold("mydingdan")

id=SafeRequest("id")
if id="" then call PopErr("获取参数错误")


sql="select * from "&request.Cookies("ddku")&" where (aydingdanuser="&clng(request.Cookies("aynameid"))&" or aygooddlid="&clng(request.Cookies("aynameid"))&") and aydingdanid="&clng(id)&"" 
rs.open sql,conn,1,1
if rs.bof and rs.eof then
call PopErr("未找到订单")
end if

%>



<DIV style="PADDING-LEFT:0px">
<DIV id=main_right_content>

<H2><SPAN>订单详情</SPAN></H2>
<DIV class=main3>
  <table width="99%" border="0" align="center" cellpadding="0" cellspacing="0" class="table_style_a1">

       <tr>
        <th width="160" align="center" class="border_right border_bottom" >订单号：
        <td width="250" align="center" class="border_right border_bottom" style="font-size: 14px; color: #FF0000; font-weight: bold" ><%=rs("aydingdansum")%> 		<%if clng(rs("aygooddlid"))<>0 and clng(rs("aygooddlid"))=clng(request.Cookies("aynameid")) then%><span style="color: #009933">[代<%=rs("aydingdanuser")%>]</span><%end if%>
		<%if clng(rs("aygooddlid"))<>0 and clng(rs("aygooddlid"))<>clng(request.Cookies("aynameid")) then%><span style="color: #009933">[代<%=rs("aygooddlid")%>]</span><%end if%>
		<%if cint(rs("isalipayfz"))=1 then%><span style="color: #FF6600">[秒结] </span><%end if%>
		<%if cint(rs("aydingdanzt"))=0 and cint(rs("ayddzffangshi"))=1 then%>
		<a href="/pay_card?id=<%=rs("aydingdansum")%>" target="_blank" style="color: green">[继续支付]</a>
		<%end if%></td>
        
        <th width="160" align="center" class="border_right border_bottom">订单状态：
        <td width="250" align="center" class="border_bottom">
		<%

			if cint(rs("aydingdanzt"))=0 then response.Write("未付款")
			if cint(rs("aydingdanzt"))=1 then response.Write("<font color=#00CC00>支付成功</font>")
			if cint(rs("aydingdanzt"))=2 then response.Write("<font color=red>支付失败</font>")

							if cint(rs("aydingdanzt"))=1 and cint(rs("kamino"))=1 then
								
								dailikuo=trim(rs("dailikuo"))'代理关系
								dailiku=""					'总代理卡密库 
								if dailikuo<>"" then
								dailistr=split(dailikuo,"|")
								dailiuserstr=split(dailistr(Ubound(dailistr)),",")
								dailiku=trim(dailiuserstr(5))	'总代卡密库
								end if
								
								yifenpei=getddokkami(trim(rs("aydingdansum")),request.Cookies("aynameid"),dailiku)
								if ccur(yifenpei)<ccur(rs("ayddquantity")) then%>

<a style="color:#00CC00" href="/user/mydingdanok?id=<%=trim(rs("aydingdansum"))%>&did=<%=rs("aydingdansum")%>" onClick="javascript:return confirm('确定已添加足够卡密并且需要补发卡密吗？');">[已分配卡密<%=yifenpei%>/购卡数量<%=rs("ayddquantity")%> 点击补卡]</a>

								<%end if
							end if
							
                            %>
	




		</td>                
       </tr>
	  <tr onmouseover=this.bgColor='#D2FFFF' onmouseout=this.bgColor='#ffffff'>
        <th align="center" class="border_right border_bottom">付款交易号：
        <td align="center" class="border_right border_bottom">
		<%
		if trim(rs("aydingdanjjhao"))<>"" then
		response.Write rs("aydingdanjjhao")
		else
		response.Write("-")
		end if
		%></td>
        <th align="center" class="border_right border_bottom">买家联系方式：
        <td align="center" class="border_bottom">
		<%
		if trim(rs("ayddcontact"))<>"" then
		response.Write rs("ayddcontact")
		else
		response.Write("-")
		end if
		%> </td>
        </tr>
	  <tr onmouseover=this.bgColor='#D2FFFF' onmouseout=this.bgColor='#ffffff'>
	    <th align="center" class="border_right border_bottom">订单单价：      
	    <td align="center" class="border_right border_bottom"><%=Formatnumber(rs("aydingdanjin"),2,true,-1,0)%>元</td>
	    <th align="center" class="border_right border_bottom">订单原价：      
	    <td align="center" class="border_bottom"><%=Formatnumber(rs("aydingdanyj"),2,true,-1,0)%>元</td>
	  </tr>
	  <tr onmouseover=this.bgColor='#D2FFFF' onmouseout=this.bgColor='#ffffff'>
	    <th align="center" class="border_right border_bottom">订单总价：      
	    <td align="center" class="border_right border_bottom" style="color: #FF0000; font-weight: bold"><%=Formatnumber(rs("aydingdanzj"),2,true,-1,0)%>元</td>
	    <th align="center" class="border_right border_bottom">购买数量：        
	    <td align="center" class="border_bottom"><%=rs("ayddquantity")%>张</td>
	  </tr>
	  <tr onmouseover=this.bgColor='#D2FFFF' onmouseout=this.bgColor='#ffffff'>
	    <th align="center" class="border_right border_bottom">所属商品：     
	    <td align="center" class="border_right border_bottom">
		<%
		set rsshang=server.CreateObject("adodb.recordset")
		sqlshang="select aygoodid,aygoodname from aygood where aygoodid="&clng(rs("ayddshangid"))&"" 
		rsshang.open sqlshang,conn,1,1
		if not(rsshang.bof and rsshang.eof) then
		if len(trim(rsshang("aygoodname")))>12 then
		response.Write left(rsshang("aygoodname"),12)&"…"
		else
		response.Write rsshang("aygoodname")
		end if
		end if
		rsshang.close
		%>		</td>
	    <th align="center" class="border_right border_bottom">所属分类：        
	    <td align="center" class="border_bottom">
				<%
		set rsfl=server.CreateObject("adodb.recordset")
		sqlfl="select aykafenleiname,aykafenleiid from aykafenlei where aykafenleiid="&clng(rs("ayddfeileiid"))&"" 
		rsfl.open sqlfl,conn,1,1
		if not(rsfl.bof and rsfl.eof) then
		if len(trim(rsfl("aykafenleiname")))>12 then
		response.Write left(rsfl("aykafenleiname"),12)&"…"
		else
		response.Write rsfl("aykafenleiname")
		end if
		end if
		rsfl.close
		%>		</td>
	  </tr>
	  <tr onmouseover=this.bgColor='#D2FFFF' onmouseout=this.bgColor='#ffffff'>
	    <th align="center" class="border_right border_bottom">订单时间：      
	    <td align="center" class="border_right border_bottom"><%=rs("aydingdansj")%></td>
	    <th align="center" class="border_right border_bottom">        
	    <td align="center" class="border_bottom">
		<%
		'if trim(rs("aydingdanka"))<>"" then
		'	aa=split(rs("aydingdanka"),",")
		'	i=1
		'	For sum=0 To Ubound(aa) 
		'	if i mod 5<>0 then
		'	response.Write aa(sum)&"&nbsp;"
		'	else
		'	response.Write aa(sum)&"<br>"
		'	end if
		'	i=i+1
		'	next
		
		'else
		'response.Write("-")
		'end if
		%>		</td>
	  </tr>
	  <tr onmouseover=this.bgColor='#D2FFFF' onmouseout=this.bgColor='#ffffff'>
	    <th align="center" class="border_right border_bottom">优惠券：      
	    <td align="center" class="border_right border_bottom">
		<%if trim(rs("ayddyouhuiquan"))<>"" then
		response.Write rs("ayddyouhuiquan")
		else
		response.Write("-")
		end if
		%>		</td>
	    <th align="center" class="border_right border_bottom">优惠幅度：
	    <td align="center" class=" border_bottom">
		<%

		if trim(rs("ayddyouhuiquanzhi"))<>"" then
		
		youhuiquanstr=split(trim(rs("ayddyouhuiquanzhi")),"%")
		if Ubound(youhuiquanstr)>0 then
		response.Write rs("ayddyouhuiquanzhi")
		else
		response.Write rs("ayddyouhuiquanzhi")&"元"
		end if
		
		else
		response.Write("-")
		end if
		%></td>
	  </tr>
	  <tr onmouseover=this.bgColor='#D2FFFF' onmouseout=this.bgColor='#ffffff'>
	    <th align="center" class="border_right border_bottom">提卡密码：      
	    
	    <td align="center" class="border_right border_bottom">
		<%if trim(rs("aydingdanpass"))<>"" and isnull(trim(rs("aydingdanpass")))=false then 
		response.Write trim(rs("aydingdanpass"))
		else
		response.Write "未设置"
		end if
		%>
		
		</td>
	    <th align="center" class="border_right border_bottom">        
	    
	    <td align="center" class=" border_bottom">&nbsp;</td>
	  </tr>
	
    </table>
</DIV>
<%rs.close%>

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

<br>

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


