<!--#include virtual="/show/indexhead.asp"-->
<!--#include virtual="/inc/connhost.asp"-->

<%
rs.open "select ayjihuakamiday from ayquanju" ,conn,1,1
ayjihuakamiday=rs("ayjihuakamiday")
rs.close

Const stringmodarr = "0123456789"
dim randarr2,strlength
strlength = Len(stringmodarr)
Randomize timer
For i = 1 To 4 
randarr2 = randarr2&Mid(stringmodarr,Int(Rnd * strlength + 1),1)  
Next 
get_timeh=timer()*100
get_timeh=right("00"&get_timeh,2)
get_timeh=replace(get_timeh,".","0")
randarr = Right((year(Now())),2)&Right(("00"&Month(Now())),2)&Right(("00"&Day(Now())),2)&Right(("00"&hour(Now())),2)&Right(("00"&minute(Now())),2)&Right(("00"&second(Now())),2)&get_timeh&randarr2

set rs2=server.CreateObject("adodb.recordset")
set rsk=server.CreateObject("adodb.recordset")

if SafeRequestyg("ka")<>"" then ka=SafeRequestyg("ka")
if SafeRequestformyg("ka")<>"" then ka=SafeRequestformyg("ka")

act=SafeRequestform("act")
'ka="DAD161601264423941"

if ka="" then call PopErr("获取参数错误")
ddku=getddku(ka)	

if act="tpass" then
passok="no"
	tikapass=trim(SafeRequestform("tikapass"))
	rs.open "select aydingdansum,aydingdanzt,aydingdanpass from "&ddku&" where aydingdansum='"&ka&"' and aydingdanzt=1" ,conn,1,1
	if tikapass<>trim(rs("aydingdanpass")) then call PopErr("提卡密码错误")
	response.Cookies("password")=tikapass
	passok="yes"
	rs.close
end if

if request.Cookies("password")<>"" then 
	rs.open "select aydingdansum,aydingdanzt,aydingdanpass from "&ddku&" where aydingdansum='"&ka&"' and aydingdanzt=1" ,conn,1,1
	if request.Cookies("password")=trim(rs("aydingdanpass")) then
	passok="yes"
	else
	passok="no"
	end if
	rs.close
