<>"" then searchstr.value=""
thelist.innerHTML=""
thecounts.innerHTML=""
if thename<>"" or thesearch<>"" then
dim conn
set conn=createobject("adodb.connection")
conn.open "provider=microsoft.jet.oledb.4.0;data source=db.mdb"
set rs=createobject("adodb.recordset")
rs.cursorlocation=adUserClient
if thesearch="" then
if thename="全部" then
sql="select id,class_name,title,enter_time from list order by id desc"
else
sql="select id,class_name,title,enter_time from list where class_name=''"&thename&"'' order by id desc"
end if
else
if thename="" then
sql="select distinct id,class_name,title,enter_time from list where (title like ''%"&thesearch&"%'' or content like ''%"&thesearch&"%'' or class_name like ''%"&thesearch&"%'')"
else
sql="select distinct id,class_name,title,enter_time from list where (title like ''%"&thesearch&"%'' or content like ''%"&thesearch&"%'' or class_name like ''%"&thesearch&"%'') and class_name=''"&thename&"''"
end if
end if
rs.open sql,conn,1,1
page=trim(thenum)
if page<>"" then page=cint(page)
pre=true
last=true
if not rs.eof then
if theheight=600 then
maxperpage=20
elseif theheight>600 then
maxperpage=28
else
maxperpage=20
end if
rs.pagesize=maxperpage
thepages=rs.pagecount
thecount=rs.recordcount
if page="" and page<1 then
intpage=1
pre=false
else
if page>thepages then
intpage=thepages
last=false
else
intpage=cint(page)
end if
end if
themovenum=(intpage-1)*maxperpage
thecounts.innerHTML="共有<font color=''#ffff33''>"&thecount&"</font>条信息[<font color=''#ffff33''>"&maxperpage&"</font>条/页 共<font color=''#ffff33''>"&thepages&"</font>页 当前第<font color=''#ffff33''>"&page&"</font>页]"
rs.movefirst
if (intpage-1)*maxperpage<thecounts then
dim bookmark
bookmark=rs.bookmark
rs.move themovenum
end if
strlist="<table width=''80%'' align=''center'' cellpadding=''0'' cellspacing=''1'' border=0>"
for i=1 to maxperpage
if rs.eof then exit for
strlist=strlist&"<tr><td height=''20'' class=''b''>[<font color=yellow>"&rs("class_name")&"</font>] "&rs("title")&" <font color=''#f6f6f6''>"&rs("enter_time")&"</font> <a href=''#'' onclick=openthecontent("&rs("id")&")>查看</a> <a href=''#'' onclick=editnews("&rs("id")&")>修改</a> <a href=''#'' onclick=delthecontent("&rs("id")&")>删除</a></td></td>"
rs.movenext
if rs.eof then exit for
next
strlist=strlist&"</table>"
thelist.innerHTML=strlist
pagelist="第<select name=''cpage'' onchange=changeit2()>"
for j=1 to thepages
if j=intpage then
pagelist=pagelist&"<option value="&j&" selected>"&j&"</option>"
else
pagelist=pagelist&"<option value="&j&">"&j&"</option>"
end if
next
pagelist=pagelist&"</select>页"
fenye.innerHTML=pagelist
call changepage
else
thecounts.innerHTML="<font color=''#f