<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="admin.asp"-->
<!--#include file="../inc/conn.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>标签管理</title>
<link href="style/style.css" rel="stylesheet" type="text/css" />
</head>

<body id="page">
<h2 class="title">Tags标签</h2>
<%
if request("act")=4 then
  conn.execute("delete from cw_tags where id="&request("id"))
  response.Write("<script>alert('Tags删除成功!'); location.href='cw_tags.asp'</script>")
  response.End()
end if
%>
<table width="99%" border="0" align="center" class="line_table">
  <tr>
    <td height="20">&nbsp;网站后台管理 &gt;&gt; <a href="cw_tags.asp">Tags标签</a></td>
	<td align="right"><form action="cw_tags.asp" method="post" name="form" onsubmit="if(this.key.value==''){this.key.focus();return false}">
	    <input name="lei" type="hidden" id="lei" value="1" />
	    信息搜索
	    <input name="key" type="text" id="key" size="18" maxlength="50" style="height:18px; line-height:18px" value="<%=request("key")%>" />
        <input type="submit" name="Submit2" value="搜索" /></form></td>
  </tr>
</table>
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
      <tr>
        <td width="6%" align="center" bgcolor="#F0F3F5">ID</td>
        <td width="20%" align="center" bgcolor="#F0F3F5">标签</td>
		<td width="20%" align="center" bgcolor="#F0F3F5">次数</td>
        <td width="18%" align="center" bgcolor="#F0F3F5">管理</td>
      </tr>
      <%
		set rs1=server.createobject("adodb.recordset")
		if request("lei")=1 then
		   sql="select * from cw_tags where title like '%"&request("key")&"%'"
		else
		   sql="select * from cw_tags order by id asc"
		end if
		rs1.open sql,conn,1,1
		if not rs1.eof then
		         page_count=10
  				 if Request("page")="" or Request("page")="0" then
   				  page=1
  				 else
    				 page=cint(Request("page"))
  				 End if 
					 totalcount=rs1.RecordCount
   				  totalpage=int(totalcount/page_count+(page_count-1)/page_count)
  				 if page>totalpage then page=totalpage
  				 if rs1.EOF then    
   				  else
   				  for i = 1 to (page-1)*page_count
    				   rs1.MoveNext
   				  Next
   				  if page<totalpage then
    				   psize=page_count
   				  else
   				    psize=totalcount-(page-1)*page_count
   				  End if
   				  for i = 1 to psize
		  %>
      <tr >
        <td align="center" bgcolor="#FFFFFF"><%=rs1("id")%></td>
        <td bgcolor="#FFFFFF" >&nbsp;&nbsp;<%=rs1("title")%></td>
		<td align="center" bgcolor="#FFFFFF"><%=rs1("tcount")%></td>
        <td align="center" bgcolor="#FFFFFF" ><a href="cw_tags.asp?id=<%=rs1("id")%>&act=4" onclick="return confirm('你确定要删除？')">删除</a></td>
      </tr>      
      <%
		  rs1.MoveNext
 		next
		end if
		end if
		rs1.close
		set rs1=nothing
		  %>
		  <tr><td colspan="4" bgcolor="#FFFFFF" height="20" align="center"><!--#include file="../inc/page.asp"--></td></tr>
    </table>
<%call closes()%>
</body>
</html>
