<!--#include file="Connections.asp" -->
<%
Response.Expires=0
set GuestBook = Server.CreateObject("ADODB.Recordset")
GuestBook.ActiveConnection = datalink
GuestBook.Source = "SELECT * FROM Revert"
GuestBook.CursorType = 1
GuestBook.Open()
If Not GuestBook.Eof Then Revert_Count=GuestBook.recordcount
GuestBook.Close()

GuestBook.Source = "SELECT * FROM Message ORDER BY id DESC"
GuestBook.CursorType = 1
'Guestbook.CursorLocation = 3
GuestBook.PageSize=10
GuestBook.Open()
page=Request.QueryString("page")
If page="" Then page=1
If Not GuestBook.Eof Then GuestBook.AbsolutePage=page
Function rp(s)
s=s&"Check_Null_True_Flase"
s=Replace(s," ","")
s=Replace(s,"¡¡","")
s=Replace(s,"'","¡¯")
s=Replace(s,"<","£¼")
s=Replace(s,">","£¾")
s=Replace(s,"&","£¦")
s=Replace(s,"Check_Null_True_Flase","")
rp=s
End Function
While Not GuestBook.Eof And js<10
	js=js+1
	set revert = Server.CreateObject("ADODB.Recordset")
	revert.ActiveConnection = datalink
	revert.Source = "SELECT * FROM revert Where Message_id='"&GuestBook("id")&"'"
	revert.CursorType = 1
	revert.CursorLocation = 3
	revert.Open()
	If Not revert.Eof Then revert=revert.recordcount Else revert="0"
	revert=revert&"/"&GuestBook("js")
	Message="&id"&js&"="&GuestBook("id")
	Message=Message&"&textbox_title"&js&"="&(Page-1)*10+Js&"."&GuestBook("title")
	Message=Message&"&textbox_name"&js&"="&GuestBook("name")
	Message=Message&"&textbox_from"&js&"="&GuestBook("from")
	Message=Message&"&textbox_date"&js&"="&GuestBook("sdate")
	Message=Message&"&textbox_revert"&js&"="&revert
	Response.Write(Message)
	GuestBook.movenext()
Wend	
	Message="&allcount="&GuestBook.recordcount+Revert_Count&"Ìõ"
	Message=Message&"&titlecount="&GuestBook.recordcount&"Ìõ"
If GuestBook.recordcount>0 Then
	Message=Message&"&thispage="&Page
Else
	Message=Message&"&thispage=0"
End If
	Message=Message&"&allpage="&GuestBook.PageCount
	Message=Message&"&lookpage="&page
	Message=Message&"&load=complete"
	Message=Message&"&other="
	Response.Write(Message)
	GuestBook.close()

If Request.Cookies("display")="" Then
	set count = Server.CreateObject("ADODB.Recordset")
	count.ActiveConnection = datalink
	count.Source = "SELECT * FROM count Where rq=Cdate('"&date&"')"
	count.CursorType = 1
	count.CursorLocation = 2
	count.LockType = 3
	count.Open()
	If count.Eof Then
		count.AddNew
		count("rq")=date
	End If
	count("count")=count("count")+1
	count.Update
	Response.Cookies("display")=true
	count.close()
End If
%>