<% maxindex = 15 maxdisp = 20 curpage = request("page") If request("page") ="" then curpage=1 else curpage = clng(request("page")) end if If request("page") ="" then curpage=1 else curpage = clng(request("page")) end if errchk = "N" errmessage = "" faqsearch = FuncInString(request("faqsearch")) sql_select = " cast(boardnum as numeric) boardnum, boardtype, boardsubtype, displaytype, title, " & _ " subcontent, content, name, pw, replycount, " & _ " viewcount, islock, isdelete, createdate, updatedate, " & _ " titleimage, file1, file2, file3, url, " & _ " urltype,chknum,ipaddr " sql_from = " webzineboard " sql_where ="where boardtype='34' " &_ "and isdelete='N' " sql_orderby = "order by createdate desc " '****************************************************************************** '전체 데이터 수 확인 '****************************************************************************** sql_count = "select isnull(count(*),0) from "& sql_from &" " & sql_where set rs = Fdcon.execute(sql_count) if not(rs.eof or rs.bof) then list_count = clng(rs(0)) '처리 후 되돌아올 경우 대비 페이지 수 조정 ------------------------------------------------------ chknum = Fix(list_count / maxdisp) IF ( (list_count mod maxdisp) > 0 ) THEN ' 나머지가 있으면 page 총수 + 1 chknum = chknum + 1 END IF if chknum > 1 and chknum < curpage then curpage = curpage -1 end if'-------------------------------------------------------------------------------------------- else list_count = 0 curpage = 1 end if tempdb_name = SetSeqno("#") '****************************************************************************** '페이징을 위한 temp 디비 생성 '****************************************************************************** 'strsql = "if exists (select * from #aaa) drop table #aaa " strsql = "select top "& curpage * maxdisp &" IDENTITY(numeric,1,1) as idxnum, " strsql = strsql & sql_select strsql = strsql & " into "& tempdb_name &" from "& sql_from &" " strsql = strsql & sql_where strsql = strsql & sql_orderby Fdcon.execute(strsql) '****************************************************************************** '페이지 데이터 검색 '****************************************************************************** strsql = "SELECT " & sql_select & " from "& tempdb_name &" where idxnum >= "& ((curpage-1) * maxdisp)+1 &" " & sql_orderby & " ;" set rs = Fdcon.execute(strsql) if not(rs.eof or rs.bof) then arr_list = rs.getrows num_list = rs.recordcount '------------------------------------------------------------- '페이징 처리 시작 '------------------------------------------------------------- totcount = CLng(list_count) ' 현재 분류에 속한 모든 상품 갯수 pagecount = Fix(totcount / maxdisp) ' page 총수 = (총목록 수 / 한 페이지 최고 표시수) 의 정수부문만 저장 IF ( (totcount mod maxdisp) > 0 ) THEN ' 나머지가 있으면 page 총수 + 1 pagecount = pagecount + 1 END IF if list_count < maxdisp then count_to = (list_count mod maxdisp) -1 else if curpage = 1 then count_to = maxdisp -1 elseif curpage = pagecount then if list_count mod maxdisp = 0 then count_to = maxdisp -1 else count_to = (list_count mod maxdisp) -1 end if elseif curpage < pagecount then count_to = maxdisp - 1 end if end if '------------------------------------------------------------- '페이징 처리 끝 '------------------------------------------------------------- else num_list = 0 end if rs.close %>