<% dim rs,sql dim classid dim classname dim totalPut dim CurrentPage dim TotalPages call getConst() if request("classid")<>"" then classid=request("classid") else classid=1 end if if not isempty(request("page")) then currentPage=cint(request("page")) else currentPage=1 end if set rs = server.createobject("adodb.recordset") set rs1=server.createobject("adodb.recordset") if trim(request("Nclassid"))<>"" then Nclassid=trim(request("Nclassid")) sql="select * from ANclass where NclassID="&cstr(Nclassid) rs.open sql,conn,1,1 if not rs.eof then Nclassname=rs("Nclass") end if rs.close else Nclassid="" Nclassname="¢FDt3!??!!Oi" end if sql="select * from Aclass where classID="&cstr(classid) rs.open sql,conn,1,1 if not rs.eof then classname=rs("class") end if rs.close %>
 
 
<% if Nclassid<>"" then sql="SELECT top 100 [article].[articleid], [article].[title], [article].[dateandtime], [article].[hits],[writer], [article].[classid], [article].[Nclassid], [ANclass].[Nclass] FROM ANclass INNER JOIN article ON [ANclass].[Nclassid]=[article].[Nclassid] where article.classid = " & Classid & " ORDER BY [article].[articleid] DESC" else sql="SELECT top 100 [article].[articleid], [article].[title], [article].[dateandtime], [article].[hits],[writer], [article].[classid], [article].[Nclassid], [ANclass].[Nclass] FROM ANclass INNER JOIN article ON [ANclass].[Nclassid]=[article].[Nclassid] WHERE [article].[Nclassid]=[ANclass].[Nclassid] ORDER BY [article].[articleid] DESC" end if rs.open sql,conn,1,1 if rs.eof and rs.bof then response.write "

!LS|3cI!LS|3!!Oa!Li¢FDo|o??!!Oi

" else MaxPerPage=PageCount totalPut=rs.recordcount if currentpage<1 then currentpage=1 end if if (currentpage-1)*MaxPerPage>totalput then if (totalPut mod MaxPerPage)=0 then currentpage= totalPut \ MaxPerPage else currentpage= totalPut \ MaxPerPage + 1 end if end if if currentPage=1 then showContent showpage totalput,MaxPerPage,"index.asp" else if (currentPage-1)*MaxPerPage
 "><%=rs("title")%> (<%=rs("dateandtime")%>)-<%=rs("hits")%>
 
<% i=i+1 if i>=MaxPerPage then exit do rs.movenext loop end sub %>
 
<% function showpage(totalnumber,maxperpage,filename) dim n if totalnumber mod maxperpage=0 then n= totalnumber \ maxperpage else n= totalnumber \ maxperpage+1 end if ' response.write "
" ' response.write ""&Nclassname&"" if CurrentPage<2 then response.write "
下一頁│末頁│ " else response.write "
首頁 " response.write "│上一頁 " end if if n-currentpage<1 then response.write "│下一頁│末頁│" else response.write "" response.write "下一頁末 頁│" end if response.write "
"&totalnumber&"則新聞  目前頁次:"&CurrentPage&"/"&n&"頁" response.write " ("&maxperpage&" / 頁)" %> <% end function set rs=nothing conn.close set conn=nothing %>