<%
set rs=server.createobject("adodb.recordset")
If trim(request("is_search"))="yes" Then
dim flag,sql
sql="select * from news where "
flag=0
if trim(request("search_type"))<>"" then
sql=sql&" addtype='"&trim(request("search_type"))&"'"
flag=1
end if
key=trim(request("keyword"))
if key="请输入关键词" then
key=""
end if
if key<>"" then
if flag=1 then
sql=sql&" and "
end if
sql=sql&" title like '%"&key&"%'"
end if
sql=sql&" order by id desc"
else
sql="select * from news where addtype='fzlc' order by id desc"
end if
rs.open sql,conn,1,3
if rs.eof then
response.write "
库中暂时没有记录
"
response.end()
end if
if request.QueryString("page_no")="" then
page_no=1
else
page_no=cint(request.QueryString("page_no"))
end if
rs.pagesize=8 '
rs.absolutepage=page_no
i=rs.pagesize
int_page_count=rs.recordcount\rs.pagesize
if (rs.recordcount mod rs.pagesize)<>0 then
int_page_count=int_page_count+1
end if
record_no=0
do while not rs.eof and i>0
record_no=record_no+1
i=i-1
%>