<!--#include file="../../here99login/0.asp"-->
<!--#include file="../../conn/zkconn.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../../css/css.css" rel="stylesheet" type="text/css">
</head><body>
<table width="650" align="center" cellpadding="2" cellspacing="2">
  <tr> 
    <form name="form1" method="post" action="kefu.asp">
      <td width="180" height="25" align="center"> 关键字
<input name="keywords" type="text" class="wenbenkuang" id="keywords" size="10"> 
        <input name="Submit" type="submit" class="go-wenbenkuang" value="搜索">
      </td>
    </form>
      <td width="454" align="center"><a href="tianjia1.asp">&gt;&gt;添加新专题</a></td>
  </tr>
</table>
<table width="750" align="center" cellpadding="2">
  <tr align="center" valign="middle"> 
    <td width="100" bgcolor="#CCCCCC">所属类别</td>
    <td width="375" bgcolor="#CCCCCC">专题标题</td>
    <td width="125" bgcolor="#CCCCCC">加入日期</td>
    <td width="50" bgcolor="#CCCCCC">隐藏</td>
    <td width="50" bgcolor="#CCCCCC">修改</td>
    <td width="50" bgcolor="#CCCCCC">删除</td>
  </tr>
<%
id=Request("id")
page=Request("page")
if Request("y")="del" then
	conn.execute("Delete zhuanti_g where id="&Request("id")&"")
	conn.execute("Delete zhuanti_c where gid="&Request("id")&"")
	Response.redirect "index.asp?keywords="&request("keywords")&"&page="&page&""
end if

select case Request("cang")
	case "0"
	conn.execute("Update zhuanti_g set cang=0 where id="&Request("id")&"")
	Response.redirect "index.asp?keywords="&request("keywords")&"&page="&page&""
	case "1"
	conn.execute("Update zhuanti_g set cang=1 where id="&Request("id")&"")
	Response.redirect "index.asp?keywords="&request("keywords")&"&page="&page&""
end select

keywords=trim(request("keywords"))
Set rs=Server.CreateObject("ADODB.Recordset")
if keywords<>"" then
sql="select * from zhuanti_g where (bt like '%"&keywords&"%') order by id desc "
else
sql="select * from zhuanti_g order by id desc"
end if
rs.open sql,conn,3,1 
if rs.eof then
response.write "<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;暂无"
response.end
end if
 rs.pagesize = 15
if request("page")=""  or isempty(request("page")) then
page = 1
else
page=int(request("page"))
end if
if page>rs.pagecount then
page=rs.pagecount
end if
if not rs.BOF then
Rs.Move Rs.PageSize*(page-1)
end if
i=1
do while not rs.eof and i<=rs.pagesize
%>
  <tr valign="middle"> 
    <td width="100" align="center" bgcolor="#f1f1f1"><%= rs("lbname") %></td>
    <td width="375" bgcolor="#f1f1f1"><a href="../../subject.asp?id=<%= rs("id")%>" target="_blank"><%= rs("bt") %></a></td>
    <td width="125" align="center" bgcolor="#f1f1f1"><%= rs("sj") %></td>
    <td width="50" align="center" bgcolor="#f1f1f1">
<%if rs("cang")=0 then
response.write "<a href=index.asp?cang=1&keywords="&request("keywords")&"&id="&rs("id")&"&page="&page&">显示</a>"
else
response.write "<a href=index.asp?cang=0&keywords="&request("keywords")&"&id="&rs("id")&"&page="&page&"><font color=red>已隐藏</font>"
end if %></td>
    <td width="50" align="center" bgcolor="#f1f1f1"><a href=xiugai.asp?id=<%=rs("id")%>>修改</a></td>
    <td width="50" align="center" bgcolor="#f1f1f1"><a href=index.asp?y=del&keywords=<%=request("keywords")%>&id=<%=rs("id")%>&page=<%=page%>>删除</a></td>
  </tr>
  <%
i=i+1
 rs.MoveNext                                              
 loop 
%>
  <tr align="center" valign="middle"> 
    <form name=form method=post action=?keywords=<%=request("keywords")%>&xs=<%=request("xs")%>>
      <td colspan="6" bgcolor="#CCCCCC"> <%
if rs.recordcount<>0 then
if page-1 mod 10=0 then
		p=(page-1) \ 10
	else
		p=(page-1) \ 10
	end if

	response.write "页次："& page &"/"& rs.pagecount &"页 每页"& rs.pagesize &" 共"& rs.recordcount &"条记录"&_
					" 分页："
    if rs.pagecount>1 and page<>1 then response.write "<a href=?keywords="&request("keywords")&"&page=1 title='首页'>[|<]</a> "
	if p*10>0 then response.write "<a href='?keywords="&request("keywords")&"&page="&p*10&"' title=上十页>[&lt;&lt;]</a>   "
    uming_i=1
	for ii=p*10+1 to P*10+10
		   if ii=page then
	          response.write "<font color=#ff0000>["+Cstr(ii)+"]</font> "
		   else
		      response.write "<a href='?keywords="&request("keywords")&"&page="&ii&"'>["+Cstr(ii)+"]</a>   "
		   end if
		if ii=rs.pagecount then exit for
		 uming_i=uming_i+1
	next
	if ii<=rs.pagecount and uming_i=11 then response.write "<a href='?keywords="&request("keywords")&"&page="&ii&"' title=下十页>[&gt;&gt;]</a>   "
	if rs.pagecount>1 and page<>rs.pagecount then response.write "<a href=?keywords="&request("keywords")&"&page="& rs.pagecount &" title='尾页'>[>|]</a>"
response.write(" 　跳页：<input type=text name=page size=2 maxlength=3 class=wenbenkuang> <input type=submit name=Submit value=Go class=go-wenbenkuang>")
end if
rs.close
set rs=nothing%> </td>
    </form>
  </tr>
</table>
</body>
</html>
