ACTIVE SERVER PAGE > ¸®½ºÆ® º¸±â µî·ÏÀÏ : 2017-07-03 20:11 Á¶È¸¼ö : 54,694
<!--METADATA TYPE="typelib" NAME="ADODB Type Library" File="C:\Program Files\Common Files\System\ado\msado15.dll" --> <% Option Explicit '=====================================' ' ÇÁ·ÎÁ§Æ®¸í : ankyu.pe.kr ' ¸ñ Àû : °Ô½ÃÆÇ ' ³¯ Â¥ : 2001/03/15 ~2001/03/31 ' ÇÁ·Î±×·¡¸Ó : ÃÖ ¾È ±Ô ' À̸ÞÀÏÁÖ¼Ò : cak0280@skylla.co.kr '=====================================' '====================================' ' Ŭ¶ó¾ðÆ® ij½¬ ¹æÁö '=====================================' response.expires = -1 response.AddHeader "Pragma", "no-cache" response.AddHeader "cache-control", "no-store" response.buffer=true '=====================================' ' Declare Variable '=====================================' ' General Dim strSql ' Äõ¸® Dim objCnn ' Connection °´Ã¼ Dim objRs Dim currentpage ' ÇöÀç ÆäÀÌÁö Dim recordCount ' ·¹ÄÚµå °¹¼ö Dim pagesize ' ÆäÀÌÁö Å©±â Dim pagecount ' ÆäÀÌÁö °¹¼ö Dim choice ' ÇÑ ºí·° ¼ö Dim Tot_block ' Àüü ºí·° ¼ö Dim now_Block ' ÇöÀç ºí·° ' Temp Dim Title ' Á¦¸ñ Dim i Dim j '=====================================' ' Get Request '=====================================' pagesize=10 choice=10 if request("currentpage")="" then currentpage=1 else currentpage=request("currentpage") end if if request("now_block")="" then now_block=0 else now_block=request("now_block") end if '=====================================' ' DB Connection '=====================================' Set objCnn = Server.CreateObject("ADODB.Connection") objCnn.Open("dsn=test;uid=sa;pwd=") strSql="SELECT COUNT(BOARD_IDX) FROM BOARD1" set objRs=ObjCnn.Execute(strSql) recordCount = objRs(0) pagecount = int((recordCount-1)/pagesize)+1 StrSql="SELECT * From " StrSql=strSql+"( SELECT Top " & pagesize & " * FROM " StrSql=strSql+" ( Select Top " & currentpage*pagesize&" * From Board1 " StrSql=strSql+" ORDER BY ref desc, re_step asc) a ORDER BY ref asc, re_step " StrSql=strSql+" desc) a " StrSql=strSql+" ORDER BY ref desc, re_step asc" set objRs=objCnn.Execute(strSql) %> <table width=90%> <tr align="center"> <td align='center'> ¹æ ¸í ·Ï </td> </tr> </table> <table width=90%> <tr> <td align='right'>[<a href='./write.asp'>±Û¾²±â</a>] </td> </tr> </table> <TABLE width=90%> <tr> <td></td> <td width="49%">Á¦ ¸ñ</td> <td width="15%">±Û¾´ÀÌ</td> <td width="15%">³¯ Â¥</td> <td width="12%">Á¶ ȸ</td> </tr> <% if objRs.BOF or objRs.EOF then %> <tr> <td align=center colspan=5>ÀÔ·ÂµÈ µ¥ÀÌŸ°¡ ¾ø½À´Ï´Ù.</td> </tr> <% objCnn.Close Set objCnn = Nothing response.end end if Do until objRs.EOF %> <tr> <td> <% if DateDiff("h",objRs("writeday"),Now()) < 22 then %> <img src="images/dot.gif" WIDTH="16" HEIGHT="15"> <% else %> <% end if %> </td> <td width="49%"> <% if objRs("re_level") > 0 then %> <img src="images/level.gif" width='<%=7*objRs("re_level")%>' height="20"> <img src="images/re.gif" width="26" height="16"> <% end if %> <a href="content.asp?idx=<%=objRs("num")%>"> <%=objRs("title")%> </td> <td width="15%"> <a href="mailto:<%=objRs("email")%>"><%=objRs("name")%></a></td> <td width="15%"> <%=objRs("writeday")%></td> <td width="12%"> <%=objRs("readnum")%></td> </tr> <% objrs.MoveNext loop %> </table> <% tot_block=int(pagecount / choice) if tot_block = (pagecount / choice) then tot_block=tot_block-1 end if %> <% if Cint(now_block)>0 then %> [<a href='list.asp?currentpage=<%=currentpage%>&now_block=<%=now_block-1%>'>ÀÌÀü<%=choice%>°³</a>] <% end if %> <% if currentpage <> 1 then %> [<a href="list.asp?currentpage=<%=currentpage-1%>&now_block=<%=now_block%>">ÀÌÀü</a>] <% end if %> <% if Cint(tot_block) <> Cint(now_block) then for i=1 to choice if cint(now_block*choice)+i=cint(currentpage) then response.write "["&(cint(now_block*choice) + i)&"]" else %> [<a href='list.asp?currentpage=<%=(int(now_block*choice) + i)%>&now_block=<%=now_block%>'><%=(int(now_block*choice) + i)%></a>]</font> <% end if next else if (pagecount mod choice)=0 then j=10 else j=(pagecount mod choice) end if for i = 1 to j if cint(nowblock*mychoice)+i=cint(page) then response.write "["&(cint(now_block*choice) + i)&"]" else %> [<a href='list.asp?currentpage=<%=(int(now_block*choice) + i)%>&now_block= <%=now_block%>'><%=(int(now_block*choice) + i)%></a>]</font> <% end if next end if %> <% if Cint(currentpage) <> Cint(pagecount) then %> [<a href="list.asp?currentpage=<%=currentpage+1%>&now_block=<%=now_block%>">´ÙÀ½</a>] <% end if if (Cint(tot_block) > 0) and (Cint(now_block) < Cint(tot_block)) then %> [<a href='list.asp?currentpage=<%=currentpage%>&now_block=<%=now_block+1%>'> ´ÙÀ½<%=choice%>°³</a>]</font> <% end if %> <font size="2">[<%=currentpage%>/<%=pagecount%>] <% objCnn.Close Set objCnn = Nothing %> À§ ¼Ò½º´Â ½ÇÁ¦ ÀúÀÇ °Ô½ÃÆÇ¿¡¼ »ç¿ëµÇ´Â ¼Ò½º ÀÔ´Ï´Ù. Å×½ºÆ® ÇØ º¸½Ã±æ ¹Ù¶ø´Ï´Ù. ¸¸¾à Áú¹® »çÇ×ÀÌ ÀÖÀ¸½Ã¸é °Ô½ÃÆÇÀ» ÀÌ¿ëÇØ ÁÖ¼¼¿ä..... ±×·³,,,,,
|