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

<script>document.getElementById('o_2').setAttribute("class", "ed"); document.getElementById("t_2").style.display="";document.getElementById('s_2_6').setAttribute("class", "ed4");</script>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />

<title><%=webname%>-卖出卡密</title>

<%
call chkyanzheng("feika")

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

act=SafeRequest("act")
cact=SafeRequest("cact")
link="feika?ct="

if cact="cha" then


if SafeRequestform("shangid")<>""then
shangid=SafeRequestform("shangid")
elseif SafeRequest("shangid")<>""then
shangid=SafeRequest("shangid")
end if

if SafeRequestform("aykatel")<>"" then
aykatel=SafeRequestform("aykatel")
elseif SafeRequest("aykatel")<>"" then
aykatel=SafeRequest("aykatel")
end if

if SafeRequestform("ddh")<>"" then
ddh=SafeRequestform("ddh")
elseif SafeRequest("ddh")<>"" then
ddh=SafeRequest("ddh")
end if

if ddh<>"" then
response.Cookies("ddh")=ddh
sql2=sql2&" and aykasuoyoudd='"&ddh&"'"
else
response.Cookies("ddh")=""
end if

kahao=trim(SafeRequestform("kahao"))
if kahao<>"" then response.Cookies("kahao")=kahao
if kahao="" then response.Cookies("kahao")=""


'if shangid=0 and response.Cookies("shangid")="" then call PopErr("请选择商品名称")

'if shangid=0 then response.Cookies("shangid")=""
if aykatel<>"" then
response.Cookies("aykatel")=aykatel
sql2=sql2&" and aykatel='"&aykatel&"'"
else
response.Cookies("aykatel")=""
end if

if shangid<>0 then
response.Cookies("shangid")=shangid
sql2=sql2&" and aykagoodid='"&shangid&"'"
end if

if kahao<>"" then sql2=sql2&" and ayka like '%"&kahao&"%'"

'if request.Cookies("shangid")<>"" then
'sql2=sql2&" and aykagoodid='"&request.Cookies("shangid")&"'"
'end if
link="feika?cact=cha&shangid="&request.Cookies("shangid")&"&aykatel="&request.Cookies("aykatel")&""

else
response.Cookies("ddh")=""
response.Cookies("kahao")=""
response.Cookies("aykatel")=""
response.Cookies("shangid")=""

end if


page=SafeRequest("page")
'if act="del" then
'id=SafeRequest("id")
'if id="" then call PopErr("获取参数错误")
'sql="select * from "&request.Cookies("kamiku")&" where aykaid='"&clng(id)&"' and aykasuoyou="&clng(request.Cookies("aynameid"))&"" 
'rs.open sql,conn,1,3
'if rs.bof and rs.eof then
'call PopErr("未找到此项目")
'else
'rs.delete
'rs.close
'response.Redirect("feika?page="&page&"")
'end if
'end if

'if act="alldel" then
'list1=SafeRequestform("list1")
'if list1="" then call PopErr("未找到此项目")
'	delid=split(list1,",")

'	For dianka=0 To Ubound(delid) 
	'response.Write delid(dianka)
'	sql="select * from "&request.Cookies("kamiku")&" where aykaid='"&trim(delid(dianka))&"' and aykasuoyou="&clng(request.Cookies("aynameid"))&"" 
'	rs.open sql,conn,1,3
'	if rs.bof and rs.eof then
'	call PopErr("未找到此项目")
'	else
'	rs.delete
'	rs.close
'	end if
'	next
'	response.Redirect("feika?page="&page&"")

'end if

if act="down" then
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

mingcheng=randarr&".txt"
strOut="商品名称    卡密信息     商品价格      购卡时间       联系方式"&CHR(13)&CHR(10)&CHR(13)&CHR(10)

