%
pageLen=25
pageNo = request.QueryString("pageNo")
if pageNo="" then pageNo = 1
category = request.QueryString("category")
kword=request.QueryString("kword")
%>
:: webboard ::
<%
if category="" then category=0
if kword <> "" or cint(category) <> 0 then response.write "แสดงเฉพาะคำถาม"
if kword <> "" then
response.write("ที่มีคำว่า : " & kword & " ")
end if
if cint(category) <> 0 then
response.write("ในหมวด : ")
select case cint(category)
case 1 response.write " AutoLISP"
case 2 response.write " อินเทอร์เนทแชร์"
case 3 response.write " Direct Cable"
case 4 response.write " ASP"
end select
end if
Dim Conn
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" &_
Server.MapPath("/webboard/QAboard.mdb")&_
";uid=admin;password=demo"
Set RS =Server.CreateObject("ADODB.Recordset")
if category < 1 then
Sql="Select * from question where Qdetail like '%" _
& kword & "%' or topic like '%" & kword & _
"%' order by qNo desc"
Else
Sql="Select * from question where (Qdetail like '%" _
& kword & "%' or topic like '%" & kword &_
"%' ) and category=" & category & _
" order by qNo desc"
end if
RS.open Sql,Conn,1,3
Nrecord=RS.recordcount
rs.pageSize = pageLen
totalPage = rs.PageCount
if not rs.eof then rs.absolutePage = pageNo
%>
<%
recNo = 1
Do While Not RS.EOF and recNo <= pageLen
%>
<%= "Q" & right("0000" & RS("qNo"),5) %>
" target=_blank>
<%=RS("topic")%> - <%=RS("name")%> -
<%=day(RS("Date"))%>/<%=month(RS("Date"))%>/<%=right(year(RS("Date")),2)%> (คำตอบ <%=RS("answer")%>)
<%if session("adlevel")=1 then %>
">
" target=_blank>
<% end if %>
|
<%
RS.MoveNext
recNo=recNo+1
Loop
rs.close
conn.close
%>
จำนวน: <%=Nrecord%> ข้อความ, ขณะนี้อยู่หน้า
<%=pageNo%> ในทั้งหมด
<%=totalPage%> หน้า -
<%
if cint(pageno) > 1 then %>
[หน้าแรก]
[ย้อนกลับ]
<% end if
if cint(pageno) < totalPage then %>
[หน้าต่อไป]
[หน้าสุดท้าย]
<% end if
%> กระโดดไปหน้า |
<% for idx = 1 to totalPage
%><%=idx%>
<%
next %> |
|