<!--#include virtual="/show/adminhead.asp"-->
<!--#include file="adminleft.asp"-->



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

<title><%=webname%>-卖出卡密</title>
<%
call logquanxian("c3",1)
%>

<DIV>

<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>
<DIV id=main1200> 
<%call webleft()%>
<%

act=request.QueryString("act")
cact=request.QueryString("cact")
ku=request.QueryString("ku")
if ku="" then ku="ayka"
link="adminfeika.asp?ct=&kamishuju="&ku


if cact="cha" then
kamishuju=request.form("kamishuju")

if request.form("kamishuju")<>"" then ku=request.form("kamishuju")
if request.QueryString("kamishuju")<>"" then ku=request.QueryString("kamishuju")

if request.Form("shangid")<>""then
shangid=request.Form("shangid")
elseif request.QueryString("shangid")<>""then
shangid=request.QueryString("shangid")
end if

if request.form("aykaid")<>""then
aykaid=request.form("aykaid")
elseif request.QueryString("aykaid")<>""then
aykaid=request.QueryString("aykaid")
end if

if request.form("aykatel")<>"" then
aykatel=request.form("aykatel")
elseif request.QueryString("aykatel")<>"" then
aykatel=request.QueryString("aykatel")
end if

if request.form("aykasuoyoudd")<>"" then
aykasuoyoudd=request.form("aykasuoyoudd")
elseif request.QueryString("aykasuoyoudd")<>"" then
aykasuoyoudd=request.QueryString("aykasuoyoudd")
end if
'if shangid=0 and request.Cookies("shangid")="" then call PopErr("请选择商品名称")

'if shangid=0 then response.Cookies("shangid")=""

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

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

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

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

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


link="adminfeika.asp?cact=cha&aykatel="&request.Cookies("aykatel")&"&aykaid="&request.Cookies("aykaid")&"&aykasuoyoudd="&request.Cookies("aykasuoyoudd")&"&kamishuju="&ku&"&shangid="&shangid
end if


page=request.QueryString("page")
if act="del" then
id=request.QueryString("id")
uid=request.QueryString("uid")
ku=request.QueryString("ku")
shangid=request.QueryString("shangid")
if id="" or uid="" or ku="" then call PopErr("获取参数错误")

sql="select * from "&ku&" where aykaid="&clng(id)&"" 
rs.open sql,conn,1,3
if rs.bof and rs.eof then
call PopErr("未找到此项目")
else
rs.delete
rs.close
'call logadd(request.Cookies("aynameid"),"管理-已卖出卡删除成功"&id,0,0)
response.Redirect("adminfeika.asp?cact=cha&page="&page&"&ku="&ku&"&uid="&uid&"&shangid="&shangid&"")
end if
end if

if act="alldel" then
ku=request.form("ku")
shangid=request.form("shangid")
list1=request.form("list1")

if list1="" or ku="" or shangid="" then call PopErr("未找到此项目,或只能删除单一商品下卡密")

	delid=split(list1,",")
	
	For dianka=0 To Ubound(delid) 
				
			
			rs.open "select aykaid from "&ku&" where aykaid="&trim(delid(dianka))&"" ,conn,1,3
			if not(rs.bof and rs.eof) then
			rs.delete
			end if
			rs.close

	next
	'call logadd(request.Cookies("aynameid"),"管理-已卖出卡多选删除成功"&id,0,0)
	response.Redirect("adminfeika.asp?cact=cha&page="&page&"&ku="&ku&"&uid="&uid&"&shangid="&shangid&"")

end if


%>


<DIV id=main_right>
<DIV id=main_right_content>
<STYLE>.apply_style {
	POSITION: absolute
}
.right_title A {
	LINE-HEIGHT: 27px; WIDTH: 126px; DISPLAY: inline-block; BACKGROUND: url(<%=ossurl%>images/bg22.gif) no-repeat; HEIGHT: 27px
}
.right_title A.current {
	BACKGROUND: url(<%=ossurl%>images/main_right_title_bg.gif) no-repeat; COLOR: #fff; FONT-WEIGHT: bold
}
.table_style_1 TD {
	HEIGHT: 38px
}
.table_style_home_info TD {
	PADDING-BOTTOM: 0px; PADDING-LEFT: 10px; PADDING-RIGHT: 0px; HEIGHT: 30px; PADDING-TOP: 0px
}
</STYLE>

