<% table=Request("table") key=request("key") find=Request("find") page=Request("page") startpage=Request("startpage") Set dbCon = Server.CreateObject("ADODB.Connection") dbCon.Open("DSN=hanwed;UID=sa;PWD=") sql1 = "select Count(*) as tc from "&table&" where "&key&" Like '%"&find& "%'" Set Rs = dbCon.Execute(sql1) tc=cint(rs("tc")) if tc=0 then r="fault" elseif tc>0 then r="succ" end if %> <% if r="fault" then %>
<%if table="merry_bd" then%>°áÈ¥?¸»!¸»!¸»!<%elseif table="nohow_bd" then%>³ª¸¸ÀÇ ³ëÇÏ¿ì<%end if%> ¿¡ °Ë»ö³»¿ëÀÌ ¾ø½À´Ï´Ù
¸ñ·Ï¹öưÀ» ´©¸£½Ã¸é ¸ñ·ÏÀ¸·Î °¡½Ç¼ö ÀÖ½À´Ï´Ù

<% elseif r="succ" then %> <% Set DbCon=Server.CreateObject("ADODB.Connection") DbCon.Open("DSN=hanwed;UID=sa;PWD=") if Request("page")="" then curpage=1 page=1 else curpage=cint(Request("page")) end if if Request("startpage")="" then startpage=1 else startpage=cint(Request("startpage")) end if ipp=10 ten=10 Set DbRec=Server.CreateObject("ADODB.Recordset") DbRec.CursorType=1 DbRec.Open "select * from "&table&" where "&key&" Like '%"&find& "%' order by ref asc, step desc", DbCon DbRec.PageSize = 5 DbRec.MoveLast postcount=DbRec.Recordcount totpage=int(postcount/ipp) totpage=cint(totpage) if (totpage * ipp) = postcount then totpage=totpage For a=1 to (curpage-1) * ipp DbRec.MovePrevious Next elseif (totpage * ipp) <> postcount then totpage = totpage + 1 For a=1 to (curpage-1) * ipp DbRec.MovePrevious Next end if 'pg=Request("page") 'if isEmpty(pg) then ' pg = 1 'else ' pg = pg + 0 'end if 'if pg<1 then ' pg = 1 'end if Set DbCon=Server.CreateObject("ADODB.Connection") DbCon.Open("DSN=hanwed;UID=sa;PWD=") sql="SELECT Count(*) as totalcount FROM "&table&" where "&key&" Like '%"&find& "%'" Set rs=DbCon.Execute(sql) lastpg=1+Int((rs("totalcount")-1)/ipp) if pg > lastpg then pg=lastpg end if nextpg=curpage+1 prevpg=curpage-1 endpg=curpage*ipp startpg=endpg-ipp+1 %> <% RowCount = 0 for i=1 to ipp if totpage=curpage then value=postcount Mod ipp if i>value and value<>0 then Exit For end if end if if curpage=1 then p=0 else p=curpage-1 end if no=i+10*p %> <%if dbrec("ref") mod 2 =0 then%> <%elseif dbrec("ref") mod 2 = 1 then%> <%end if%> <% RowCount = RowCount + 1 DbRec.MovePrevious Next %>
°Ë »ö °á °ú
bbs_list.gif (551 bytes)
¹øÈ£ Á¦ ¸ñ Á¶È¸ ³¯Â¥ ±Û¾´ÀÌ
<%=no%> <% if dbrec("re_level") > 0 then %> <% wid = 4 * dbrec("re_level") %> <% end if %>&startpage=<%=startpage%>&page=<%=curpage%>"><%=dbrec("subject")%> <%=dbrec("visited")%> <%=dbrec("regdate")%> <%=dbrec("writer")%>
<%=no%> <% if dbrec("re_level") > 0 then %> <% wid = 4 * dbrec("re_level") %> <% end if %>&startpage=<%=startpage%>&page=<%=curpage%>"><%=dbrec("subject")%> <%=dbrec("visited")%> <%=dbrec("regdate")%> <%=dbrec("writer")%>



<% end if %>