<!--#include file="conn.asp"-->
<!--#include file="ad_chk.asp"-->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href=inc/css.css rel=STYLESHEET type=text/css>
<body topmargin="5" leftmargin="5" rightmargin="5" bottommargin="5">
<%
if Request.Cookies("WrzcNet")("admin_class")<>0 and Request.Cookies("WrzcNet")("admin_class")<>1 then
response.write "你没有这个权限!"
response.end
end if
%>
<table border="0" cellspacing="0" cellpadding="8"><form method="POST" action="ad_delzp.asp">
<tr><td align="right">搜索赠品：</td>
<td align="center"><input type="text" name="zp_name" size="20"></td>
<td><input type="submit" value="搜索" name="B1"></td>
</tr></form></table>
<%
set rs=server.createobject("adodb.recordset")
selectid=request("selectid")
if request("action")="del" then
conn.execute "delete from WrzcNet_zp where zp_id in ("&selectid&")"
call deleok(delet,"ad_delzp.asp")
end if
%>
<table border="0" cellpadding="5" cellspacing="0" class="st">
<form name="form" method="post" action="ad_delzp.asp?action=del">
<tr><td class="sa">赠品名称</td>
<td class="sa">价格</td>
<td class="sa">操作</td>
<td class="sa"><input type="checkbox" name="checkbox2" value="Check All" onClick="alls()">全选</td></tr>
<%
page=request("page")
if page="" then page=1
if not(isnumeric(page)) then page=1
if page<1 then page=1
page=int(page)
set rs=server.createobject("adodb.recordset")

if request("zp_name")<>"" then
zpname=request("zp_name")
sql="select * from WrzcNet_zp where zp_name like '%"&zpname&"%' order by zp_id DESC"
else
sql="select * from WrzcNet_zp order by zp_id DESC"
end if
rs.open sql,conn,1,1
if rs.eof then
response.write "<tr><td align=center bgcolor=ffffff height=30  colspan=10>没有赠品</td></tr>"
response.end
else
rs.pagesize=20
totalrec=rs.recordcount
totalpage=rs.pagecount
if page>totalpage then page=totalpage
rs.absolutepage=page
i=0
do while not rs.eof and (i<rs.pagesize)
i=i+1%>
<tr><td class="s<%=i mod 2%>"><a href="ad_changezp.asp?zp_id=<%=rs("zp_id")%>"><%=rs("zp_name")%><%if rs("zp_kucun")<=0 then%><font color="#FF0000">（缺）</font><%end if%></a></td>
<td class="s<%=i mod 2%>"><%=rs("zp_price")%></td>
<td class="s<%=i mod 2%>"><a href="ad_changezp.asp?zp_id=<%=rs("zp_id")%>">修改</a></td>
<td class="s<%=i mod 2%>"><input name="selectid" type="checkbox" id="selectid" value="<%=rs("zp_id")%>"></td></tr>
<%
rs.movenext
loop
end if
rs.close
set rs=nothing
%>
<tr><td bgcolor="#FFFFFF" align="center" colspan="4">
<input type="submit" name="Submit" value="删除选中资料" onClick="return scheck();">
</td></tr></form></table>

<script language=javascript>

function scheck()
{
  if(!confirm('确认进行该操作吗？')) return false;
}

function alls()
{
   var a = document.form.getElementsByTagName("input");
   if(a[1].checked==true){
   for (var i=0; i<a.length; i++)
      if (a[i].type == "checkbox") a[i].checked = false;
   }
   else
   {
   for (var i=0; i<a.length; i++)
      if (a[i].type == "checkbox") a[i].checked = true;
   }
}
</script>

<table border="0" width="100%" cellspacing="0">
<form action=<%=filename%>?zp_name=<%=request("zp_name")%> method=post>
<tr><td height="30">共<font color=red><%=totalpage%></font>页&nbsp;第<%=page%>页&nbsp;
<%if page-1>0 then%><a href="ad_delzp.asp?zp_name=<%=request("zp_name")%>&page=<%=page-1%>">上一页</a><%else%>上一页<%end if%>
&nbsp;
<%if page+1<=totalpage then%><a href="ad_delzp.asp?zp_name=<%=request("zp_name")%>&page=<%=page+1%>">下一页</a><%else%>下一页<%end if%>
&nbsp;&nbsp;页面跳转：<input type="text" name="page" value="<%=page+1%>" size="1" style="text-align: center" class=input><input type="submit" value="GO" class=input>
</td></tr></form></table>

<!--#include file="ad_bottom.asp"-->