%
if session("login")="Y" then
else
Response.redirect("login.asp")
end if
%>
<%
SET rs2 = Server.CreateObject("ADODB.Recordset")
rs2.Open "Select * From Visiter " , conn,2,3
'------計數器-------
IF CSTR(RS2("thisday")) <> CSTR(DATE()) THEN ' 如果日期已過了一天
rs2("thisday") = DATE() ' 將日期改為今天
rs2("yesterdaycount") = rs2("todaycount") ' 將今日人數與昨日人數交換
rs2("todaycount") = 1 ' 重新計算今日登入人數
rs2.Update ' 儲存資料
END IF
rs2("todaycount")=rs2("todaycount")+1 '造訪人數加一
rs2("allcount")=rs2("allcount")+1
rs2.update
i_today = rs2("todaycount")
i_yesterday = rs2("yesterdaycount")
i_all = rs2("allcount")
%>
<%
set faqObj = Server.CreateObject("ADODB.Recordset")
kid = request("kid")
searchbox=trim(request("searchbox"))
faqstr = "select * from faq where online=1 "
if searchbox <>"" then
if kid = "1" then
faqstr = faqstr + " and (QuestionTitle like '%"+ searchbox+"%' or Answer like '%"+ searchbox+"%' )"
elseif kid = "2" then
faqstr = faqstr + " and QuestionTitle like '%"+ searchbox+"%' "
elseif kid = "3" then
faqstr = faqstr + " and Answer like '%"+ searchbox+"%' "
end if
end if
faqstr = faqstr + " order by questiondate desc"
faqObj.open faqstr,Conn, 3
QuestionID=0
QuestionTitle=1
QuestionBody=2
UserName=3
Email=4
Answer=5
Online=6
QuestionDate=7
If Not faqObj.EOF Then
'change page start-------------------------------------
if isEmpty(request("ToPage")) then
ToPage = 1
else
ToPage=Cint(request("ToPage")) 'get page
end if
faqObj.PageSize = 10
PageSize = 10
FirstPage = 1
LastPage = faqObj.PageCount
if ToPage > LastPage then ToPage = LastPage
if ToPage < FirstPage then ToPage = FirstPage
NextPage = ToPage + 1
PrevPage = ToPage - 1
NextFlag = 1
PrevFlag = 1
if NextPage > LastPage then NextFlag = 0 ' means no next page
if PrevPage = 0 then PrevFlag = 0 ' means no previous page
TotalRecCount = faqObj.RecordCount
RecS = ToPage * PageSize - (PageSize-1)
RecE = ToPage * PageSize
if RecS >= TotalRecCount then RecS = TotalRecCount
if RecE >= TotalRecCount then RecE = TotalRecCount
RecS = RecS - 1
RecE = RecE - 1
'change page end---------------------------------------
DataAry = faqObj.GetRows
NumRows = UBound(DataAry,2)
faqObj.Close
End if
%>
劉永森整形外科診所
|
|
 |
|
我要發問
|
| Page <%=ToPage%> of <%=LastPage%> | |
|
|
<%
'end if
'change page end---------------------------------------
%>
|
|
 |
<%
conn.close
set conn=nothing
%>
<% function xif(a,b,c)
if a then
xif=b
else
xif=c
end if
end function
%>