list1=SafeRequestform("list1")
if list1="" then call PopErr("未找到此项目")
	delid=split(list1,",")

	For dianka=0 To Ubound(delid) 
	'response.Write delid(dianka)
	sql="select * from "&request.Cookies("kamiku")&" where aykaid="&trim(delid(dianka))&" and aykasuoyou="&clng(request.Cookies("aynameid"))&"" 
	rs.open sql,conn,1,1
	if rs.bof and rs.eof then
	call PopErr("未找到此项目")
	else
		set rsgood=server.CreateObject("adodb.recordset")
		sqlgood="select * from aygood where aygoodid="&clng(rs("aykagoodid"))&"" 
		rsgood.open sqlgood,conn,1,1
		if not(rsgood.bof and rsgood.eof) then
		goodname=trim(rsgood("aygoodname"))
		goodjiage=Formatnumber(rsgood("ayjiage"),2,true,-1,0)&"元"
		else
		goodname="商品或已删除"
		goodjiage="商品或已删除"
		end if
	if trim(rs("aykapass"))="0" then 
	aykapass=" "
	else
	aykapass=trim(rs("aykapass"))
	end if
	strOut=strOut&goodname&"   "&trim(rs("ayka"))&" "&aykapass&"  "&goodjiage&"  "&rs("aykakai")&"  "&trim(rs("aykatel"))&CHR(13)&CHR(10)
	rsgood.close
	rs.close
	end if
	next
	
	strOut=strOut&CHR(13)&CHR(10)&CHR(13)&CHR(10)&webname&CHR(13)&CHR(10)&CHR(13)&CHR(10)&"创建时间 "&now()
	Set fso=Server.CreateObject("Scripting.FileSystemObject")
	set linkw=fso.createtextfile(server.mappath("\updata\feika\"&mingcheng),true)
	linkw.writeline strOut
	linkw.close
	response.Redirect hosturl&"index/downfeika?url="&mingcheng
	'response.Redirect("feika?page="&page&"")
set linkw=Nothing
set fso=Nothing
end if
%>

<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>
<style>
table{font-size:14px; font-weight:normal;line-height:27px;}
.regts{width:440px; height:36px; border:#CCC solid 1px; background:#f1f1f1; color:#666666; line-height:36px; padding-left:10px}
.reginput{width:290px; height:36px; border:#CCC solid 1px; color:#949494; text-indent:10px; line-height:36px}
.gexian20{float:left;width:100%;height:20px;}
.mzsmbox2{width:90%; height:auto; overflow:hidden; background:#fcf8e2; border-left:#edd28a solid 5px; color:#956825; line-height:22px; padding:20px;margin-left:40px; margin-bottom:60px; font-size:13px;padding-top:20px;}
.neitable table{border: 1px solid #E8E8E8;width: 100%;}
.neitable table tr{border-bottom: 1px solid #E8E8E8;}
.neitable table tr td{line-height: 42px;text-align: center;color: #1b1b1b;font-size: 14px;}
.neitable table tr.hd td{line-height: 35px;background-color: #F7F7F7;}
.btnFn1 {cursor:pointer!important;cursor:hand;  height:40px; width:101px; padding:0px 0px 0 0; }
.btnFn2 {cursor:pointer!important;cursor:hand;  height:40px; width:101px; padding:0px 0px 0 0; font-weight:bold; }
.logindlreg2{cursor:pointer;margin-left:5px; padding:7px;font-family:"Microsoft YaHei",Verdana,Arial; font-size:13px; text-align:center; color:#505050; font-weight:bold; background:#F2F2F2; border:#C3C3C3 solid 1px; border-radius:2px; }
.logindlreg2:hover{color:#505050;border:#999999 solid 1px; border-radius:2px; }
.logindlregedit{ margin-top:3px;height:36px;font-family:"Microsoft YaHei",Verdana,Arial; line-height:30px; font-size:13px; text-align:center; color:#505050; font-weight:bold; background:#F2F2F2;  border:#C3C3C3 solid 1px; border-radius:2px; }
.logindlregedit:hover{color:#505050;border:#999999 solid 1px; border-radius:2px; }
.logindlreg2tj{ margin-top:4px;height:36px;font-family:"Microsoft YaHei",Verdana,Arial; line-height:30px; font-size:13px; text-align:center; color:#ffffff; font-weight:bold; background:#F79740; border:0; border-radius:2px; }
.logindlreg2tj:hover{background:#F99C48; }
.reginputd{ width:190px; height:36px; border:#CCC solid 1px; text-indent:10px; line-height:36px}
.reginputdd{ width:110px; height:36px; border:#CCC solid 1px; text-indent:10px; line-height:36px}
.reginputddd{ width:40px; height:36px; border:#CCC solid 1px; text-indent:10px; line-height:36px}
.reginputdddd{ width:50px; height:36px; border:#CCC solid 1px; text-indent:10px; line-height:36px}
.regt3{ width:650px; height:36px; border:#CCC solid 1px; background:#F9F9F9; color:#999999; line-height:36px; padding-left:10px}
</style>
<br>
<DIV id=main2> 
<DIV style="PADDING-LEFT:0px">
<DIV id=main_right_content>

<H2><SPAN>卖出卡密</SPAN></H2>
<DIV class=main4>


<div class="neitablewu">
					  <%
                      sql="select aynameid,ayisdaili from ayname where aynameid="&request.Cookies("aynameid")&"" 
                      rs.open sql,conn,1,1
                      ayisdaili=rs("ayisdaili")
                      rs.close
                      %>
					<table>
                  		<tr>
                          <td>

            <form action="?cact=cha" method="post" name="chaxun" id="chaxun">
            &nbsp;商品分类：
              <select name="shangid" id="shangid" class="reginput">
               <option value="0">全部商品</option>
              <%
              nogood="no"
              set rsf=server.CreateObject("adodb.recordset")
              sqlf="select * from aykafenlei where aykanamesuoyou="&request.Cookies("aynameid")&" and ayshangjiid=0 order by aykafenleisx asc" 
              rsf.open sqlf,conn,1,1
              if not(rsf.bof and rsf.eof) then
              do while not rsf.eof
              
                                  sql="select * from aygood where aygoodsuoyouid="&request.Cookies("aynameid")&" and aygoodfl="&rsf("aykafenleiid")&" and isptdx=0 order by aygoodsx asc" 
                                  rs.open sql,conn,1,1
                                  if not(rs.bof and rs.eof) then 
                                  nogood="yes"
                                      do while not rs.eof%>
                                      <option value="<%=rs("aygoodid")%>" 
                                      <%if request.Cookies("shangid")<>"" then
                                        if clng(request.Cookies("shangid"))=clng(rs("aygoodid")) then response.Write("selected")
                                        end if%>><%=trim(rsf("aykafenleiname"))%>>><%=rs("aygoodname")%></option>
                                      <%	
                                      rs.movenext 
                                      loop
                                  else%>
                                  <option value="0"><%=trim(rsf("aykafenleiname"))%>>>暂无商品</option>
                                  <%end if
                                  rs.close
              
                      set rsf2=server.CreateObject("adodb.recordset")
                      sqlf2="select * from aykafenlei where aykanamesuoyou="&request.Cookies("aynameid")&" and ayshangjiid="&rsf("aykafenleiid")&" order by aykafenleisx asc" 
                      rsf2.open sqlf2,conn,1,1
                      if not(rsf2.bof and rsf2.eof) then
                      do while not rsf2.eof
              
                                  sql="select * from aygood where aygoodsuoyouid="&request.Cookies("aynameid")&" and aygoodfl="&rsf2("aykafenleiid")&" and isptdx=0 order by aygoodsx asc" 
                                  rs.open sql,conn,1,1
                                  if not(rs.bof and rs.eof) then 
                                  nogood="yes"
                                      do while not rs.eof%>
                                      <option value="<%=rs("aygoodid")%>" 
                                      <%if request.Cookies("shangid")<>"" then
                                        if clng(request.Cookies("shangid"))=clng(rs("aygoodid")) then response.Write("selected")
                                        end if%>><%=trim(rsf("aykafenleiname"))%>>><%=trim(rsf2("aykafenleiname"))%>>><%=rs("aygoodname")%></option>
                                      <%	
                                      rs.movenext 
                                      loop
                                  else%>
                                  <option value="0"><%=trim(rsf("aykafenleiname"))%>>><%=trim(rsf2("aykafenleiname"))%>>>暂无商品</option>
                                  <%end if
                                  rs.close
                              
                      rsf2.movenext 
                      loop	 
                      end if
                      rsf2.close
            
              rsf.movenext 
              loop 
              end if
              rsf.close
              %>
              </select> <%if nogood="no" then call PopErr2("请先添加商品","goodadd")%>
            &nbsp;订单查询：&nbsp;<input name="ddh" type="text" id="ddh" value="<%if trim(request.Cookies("ddh"))<>"" then response.Write server.HTMLEncode(trim(request.Cookies("ddh")))%>" class="reginputd" maxlength="35">
            &nbsp;
            &nbsp;卡号查询：&nbsp;<input name="kahao" type="text" id="kahao" value="<%if trim(request.Cookies("kahao"))<>"" then response.Write server.HTMLEncode(trim(request.Cookies("kahao")))%>" class="reginputd" maxlength="35">
            &nbsp;

            联系方式：
            <input name="aykatel" type="text" id="aykatel" value="<%if trim(request.Cookies("aykatel"))<>"" then response.Write server.HTMLEncode(trim(request.Cookies("aykatel")))%>"  class="reginputd" maxlength="15">
            <input type="submit" name="Submit" value=" 查 询 " class="logindlregedit">
			<%if clng(ayisdaili)=1 then%>
            <a href="feikadaili?act=shou">[代理产品卖出卡密]</a>
            <%end if%>
            </form>
                         </td>
                        </tr>
                    </table>
       		</div>






  <div class="neitable">
                    <form action="?act=down" method="post" name="myform" id="myform"> 
					<table>
                        <tr class="hd">
                        	<td width="30">&nbsp;</td>
        					<td>商品名称</td>
                            <td>订单号</td>
                            <td>卡密信息</td>
                            <td>开卡时间</td>
                            <td>联系方式</td>
                      </tr>
					<%
                    sql="select top 1000 * from "&request.Cookies("kamiku")&" where aykasuoyou="&request.Cookies("aynameid")&" and datediff(day,aykakai,'"&now()&"')<='35' and aykayesno=1"&sql2&"  order by aykakai 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
                    do while not rs.eof%>
                  		<tr onmouseover=this.bgColor='#FAFAFA' onmouseout=this.bgColor='#ffffff'>
                       	  <td><input name="list1" type="checkbox" id="list1" value="<%=rs("aykaid")%>" onClick="unselectall1()"></td>
                            <td>
							<%
                            set rsgood=server.CreateObject("adodb.recordset")
                            sqlgood="select * from aygood where aygoodid="&clng(rs("aykagoodid"))&"" 
                            rsgood.open sqlgood,conn,1,1
                            if not(rsgood.bof and rsgood.eof) then
                            response.Write rsgood("aygoodname")
                            else
                            response.Write("商品或已删除")
                            end if
                            %>
                            </td>
                          	<td><%=rs("aykasuoyoudd")%></td>
                			<td>
							<%
                            response.Write "卡号："&trim(rs("ayka"))&"<br>"
                            if trim(rs("aykapass"))<>"0"  then
                            response.Write "密码："&trim(rs("aykapass"))
                            end if
							
							'response.Write trim(rs("aykadstr"))
                            
                            if clng(rs("aydailiid"))<>0 then%>
                            <span style="color: #009900">[代<%=rs("aydailiid")%>]</span>
                            <%end if%>
                            </td>
                            <td><%=rs("aykakai")%></td>
                            <td>
							<%if trim(rs("aykatel"))<>"0" then 
                            response.Write trim(rs("aykatel"))
                            else
                            response.Write "-"
                            end if%>
                            </td>
                        </tr>
						<%		
						rsgood.close
                        n=n+1
                        rs.movenext 
                        if n>=rs.pagesize then exit do  
                        loop
                        end if
                        zongshu=rs.RecordCount
                        rs.close%>
                        
                        <tr>
                        <td colspan="6" style="text-align:left">&nbsp;
                        <input name="chkAll1" type="checkbox" id="chkAll1" onClick="this.value=check1(this.form.list1)" value="checkbox">&nbsp;全选&nbsp;
                        <input type="submit" name="Submit" value=" 下载到本地 " class="logindlregedit"> 
						<%call pageye()%>

                        </td>
                      </tr>

                    </table>
                    </form>
            		</div>
                    <br>
            <div class="mzsmbox2" style="padding-top:20px;">
            重要提示：已卖出卡密在本平台只保存<%=ayjihuakamiday%>天，请通知买家及时使用，或下载到电脑妥善保存，本平台不提供保管卖出卡密责任！
            </div>
                    
</DIV>
<br>

<% 
response.Cookies("shangid")=""
response.Cookies("aykatel")=""
%>

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

<br>

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


