<% dim ptype,AllRec,Search_key dim SQL_count,rs_count,total_count,linecount cpage = request("cpage") ptype = request("ptype") citem = request("citem") cdata = request("cdata") if cpage="" then cpage=1 PageSize = 12 Blockpage = 10 dbCon_on '레코드카운트 구하기 시작====================================================================================== '(쿼리구문) SQL = "select count(*), CEILING(CAST(Count(*) AS FLOAT)/" & PageSize & ") from product_tb where ptype=" & ptype if len(cdata)<>0 then SQL = SQL & " and " & citem & " like '%" & cdata & "%';" end if set rs = objCon.execute(SQL) '(변수처리구문) Total_count = rs(0) '전체 레코드 갯수 Total_page = rs(1) '전체 페이지 수 rs.close set rs = nothing '레코드카운트 구하기 끝================================================================================== '레코드 구하기(필요한 레코드만큼만 rs에 담자)============================================================= '(쿼리구문) SQL = "select TOP " & PageSize & " p_idx_no,p_filename01,p_name " SQL = SQL & "from product_tb " SQL = SQL & "where ptype=" & ptype & " and " if len(cdata)<>0 then SQL = SQL & citem & " like '%" & cdata & "%' AND " end if SQL = SQL & "p_idx_no not in (" SQL = SQL & "select TOP " & ((cpage-1) * PageSize) & " p_idx_no from product_tb where ptype=" & ptype if len(cdata)<>0 then SQL = SQL & " and " & citem & " like '%" & cdata & "%' " end if SQL = SQL & "order by p_idx_no DESC) " SQL = SQL & "order by p_idx_no DESC;" set rs = objCon.execute(SQL) '(변수처리구문) if Rs.EOF or Rs.BOF Then ELse AllRec = RS.GetString(2) rows = split(AllRec,chr(13)) end if rs.close set rs = nothing '레코드 구하기 끝======================================================================================= dbCon_off %> <!--#include virtual="/include/title.asp"-->
 
   
<% dim xy_ary,row_ary,for_ary dim p_idx_no,p_filename01,p_name IF AllRec = "" or isnull(AllRec) Then %>
***등록된 제품이 없습니다.***
<% ELSE %> <% for xy_ary = 1 to PageSize row_ary = xy_ary - 1 'row값에 배열값 for_ary = (cpage-1)*PageSize+xy_ary '실제 레코드순서 값 if for_ary<=Total_count then cols = split(rows(row_ary),chr(9)) p_idx_no = cols(0) p_filename01 = cols(1) p_name = cols(2) else p_idx_no = "" p_filename01 = "" p_name = "" end if %> <% if xy_ary mod 4 = 0 then %>
<% if for_ary<=Total_count then %> <% end if %>
<% if p_filename01<>"" then %><% end if %>
<%=p_name%>
<% end if %> <% next %>
<% END IF %>
<% Dim intTemp, intLoop Response.Write "" %>
" intTemp = Int((cpage - 1) / BlockPage) * BlockPage + 1 ' 블럭 페이징 시작번호 계산 If intTemp = 1 Then Response.Write "" Else Response.Write"" End If Response.Write "" intLoop = 1 Do Until intLoop > BlockPage Or intTemp > Total_Page If intTemp = CInt(cpage) Then Response.Write "[" & intTemp &"]" Else Response.Write "[" & intTemp & "]" End If intTemp = intTemp + 1 intLoop = intLoop + 1 Loop Response.Write "" If intTemp > PageCount Then Response.Write "" Else Response.Write "" End If Response.Write "