end if

			                                                      ' and ayddsuo=0
	rs.open "select * from "&ddku&" where aydingdansum='"&ka&"' and aydingdanzt=1",conn,1,3
	if rs.bof and rs.eof then
	call PopErr2("订单正在处理,或卡密正在生成中，请稍后再试","/chaxun?ka="&ka&"")
	else
		'*********************未分配卡密，自动补发**********************************************************
		'if isnull(trim(rs("aydingdanka")))=true or trim(rs("aydingdanka"))="" then
		'rs("aydingdanzt")=0
		'rs.update
		'rs.close
		'conn.execute "update aybuylx set aydddzt=1,ayddtsum=0 where aydddsum='"&out_trade_no&"'"
		'call PopErr2("正在为您分配卡密，请稍等3秒后重新提卡。","/chaxun?ka="&ka&"")
		'response.End()
		'end if
		'***************************************************************************************************
		
	if ccur(DateDiff("d",rs("aydingdansj"),now()))>ccur(maichukazhuanyi) then
	call PopErr2("未查询到订单信息，可以试试选择查询"&maichukazhuanyi&"天以上订单试试","/chaxun")
	end if
		
	aygooddlid=rs("aygooddlid") '上级代理ID
	aydingdanyj=rs("aydingdanyj")
	ayddquantity=rs("ayddquantity")
	aydingdanzj=rs("aydingdanzj") 
	ayddyouhuiquan=rs("ayddyouhuiquan")
	aydigndanyf=rs("aydigndanyf")
	aydingdanjin=rs("aydingdanjin")
	aydingdansj=rs("aydingdansj")
		
	ayddzffangshi=rs("ayddzffangshi") 		
	aydingdanpass=rs("aydingdanpass")  		
	ayddshangid=rs("ayddshangid")       
	ayddfeileiid=rs("ayddfeileiid")  
	aydingdanuser=rs("aydingdanuser") 
	dailikuo=trim(rs("dailikuo"))            '代理关系
	'if isnull(trim(rs("aydingdanka"))) or trim(rs("aydingdanka"))="" then 
	'call PopErr2("卡密正在生成中，请稍后再试","/chaxun?ka="&ka&"")
	'end if

	if passok<>"yes" then 
	if trim(aydingdanpass)<>"" then
	passok="no"
	else
	passok="yes"
	end if
	end if
	
		goodmiaoshu="-"
		goodbuyxx="-"
		lxqq=""
		rs2.open "select aygoodid,ayshmiaoshu,aygoodname,ayshqq,goodbuyxx,kahaoname,kaminame from aygood where aygoodid="&ayddshangid&"",conn,1,1 
		if not(rs2.eof) then 
			kahaoname=trim(rs2("kahaoname"))
			kaminame=trim(rs2("kaminame"))
			aygoodname=trim(rs2("aygoodname"))
			if trim(rs2("ayshqq"))<>"0" then lxqq=rs2("ayshqq")

			if isnull(trim(rs2("ayshmiaoshu")))=false and trim(rs2("ayshmiaoshu"))<>"" then
			goodmiaoshu=trim(rs2("ayshmiaoshu"))
			end if
			
			'response.Write ayddshangid
			

			if isnull(trim(rs2("goodbuyxx")))=false and trim(rs2("goodbuyxx"))<>"" then
			goodbuyxx=trim(rs2("goodbuyxx"))
			end if
		end if
		rs2.close

		if lxqq="" then
			rs2.open "select aykafenleiid,aykafenleishuoming,aykafenleiqq from aykafenlei where aykafenleiid="&ayddfeileiid&"",conn,1,1 
			if not(rs2.eof) then
				if trim(rs2("aykafenleiqq"))<>"0" then lxqq=rs2("aykafenleiqq")

				'if goodmiaoshu="-" then 
				'if isnull(trim(rs2("aykafenleishuoming")))=false and trim(rs2("aykafenleishuoming"))<>"" then
				'goodmiaoshu=trim(rs2("aykafenleishuoming"))
				'end if
				'end if
			end if
			rs2.close
		end if
		
		rs2.open "select aynameid,ayqq,aytel,kamiku,ayweixinid from ayname where aynameid="&aydingdanuser&"",conn,1,1 
		if not (rs2.bof and rs2.eof) then
		aytel=rs2("aytel")
		if lxqq="" then lxqq=rs2("ayqq")
		kamiku=trim(rs2("kamiku"))
		ayweixinid=trim(rs2("ayweixinid"))
		end if
		rs2.close
	
	end if

%>





<div class="mian">
<div class="regbox conter">
<div class="nyclassbt01 conter">提取卡密 <span style="font-size:14px;"><a href="chaxunold">(查询<%=maichukazhuanyi%>天以上订单)</a></span></div>

<form name="search" method="post" action="/chaxun">
<div class="buyform conter">
<div class="left" style="padding-left:260px; font-size:20px;">联系方式或订单号　<input name="con" id="con" type="text" class="inputkcha" onClick="this.value=''" maxlength="20" 
value=<%
if ka<>"" then response.Write server.HTMLEncode(trim(ka))   
if con<>"" then response.Write server.HTMLEncode(trim(con))
%>></div>
<input style="cursor:pointer;" class="shier_chaxun"  type="submit" name="Submit" id="tijiao" value="立即查询" />
<input name="act" type="hidden" id="act" value="cha" />
</div>
</form>


<table width="1100" border="0" align="center">
    <tr>
        <td height="50" align="center"><span style="color:#F60; font-weight:bold; font-size:18px">【商品使用/咨询/售后】 请联系商家  &nbsp;&nbsp;<img src="<%=ossurl%>images/s02.gif"><a style="color:#F60" href="http://wpa.qq.com/msgrd?V=1&Uin=<%=trim(lxqq)%>&Site=联系商家&Menu=yes" title="联系商家,请先加好友" target="_blank">QQ：<%=trim(lxqq)%></a><%if ayweixinid<>"" then response.Write "&nbsp;&nbsp;&nbsp;&nbsp;微信："&ayweixinid&""%></span></td>
      </tr>
