<% code=request("code") SQL = "SELECT * FROM "&code&" ORDER BY NID DESC" Set rs = Server.CreateObject("ADODB.Recordset") rs.PageSize=10 rs.Open Sql, dbConnect, 1 if Request("pageNo")<>"" then Session("curpage")=Request("pageNo") else Session("curpage")=1 end if if Not(rs.EOF or rs.BOF) then rs.AbsolutePage=Session("curpage") numPerPage=10 totalpage=rs.PageCount totalblock=int(totalpage / numPerPage) if totalblock=(totalpage / numPerPage) then totalblock=totalblock-1 end if if Request("pageNo")<>"" then if Request("pageNo") Mod numPerPage=0 then nowblock=int((Request("pageNo")/numPerPage))-1 else nowblock=int((Request("pageNo")/numPerPage)) end if else nowblock=0 end if end if NID=rs("NID") %>
   
 
<% i = 1 Do until rs.EOF or i>rs.PageSize REG_DATE=rs("REG_DATE") temp=split(REG_DATE,"-") %> <% rs.MoveNext i=i+1 loop %>
<%=rs("NID")%> <% title=rs("TITLE") If Len(title)>50 then response.write Left(title,50)&"..." Else response.write title End If %> <%=temp(0)%>-<%=temp(1)%>-<%=temp(2)%> <%=rs("ref")%>
<%if nowblock>0 then%> <% end if %> <%if totalblock <> nowblock then %> <% for k=1 to numPerPage %> <% if (int(nowblock*numPerPage)+k=int(Session("curpage"))) then %> <%=(int(nowblock*numPerPage)+k)%> <% else %> <%=(int(nowblock*numPerPage)+k)%> <% end if %> <% next %> <% else %> <% remainder=totalpage mod numPerPage if remainder=0 then remainder=numPerPage end if for k=1 to remainder if (int(nowblock*numPerPage)+k=int(Session("curpage"))) then %> <%=(int(nowblock*numPerPage)+k)%> <% else %> <%=(int(nowblock*numPerPage)+k)%> <% end if %> <% next %> <%end if %> <% if (totalblock>0) and (nowblock <% end if %>