<% '*****查詢留言***** '*******管理者密碼7698****** ADMIN=Request.Querystring("ADMIN") Pasttalk=Request.Querystring("Pasttalk") NOADMIN=Request.Querystring("noadmin") IF ADMIN="7698" then session("admin")="yes" ELSEIF ADMIN<>"" then Response.Write "對不起!密碼錯誤。" Response.END END IF IF Pasttalk="" Then Pasttalk=100 End IF If Pasttalk=1000 then SQL="SELECT*From talklist order by -1*留言時間 " ELSE Defdate=Dateadd("d",-Cint(Pasttalk),Date) SQL="SELECT*From talklist WHERE 留言日期>#"&Defdate&"# order by -1*留言時間 " END IF '*****離開管理模式***** IF NOADMIN ="yes" then session("admin")="no" END IF '*********************************************************************************** CurPage= 0 if Request.QueryString("Page")<>"" then CurPage = cint(Request.QueryString("Page")) if Request.QueryString("ToPage")<>"" then CurPage = cint(Request.QueryString("ToPage")) if CurPage <=0 then CurPage = 1 Set CN = Server.CreateObject("ADODB.Connection") CN.Open "Driver={Microsoft Access Driver (*.mdb)};DBQ="&Server.MapPath("../DB/talkdb.mdb") Set RS=Server.CreateObject("ADODB.Recordset") RS.Open SQL,CN,1,1,1 If RS.EOF THEN Response.Redirect "sorry.asp" ELSE '資料總數Count,頁數TotalPage Count=RS.RecordCount RS.PageSize=20 TotalPage=RS.PageCount RS.MoveFirst if CurPage > TotalPage then CurPage = TotalPage RS.Move (CurPage-1) * 20 %> ::: SHK針織帽工場 :::
我要留言

<%If session("admin")="yes" then %> <%ELSE %> 管理者密碼: <%END IF %>

<% for i=1 to TotalPage If i<>CurPage then Response.Write "" & i & "" else Response.Write ""&i&"" end if next %>

共<%=Count%>筆留言  每頁20筆 第 <% =CurPage %> 頁 / 共 <% =TotalPage %> 頁

<% i=0 Do While Not RS.EOF and i<20 i=i+1 '*******開啟回覆的資料表***** Set ReplyRS=Server.CreateObject("ADODB.Recordset") ReplySQL="SELECT*From reply WHERE Reply_ID='"&RS(0)&"' order by -1*Reply_Time " ReplyRS.Open ReplySQL,CN,1,1,1 %>
.gif" border="0"> <%=RS("你的大名")%> 【<% =RS("訪客職業") %>】 <%if InStr(RS("留言時間"),Date)=1 then%> <% end if %> <%Do While Not ReplyRS.EOF %> <% ReplyRs.MoveNext LOOP ReplyRS.Close %> <%if RS("站長回覆")<>"" then%> <% end if%> <% IF session("admin")<>"yes" then %> <% IF RS("留言性質") = "YES" THEN%> <%END IF%> <%Else%> <%END IF%>
<% IF RS("留言性質") = "YES" OR session("admin")="yes" THEN%> 留言主題:<%=RS("留言主題")%> <%ELSE%> 站長這是留給您的悄悄話... ^.* ...記得回我哦!! <%END if%>
<% IF RS("留言性質") = "YES" OR session("admin")="yes" THEN%> <%=RS("留言內容")%>
<%ELSE%>
<%end if%>
<% if len(TRIM(RS("MAIL帳號")))<>0 then %> "> 電子郵件 <% =RS(" border="0" width="14" height="10">   <% end if %> <% if len(TRIM(RS("訪客首頁")))<>0 then %> " target="_blank" > <%=RS(的首頁<% =RS("訪客首頁") %>" border="0">   <% end if %> <%If Len(Trim(RS("IP"))) <>0 then%> 【<%=RS("IP") %>】 <%end if %> 【<% =RS("留言時間") %>】
<% IF session("admin")="yes" then %> <%end if %>
" border=0> <%=ReplyRS("Reply_Name")%>【<%=ReplyRS("Reply_Job") %>】 <% if len(TRIM(ReplyRS("Reply_Email")))<>0 then %> "> 電子郵件 <% =ReplyRS(" border="0">   <% end if %> <% if len(TRIM(ReplyRS("Reply_Homepage")))<>0 then %> " target="_blank" > <%=ReplyRS(的首頁<% =ReplyRS("Reply_Homepage") %>" border="0"> <% end if %> <%If Len(Trim(ReplyRS("Reply_IP"))) <>0 then%> [<%=ReplyRS("Reply_IP") %>] <%end if %> 〔<%=ReplyRS("Reply_time")%>〕
<%=ReplyRS("Reply")%>
&ID=<%=ReplyRS("ID")%>>刪除

站長.....〔<%=RS("站長回覆時間")%>〕
<%=RS("站長回覆")%>

<% RS.MoveNext loop RS.Close CN.Close %>

<% if CurPage >= 2 then %> 上一頁

<% end if %>

<% if CurPage < TotalPage then %> 下一頁

<% end if %>

<% for i=1 to TotalPage If i<>CurPage then Response.Write "" & i & "" else Response.Write ""&i&"" end if next %>

共<%=Count%>筆留言  每頁20筆 第 <% =CurPage %> 頁 / 共 <% =TotalPage %> 頁

<%END IF %>