</table>
<br>

<form action="?act=tpass&ka=<%=ka%>" method="post"  name="form" id="form">
<input name="ka" type="hidden" id="ka" value="<%=ka%>">
<table width="960" border="0" align="center" cellpadding="0" cellspacing="0" class="table_style_a3">
<tr>
<th width="117" align="center" class="border_right" ><strong>订单编号</strong></td>
<td width="158" align="center" class="border_right" ><%=ka%></td>
<th width="137" align="center" class="border_right" ><strong>订单金额</strong></td>
<td width="137" align="center" class="border_right" ><%=Formatnumber(rs("aydingdanzj"),2,true,-1,0)%>元</td>
<th width="127" align="center" class="border_right" ><strong>创建时间</strong></td>
<td width="147" align="center" class="border_right" ><%=aydingdansj%></td>
<th width="127" class="border_right" ><strong>联系商家</strong></td>
<td width="147" align="center" class="border_right"><a  href="http://wpa.qq.com/msgrd?V=1&Uin=<%=trim(lxqq)%>&Site=联系商家&Menu=yes" title="联系商家,请先加好友" target="_blank">QQ：<%=trim(lxqq)%></a><%if ayweixinid<>"" then response.Write "<br>微信:"&ayweixinid&""%></td>
</tr>
<%if goodmiaoshu<>"-" then%>
<tr> 
<th align="center" class="border_right border_top" >商品描述
<td colspan="7" align="left" class="border_right border_top" style="padding-left:10px;"><%=goodmiaoshu%></td>
</tr>
<%end if%>



