<% 'Option Explicit Response.CacheControl = "no-cache" Response.AddHeader "Pragma", "no-cache" Response.Expires = -1 %> <% Page = Request ("Page") sTextKind = trim(Request ("sTextKind")) sText = trim(Request ("sText")) sFileN = "/jongha/notice_list.asp" sFileName = sFileN & "?sText=" & sText & "&sTextKind=" & sTextKind & "&" PageSize = 10 PageRange = 10 if Len (Page) = 0 then Page = 1 end if Set adoRs = Server.CreateObject("ADODB.Recordset") %> 종하
 
 
 
 

<% SQL = "SELECT COUNT(*) AS TOTAL FROM JONGHA_NOTICE" if len(sTextKind)>0 then SQL = SQL & " where " & sTextKind & " like '%" & sText & "%'" end if adoRs.Open SQL, adoCn, 1 totalcount = adoRs("total") adoRs.close If totalcount=0 then totalcount = "0" totalpage = "1" else totalpage = (int)((totalcount/PageSize)+0.9999) End If intTopCnt=(page-1)*PageSize SQL = "SELECT top "&PageSize&" * FROM JONGHA_NOTICE where PK not in(select top "&intTopCnt&" PK from JONGHA_NOTICE" if len(sTextKind)>0 then SQL = SQL & " where " & sTextKind & " like '%" & sText & "%'" end if SQL=SQL&" order by PK desc)" if len(sTextKind)>0 then SQL = SQL & " AND " & sTextKind & " like '%" & sText & "%'" end if SQL=SQL&" ORDER BY PK DESC" 'RESPONSE.WRITE SQL adoRs.Open SQL, adoCn, 1 If adoRs.BOF Or adoRs.EOF Then %> <% Else intNum=totalcount-PageSize*(page-1) Do Until adoRs.EOF pk = adoRs("pk") title = adoRs("title") writedate = adoRs("writedate") 'readcnt = adoRs("readcnt") If Len(title)>20 Then title=Left(title, 20)&"..." End If %> <% if intNum<>1 then %> <% end if adoRs.movenext intNum = intNum-1 Loop end if adoRs.close set adoRs = nothing %>
등록된 공지사항이 없습니다.
9 신재생 에너지 새 발전소 오픈 2007-05-28 75
1 2 3 4 5