<DIV class=right_titleadmin>&nbsp;&nbsp;卖出卡密</DIV>
<DIV class=main><br>

<form action="?cact=cha" method="post" name="chaxun" id="chaxun">
&nbsp;卡库：
<select name="kamishuju" id="kamishuju">
        <option value="ayka" <%if ku="ayka" then response.Write "selected"%>>ayka</option>
		<option value="ayka01" <%if ku="ayka01" then response.Write "selected"%>>ayka01</option>
		<option value="ayka02" <%if ku="ayka02" then response.Write "selected"%>>ayka02</option>
		<option value="ayka03" <%if ku="ayka03" then response.Write "selected"%>>ayka03</option>
		<option value="ayka04" <%if ku="ayka04" then response.Write "selected"%>>ayka04</option>
		<option value="ayka05" <%if ku="ayka05" then response.Write "selected"%>>ayka05</option>
		<option value="ayka06" <%if ku="ayka06" then response.Write "selected"%>>ayka06</option>
		<option value="ayka07" <%if ku="ayka07" then response.Write "selected"%>>ayka07</option>
		<option value="ayka08" <%if ku="ayka08" then response.Write "selected"%>>ayka08</option>
		<option value="ayka09" <%if ku="ayka09" then response.Write "selected"%>>ayka09</option>
        <option value="ayka10" <%if ku="ayka10" then response.Write "selected"%>>ayka10</option>
        <option value="ayka11" <%if ku="ayka11" then response.Write "selected"%>>ayka11</option>
        <option value="ayka12" <%if ku="ayka12" then response.Write "selected"%>>ayka12</option>
        <option value="ayka13" <%if ku="ayka13" then response.Write "selected"%>>ayka13</option>
        <option value="ayka14" <%if ku="ayka14" then response.Write "selected"%>>ayka14</option>
        <option value="ayka15" <%if ku="ayka15" then response.Write "selected"%>>ayka15</option>
        <option value="ayka16" <%if ku="ayka16" then response.Write "selected"%>>ayka16</option>
        <option value="ayka17" <%if ku="ayka17" then response.Write "selected"%>>ayka17</option>
        <option value="ayka18" <%if ku="ayka18" then response.Write "selected"%>>ayka18</option>
        <option value="ayka19" <%if ku="ayka19" then response.Write "selected"%>>ayka19</option>
        <option value="ayka20" <%if ku="ayka20" then response.Write "selected"%>>ayka20</option>
        
        <option value="ayka21" <%if ku="ayka21" then response.Write "selected"%>>ayka21</option>
        <option value="ayka22" <%if ku="ayka22" then response.Write "selected"%>>ayka22</option>
        <option value="ayka23" <%if ku="ayka23" then response.Write "selected"%>>ayka23</option>
        <option value="ayka24" <%if ku="ayka24" then response.Write "selected"%>>ayka24</option>
        <option value="ayka25" <%if ku="ayka25" then response.Write "selected"%>>ayka25</option>
        <option value="ayka26" <%if ku="ayka26" then response.Write "selected"%>>ayka26</option>
        <option value="ayka27" <%if ku="ayka27" then response.Write "selected"%>>ayka27</option>
        <option value="ayka28" <%if ku="ayka28" then response.Write "selected"%>>ayka28</option>
        <option value="ayka29" <%if ku="ayka29" then response.Write "selected"%>>ayka29</option>
        <option value="ayka30" <%if ku="ayka30" then response.Write "selected"%>>ayka30</option>
        
        <option value="ayka31" <%if ku="ayka31" then response.Write "selected"%>>ayka31</option>
        <option value="ayka32" <%if ku="ayka32" then response.Write "selected"%>>ayka32</option>
        <option value="ayka33" <%if ku="ayka33" then response.Write "selected"%>>ayka33</option>
        <option value="ayka34" <%if ku="ayka34" then response.Write "selected"%>>ayka34</option>
        <option value="ayka35" <%if ku="ayka35" then response.Write "selected"%>>ayka35</option>
        <option value="ayka36" <%if ku="ayka36" then response.Write "selected"%>>ayka36</option>
        <option value="ayka37" <%if ku="ayka37" then response.Write "selected"%>>ayka37</option>
        <option value="ayka38" <%if ku="ayka38" then response.Write "selected"%>>ayka38</option>
        <option value="ayka39" <%if ku="ayka39" then response.Write "selected"%>>ayka39</option>
        <option value="ayka40" <%if ku="ayka40" then response.Write "selected"%>>ayka40</option>
      </select>
	  