<%if goodbuyxx<>"-" then%>
<tr> 
<th align="center" class="border_right" style="border-top:1px solid #ccc;border-right:1px solid #ccc;" >详细说明
<td colspan="7" align="left" style="border-top:1px solid #ccc;border-right:1px solid #ccc;padding-left:10px; line-height:25px;"><%=goodbuyxx%></td>
</tr>
<%end if%>
</table>






    <table id="shanshuo" width="960" align="center" cellpadding="0" cellspacing="0" class="table_style_a2">
        <tbody>
        
            <tr height="35">
            <th width="50%" align="center" class="border_bottom <%if kaminame<>"" then response.Write"border_right"%>">[<%=aygoodname%>]<%=kahaoname%>：</th>
         	<%if kaminame<>"" then%>
            <th colspan="2" align="center" class="border_bottom">[<%=aygoodname%>]<%=kaminame%>：</th>
         	<%end if%>
            </tr>
            
            <%
            'aydingdanka=trim(aydingdanka)
            'if isnull(trim(aydingdanka)) or trim(aydingdanka)="" then call PopErr2("该订单未生成卡密","/")
            'diankastr=split(aydingdanka,",")
            
            mingcheng=randarr&".txt"
            strOut="订单编号:"&ka&CHR(13)&CHR(10)
            strOut=strOut&"商品名称："&aygoodname&CHR(13)&CHR(10)
            strOut=strOut&"商家QQ："&lxqq&CHR(13)&CHR(10)
            strOut=strOut&"商家微信："&ayweixinid&CHR(13)&CHR(10)&CHR(13)&CHR(10)
            strOut=strOut&"【↓↓↓以下部分是卡密↓↓↓】"&CHR(13)&CHR(10)&CHR(13)&CHR(10)
			
				'For sum=0 To Ubound(diankastr) 
								
					if dailikuo<>"" then
					dailistr=split(dailikuo,"|")
					dailiuserstr=split(dailistr(Ubound(dailistr)),",")
					sqlk="select aykaid,ayka,aykapass,aykasuoyou,aykasuoyoudd,aykayesno from "&trim(dailiuserstr(5))&" where aykasuoyoudd='"&ka&"' and aykayesno=1" 
					else
					sqlk="select aykaid,ayka,aykapass,aykasuoyou,aykasuoyoudd,aykayesno from "&kamiku&" where aykasuoyoudd='"&ka&"' and aykayesno=1" 
					end if
								
					rsk.open sqlk,conn,1,1
							
					if not(rsk.bof and rsk.eof) then
					do while not rsk.eof
					%>
						<tr>
						  <td align="center" class="<%if kaminame<>"" then response.Write"border_right"%>"> 
							<%
							if passok="yes" then
							response.Write trim(rsk("ayka"))
							strOut=strOut&trim(rsk("ayka"))
							else
							response.Write("请输入提卡密码")
							strOut=strOut&"请输入提卡密码"
							end if
							%>
							</td>
                            
                     		<%if kaminame<>"" then%>
							<td colspan="2" align="center"> 
							<%
							if passok="yes" then
								if trim(rsk("aykapass"))<>"0" then 
								response.Write trim(rsk("aykapass"))
								strOut=strOut&"，"&trim(rsk("aykapass"))&CHR(13)&CHR(10)
								else
								response.Write ("该商品不需要密码")
								strOut=strOut&CHR(13)&CHR(10)
								end if
							else
							response.Write("请输入提卡密码")
							strOut=strOut&"  请输入提卡密码"&CHR(13)&CHR(10)
							end if	
							%>
							</td>
                            <%else
							strOut=strOut&CHR(13)&CHR(10)
                    		end if%>
						</tr>
						 
								  
					<%
					rsk.movenext 
					loop
					else%>
                        <tr>
                        <th align="center" class="border_right">未找到卡密信息，请联系管理员</th>
                        <th align="center" class="border_right">密码：</th>
                        </tr>
					<%end if
					rsk.close	
				'next
            
            strOut=strOut&CHR(13)&CHR(10)&"【↑↑↑以上部分是卡密↑↑↑】"&CHR(13)&CHR(10)
            strOut=strOut&CHR(13)&CHR(10)&CHR(13)&CHR(10)&"查看详细订单："
			strOut=strOut&CHR(13)&CHR(10)&weburl&"chaxun?ka="&ka
			
            strOut=strOut&CHR(13)&CHR(10)&CHR(13)&CHR(10)&"订单投诉退款："
			strOut=strOut&CHR(13)&CHR(10)&weburl&"jubao?cact=tscx&ddh="&ka
			
			strOut=strOut&CHR(13)&CHR(10)&CHR(13)&CHR(10)&"注意：有些商品只有卡号或卡密属正常！请咨询商家！"
            strOut=strOut&CHR(13)&CHR(10)&"提示：商品的使用与售后请咨询商家！"
            strOut=strOut&CHR(13)&CHR(10)&"退款：遇到无法联系商家或卡密无效等问题，请24小时内点击上面'订单投诉退款'链接提交投诉。"
            strOut=strOut&CHR(13)&CHR(10)&"若商家在24小时内未处理好投诉问题，平台将直接退款。"
            
            if showtel="yes" then 
			strOut=strOut&CHR(13)&CHR(10)&CHR(13)&CHR(10)&"平台受理投诉QQ："&fuwuqq
			strOut=strOut&CHR(13)&CHR(10)&"平台联系电话："&fuwutel
			end if
                
            if SafeRequest("c")="d" then
            Set fso=Server.CreateObject("Scripting.FileSystemObject")
            set linkw=fso.createtextfile(server.mappath("\updata\daochuokka\"&mingcheng),true)
            linkw.writeline strOut
            linkw.close
            response.Redirect pichost&"index/downkc?c=downbuyka&url="&mingcheng
            'response.Redirect("/user/feika.asp?page="&page&"")
            set linkw=Nothing
            set fso=Nothing
                
            end if
            
            
            if trim(aydingdanpass)<>"" and passok="no" then%>
            <tr height="35">
            <th colspan="2" align="center" >提卡密码：
            <input name="tikapass" type="text" id="tikapass" maxlength="15" />
            <input name="act" type="hidden" id="act" value="tpass">
            <input type="submit" name="Submit" value=" 提 取 卡 密 " /></th>
            </tr>
            <%end if%>
            
        </tbody>
    </table>

</form>


 <%
	  if dailikuo<>"" then%>
<table width="400" border="0" align="center">
          <tr>
            <td height="80" align="center"><a class="shier_over"  href="<%=pichost%>index/downka?ka=<%=ka%>&c=d&p=<%=request.Cookies("password")%>&k=<%=trim(dailiuserstr(5))%>">将卡密导出至电脑</a></td>
            <td align="center"><a class="shier_over" href="<%=weburl%>jubao?cact=tscx&ddh=<%=ka%>">订单投诉退款</a></td>
          </tr>
        </table>
      <%else%>
<table width="400" border="0" align="center">
          <tr>
            <td height="80" align="center"><a class="shier_over" href="<%=pichost%>tika?ka=<%=ka%>&c=d">将卡密导出至电脑</a></td>
            <td align="center"><a class="shier_over" href="<%=weburl%>jubao?cact=tscx&ddh=<%=ka%>">订单投诉退款</a></td>
          </tr>
        </table>
      <%end if%>

					<%
                        dailiku=""					'总代理卡密库 
                        if dailikuo<>"" then
                        dailistr=split(dailikuo,"|")
                        dailiuserstr=split(dailistr(Ubound(dailistr)),",")
                        dailiku=trim(dailiuserstr(5))
                        end if
                            
                        yifenpei=getddokkami(trim(ka),aydingdanuser,dailiku)
                        
                        if ccur(yifenpei)<ccur(ayddquantity) then
						conn.execute "update "&getddku(trim(ka))&" set kamino=1 where aydingdansum='"&trim(ka)&"'"
						'call PopErr2("卡密正在生成中，请稍后再试","/chaxun?ka="&ka&"")
						%>
                        <table width="400" border="0" align="center">
                          <tr>
                            <td height="40" align="center"><span style="color:#F00">已分配卡密<%=yifenpei%>个/订单数量<%=ayddquantity%>个，卡密不足，联系商家补卡</span></td>
                          </tr>
                        </table>
                        <%
						else
						conn.execute "update "&getddku(trim(ka))&" set kamino=0 where aydingdansum='"&trim(ka)&"'"
						end if%>


<div class="mzsmbox conter">
<strong>重要提示：</strong><br>
卡密在本平台只保存<%=ayjihuakamiday%>天，请及时使用，或下载到电脑妥善保存，本平台不提供保管卡密责任！<br><br>
<strong>关于投诉：</strong><br>
订单投诉时效为24小时，付款后出现任何问题请在24小时内进行投诉，超过24小时的订单将不再受理投诉问题！ <a style="color:#956825" href="<%=weburl%>jubao?cact=tscx&ddh=<%=ka%>" target="_blank">【点击投诉】</a><br>
若商家在24小时内未处理好投诉问题，平台将直接退款。

<%if showtel="yes" then%>
<br>
平台受理投诉QQ：<%=fuwuqq%> 
平台联系电话：<%=fuwutel%>
<%end if%>

<br><br>
<strong>免责声明：</strong><br>
本站仅是提供自动发卡服务，并非销售商，相关售后问题并不负责，由此产生的交易纠纷由双方自行处理，与本平台无关！<br>
如果订单支付成功，请提取卡密。如果您在提卡后有使用问题，请联系商家！<br>
</div>

<br>

</div>

<div class="clearit"></div>
<div class="gsysbox" style="margin-top:0">
<div class="gsys conter">
<div class="gsysnr left"><img src="<%=ossurl%>Template/Template5/images/tb1.jpg" width="60" height="60">　寄售平台</div>
<div class="gsysnr left"><img src="<%=ossurl%>Template/Template5/images/tb2.jpg" width="60" height="60">　专属服务</div>
<div class="gsysnr left"><img src="<%=ossurl%>Template/Template5/images/tb3.jpg" width="60" height="60">　安全保障 </div>
<div class="gsysnr left"><img src="<%=ossurl%>Template/Template5/images/tb4.jpg" width="60" height="60">　踏实放心 </div>
</div>
</div>


</div>

<script>
var i=0;
function shine(id)
{
var obj= document.getElementById(id);
if(i==0){obj.style.borderColor="#66F";i=1;}else{obj.style.borderColor="#F60";i=0}
}
setInterval("shine('shanshuo')",200);//边框变化时间，100可以根据情况调整大小
</script>

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