<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="Conn.asp"-->
<!--#include file="Ex_Cls/Ex_CommonCls.asp"-->
<!--#include file="Ex_Cls/Ex_SplitPageCls.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<link href="Admin_STYLE.CSS" rel="stylesheet" type="text/css"> 
<body leftmargin="2" topmargin="0" marginwidth="0" marginheight="0" class="bgcolor">
<script language="JavaScript">
function unselectall()
{
    if(document.myform.chkAll.checked){
	document.myform.chkAll.checked = document.myform.chkAll.checked&0;
    } 	
}

function checkAll(form)
{
  for (var i=0;i<form.elements.length;i++)
    {
    var e = form.elements[i];
    if (e.Name != "chkAll")
       e.checked = form.chkAll.checked;
    }
}
</script>
<% 
Dim ExComm
Set ExComm=new Ex_CommonCls
	ExComm.IsAdLogin 
	ExComm.IsIpAllow
dim action
action=request.querystring("action")
select case action
case "del"
call del()
case "delmore"
call delmore()
case else
call show()
end select
 %>
 <%
  sub del()
  dim id,strsql
  id=request.querystring("id")
  strsql="delete from Ex_Tags where id="&id
  Conn.execute(strsql)
  strsql="delete from Ex_Tags where id="&id
  Conn.execute(strsql)
  ExComm.ShowMsg "关键字已经成功删除",request.servervariables("http_referer")
  end Sub
  Sub delmore()
  Dim id,strsql,i
id=request("tags")
id=Split(id,",")
For i=0 To UBound(id)
  strsql="delete from Ex_Tags where id="&id(i)
  Conn.execute(strsql)
  strsql="delete from Ex_Tags where id="&id(i)
  Conn.execute(strsql)
Next
 ExComm.ShowMsg "关键字已经成功删除",request.servervariables("http_referer")
  End sub
  sub show()
  Dim ExPages,page,Rs
  Set ExPages=new Ex_SplitPageCls
  Expages.letConn=Conn
  Expages.letColumns="select *"
  ExPages.letDataFrom="from Ex_Tags"
  ExPages.letOrder=""
  Set rs=server.CreateObject("adodb.recordset")
  Expages.letPageSize="15"
  If ExComm.G(request("page"))="" Then
	page=1
  Else
	page=ExComm.G(request("page"))
  End if
  ExPages.letPage=CInt(page)
  ExPages.letStrPage=""
  ExPages.Execute()
 %>
 <FORM METHOD=POST ACTION="admin_tags.asp?action=delmore">
  <table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#FFFFFF" class="border">
  <tr>
    <th class="topbg" colspan="6">所有关键字</th>
  </tr>
  <tr>
    <td class="tdbg" align="center" width="5%">选中</td>
    <td class="tdbg" width="38%" align="center">关键字</td>
    <td class="tdbg" width="15%" align="center">所属分类</td>
    <td colspan="2" align="center" class="tdbg">次数</td>
    <td class="tdbg" width="9%" align="center">删除</a></td>
  </tr>
  <%
 Set Rs=ExPages.getRs()
    If ExPages.getRsCount<>0 Then
       Do While Not rs.eof
   %>
  <tr>
     <td class="tdbg" align="center"><INPUT TYPE="checkbox" NAME="tags" value=<%=rs("id")%>></td>
    <td class="tdbg" width="38%" align="center"><%=Trim(rs("tagname"))%></td>
    <td class="tdbg" width="15%" align="center">
	
	<%=ExComm.GetClassName(Rs("classid"))%></td>
    <td colspan="2" align="center" class="tdbg"><%=rs("times")%></td>
    <td class="tdbg" width="9%" align="center"><a href="admin_tags.asp?action=del&id=<%=rs("id")%>" onClick="return confirm('是否删除?')">删除</a></td>
  </tr>
  <%rs.movenext
   loop%>
   <tr>
    <td class="tdbg" align="center"><INPUT TYPE="checkbox" NAME="chkAll" onclick=checkAll(this.form)></td>
    <td class="tdbg" width="38%" align="center">全部选取</td>
    <td class="tdbg" width="15%" align="center">操作：&nbsp;&nbsp;</td>
    <td class="tdbg" width="29%" align="center">删除<INPUT TYPE="radio" NAME="del"></td>
    <td class="tdbg" width="9%" align="center"><INPUT TYPE="submit" value="执行"></td>
    <td class="tdbg" width="9%" align="center">&nbsp;&nbsp;</td>
  </tr>
   <tr>
     <td colspan="6" align="center" class="tdbg"><%=ExPages.Show%></td>
    </tr>
</table>
</FORM>
  <%End if
  
  end sub
  %>
</body>
</html>