&nbsp;订单号：
<input name="aykasuoyoudd" type="text" id="aykasuoyoudd" value="<%if trim(request.Cookies("aykasuoyoudd"))<>"" then response.Write trim(request.Cookies("aykasuoyoudd"))%>" size="20">
&nbsp;联系方式：
<input name="aykatel" type="text" id="aykatel" value="<%if trim(request.Cookies("aykatel"))<>"" then response.Write trim(request.Cookies("aykatel"))%>" size="20">
&nbsp;卡号ID：
<input name="aykaid" type="text" id="aykaid" value="<%if trim(request.Cookies("aykaid"))<>"" then response.Write trim(request.Cookies("aykaid"))%>" size="20">
<input type="submit" name="Submit" value=" 查 询 ">
<br><br>
</form>
  <table width="99%" border="0" cellpadding="0" cellspacing="0" class="table_style_a1">
     <form action="?act=alldel&page=<%=page%>" method="post" name="myform" id="myform"> 
       <tr>
        <th class="border_right border_bottom" >
        <th align="center" class="border_right border_bottom" >ID
        <th align="center" class="border_right border_bottom" >商户ID
        <th align="center" class="border_right border_bottom" >商品名称        
        <th align="center" class="border_right border_bottom">卡密信息
        <th align="center" class="border_right border_bottom">订单号        
        <th align="center" class="border_right border_bottom">商品价格
        <th align="center" class="border_right border_bottom">购卡时间
        <th align="center" class="border_right border_bottom">联系方式        
        <th align="center" class="border_bottom">删除		</tr>
<%
sql="select * from "&ku&" where aykayesno=1"&sql2&" order by aykakai desc" 
'response.Write sql
'response.End()
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='#D2FFFF' onmouseout=this.bgColor='#ffffff'>
        <td align="center" class="border_right border_bottom"><input name="list1" type="checkbox" id="list1" value="<%=rs("aykaid")%>" onClick="unselectall1()"></td>
        <td align="center" class="border_right border_bottom"><%=rs("aykaid")%></td>
        <td align="center" class="border_right border_bottom"><a target="_blank" href="adminuseredit.asp?id=<%=rs("aykasuoyou")%>&page=<%=page%>"><%=rs("aykasuoyou")%></a></td>
        <td align="center" class="border_right border_bottom"><%
		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 align="center" class="border_right border_bottom">
		<%
		response.Write "卡号："&trim(rs("ayka"))&"<br>"
		if trim(rs("aykapass"))<>"0"  then
		response.Write "密码："&trim(rs("aykapass"))
		end if
		%></td>
        <td align="center" class="border_right border_bottom"><%=trim(rs("aykasuoyoudd"))%></td>
        <td align="center" class="border_right border_bottom">
          <%if not(rsgood.bof and rsgood.eof) then
		response.Write Formatnumber(rsgood("ayjiage"),2,true,-1,0)&"元"
		else
		response.Write("商品或已删除")
		end if%>		</td>
        <td align="center" class="border_right border_bottom"><%=rs("aykakai")%></td>
        <td align="center" class="border_right border_bottom"><%if trim(rs("aykatel"))<>"0" then 
		response.Write trim(rs("aykatel"))
		else
		response.Write "-"
		end if%></td>
        <td align="center" class="border_bottom"><a href="?act=del&id=<%=rs("aykaid")%>&page=<%=page%>&uid=<%=rs("aykasuoyou")%>&shangid=<%=shangid%>&ku=<%=ku%>"  onclick="javascript:return confirm('您确定要删除吗？');"><img src="<%=ossurl%>images/ico_del.gif" alt="删除分类" border="0"></a></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="10">&nbsp;<input name="chkAll1" type="checkbox" id="chkAll1" onClick="this.value=check1(this.form.list1)" value="checkbox"> <input name="ku" type="hidden" id="ku" value="<%=ku%>">  
        <input name="shangid" type="hidden" id="shangid" value="<%=shangid%>">
        全选
          <input type="submit" name="Submit" value="删除选定" onClick="javascript:return confirm('您确定要删除吗？');"> 

