%
pagesize = 10
if request("page") = "" then
page = 1
else
page = cint(request("page"))
end if
pggroup = ((page - 1) \ 10 + 1) * 10
sql = "select max(num) as max_num, count(*) as rec_cnt from dbsosiweb.dbo.Sosi_NewsBoard"
set rs = dbcon.execute(sql)
rec_cnt = cint(rs("rec_cnt"))
if rec_cnt > 0 then
max_num = cint(rs("max_num")) - pagesize * page
totalpage = (rec_cnt - 1) \ pagesize + 1
set rs = nothing
sql = "select * from dbsosiweb.dbo.Sosi_NewsBoard where num > " & max_num & " order by num desc, msgorder"
set rs = server.createobject("adodb.recordset")
rs.pagesize = pagesize
rs.open sql,dbcon,1
rs.absolutepage = page
end if
%>
:::::SOSI:::::
Total <%=rec_cnt%> <%=page%>/<%=totalpage%> page
<%
if rec_cnt = 0 then
%>
No Data
<%
else
%>
No
Subject
Name
Update
Count
<%
i = 1
bline = true
do until rs.eof or i>pagesize
if bline then
bgco = "bfbfbf"
else
bgco = "acacac"
end if
%>
<%
level =cint(rs("msglevel"))
if level = 0 Then
%>
<%=rs("num")%>
<%
end if
%>
<%
level = cint(rs("msglevel"))
reimg = ""
if level > 0 then
for j = 1 to level
reimg = reimg & " "
next
response.write reimg & "[Re]"
end if
title = rs("title")
cutLen = 35 - 2
if len(title) > cutLen then title = left(title, cutLen) & "..."
%>
&page=<%=page%>"> <%=title%>
<%
bline = not bline
rs.movenext
i = i + 1
loop
%>
<%
if page > 1 then
%>
[First]
<%
end if
if pggroup > 10 then
%>
[Prev10]
<%
end if
if pggroup > totalpage then
topg = totalpage
else
topg = pggroup
end if
if totalpage > 1 then
for i = pggroup - 9 to topg
if page = i then
%>
[<%= i %>]
<%
else
%>
[<%= i %>]
<%
end if
next
end if
if pggroup < totalpage then
%>
[Next10]
<%
end if
if page < totalpage then
%>
[End]
<%
end if
%>
<%
end if
%>
<%
rs.close
set rs = nothing
dbcon.close
set dbcon = nothing
%>