<%if pagecount=0 then   
response.write("首页 ")
elseif page=1 then       
response.write("首页 ")
else%>                   
<a href="<%=link%>&page=1">首页</a>
<%end if

if pagecount=0 then   
response.write("上页&nbsp;")
elseif page=1 then       
response.write("上页&nbsp;")
else%>                   
<a href="<%=link%>&page=<%=page-1%>">上页</a>&nbsp;
<%end if

if pagecount>20 then
if page<=10 then 
aa=1
bb=20
aabu=""
bbbu=" … "
elseif page>=11 then 
aa=page-9
bb=page+10
aabu=" …"
bbbu=" … "
	if bb>=pagecount then 
	aa=pagecount-20
	bb=pagecount
	aabu=" … "
	bbbu=""
	end if
end if
response.Write aabu
for aa=aa to bb
if page=aa then
response.Write("<a href="&link&"&page="&aa&"><strong>"&aa&"</strong></a>&nbsp;")
else
response.Write("<a href="&link&"&page="&aa&">"&aa&"</a>&nbsp;")
end if
next
response.Write bbbu

else

for i=1 to pagecount
if page=i then
response.Write("<a href="&link&"&page="&i&"><strong>"&i&"</a></strong>&nbsp;")
else
response.Write("<a href="&link&"&page="&i&">"&i&"</a>&nbsp;")
end if
next

end if

if pagecount=0 then 
response.write("下页&nbsp;")
elseif page=pagecount then 
response.write("下页&nbsp;")
else%>                    
<a href="<%=link%>&page=<%=page+1%>">下页</a>
<%end if%>
<%if pagecount=0 then  '总页数为0 显示空
response.write("尾页 ") 
elseif page=pagecount then 
response.write("尾页 ")
else%>                    
<a href="<%=link%>&page=<%=pagecount %>">尾页</a>
<%end if

if pagecount<>0 then 
response.Write page&"/"&pagecount
end if
response.Write "&nbsp;共"&zongshu&"条"
%>		</td>
      </tr></form>
    </table>
</DIV>


</DIV></DIV>
<DIV class=clear></DIV></DIV>
</DIV>
<SCRIPT>
$(function(){
$('.left_title').each(function(){
   $(this).click(function(){
	   var index=$('.left_title').index(this);
	   if($(this).next().hasClass('hide_m')){
		   $(this).next().removeClass('hide_m');
           $(this).next().show();		 
		   $(this).find('img').attr('src','<%=ossurl%>images/expansion.gif');
		   $.cookie('m_index_'+index,'',{expires:0});
	   } else {
	       $(this).next().hide();
		   $(this).next().addClass('hide_m');
		   $(this).find('img').attr('src','<%=ossurl%>images/shrank.gif');		   
		   $.cookie('m_index_'+index,'none',{expires:365});
	   }
   })
})

$('.left_title').each(function(){
	var index=$('.left_title').index(this);
    $(this).next().css('display',$.cookie('m_index_'+index) ? $.cookie('m_index_'+index) : '');
	if($.cookie('m_index_'+index)){
	    $(this).next().addClass('hide_m');
	}
	$(this).find('img').attr('src',$.cookie('m_index_'+index) ? '<%=ossurl%>images/shrank.gif' : '<%=ossurl%>images/expansion.gif');
})
})

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

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

