<!--#include file="../include/Conn.jsp"-->
<!--#include file="../Include/Char.jsp" -->
<!--#include file="../Include/ubbcode.jsp" -->
<!--#include file="Admin_IsLogin.jsp" -->

<%
'Delect Records
if request("action")="delete" then
  mSql = "DELETE FROM T_Gbook WHERE F_ID=" &Request.QueryString("DeleteID")
  conn.execute mSql
  Response.write "<script>location.replace('admin_Gbook.jsp?action=IsDelete&pageno="&Request.Querystring("pageno")&"')</script>"
end if
%>
<html>
<head>
<title>留言管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="Images/Style.css" rel="stylesheet" type="text/css">
<SCRIPT language="JavaScript">
function jDelete(url)
{
  if((confirm(" 警告:请确定是否删除,删除后不能恢复! "))==true) 
	self.location=url+'&action=delete';
}
</SCRIPT>

</head>
<body topmargin="0" leftmargin="0">

<%
	Set rs=Server.createobject("Adodb.RecordSet")
    pageno=request.querystring("pageno")
    pmcount=16  
    mSql="select * from T_Gbook order by F_ID desc"
	rs.open mSql,conn,1,1
	if rs.eof then
	   'response.write "<br><span align='center'><font color=666666><B>你好像还有发表第一篇呢！先来一篇吧.</B></font></p>"
    else
    rs.pagesize=pmcount
    mpage=rs.pagecount
    if pageno="" then pageno=1
    if  cint(pageno)<1 or cint(pageno)>mpage then  pageno=1
    rs.absolutepage=pageno
%>
      <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="FFFFFF">
        <tr> 
          <td width="36%" height="22"> &nbsp;共 <font color=red><strong> 
            <% = rs.recordcount%>
            </strong></font> 条记录 当前第 <font color=red><strong> 
            <% = Trim(pageno)%>
            </strong></font>页/共 <font color=red><strong> 
            <% = Trim(mpage)%>
            </strong></font>页 </td>
          <td width="64%" align="right"> 
            <%
if pageno>1 then
   response.write "<a href='admin_Gbook.jsp'> <img alt='首页' src='images/boqb02.gif' border=0 width='15' height='14'></a>"
else
   response.write "<img alt='首页' src='images/boqb02.gif' border=0 width='15' height='14'>"
end if

if pageno>1 then
   response.write "<a href='admin_Gbook.jsp?pageno="&pageno-1&"'><img alt='上一页' src='images/bob02.gif' border=0 width='15' height='14'></a>"
else
   response.write "<img alt='上一页' src='images/bob02.gif' border=0 width='15' height='14'>"
end if

add=5'数字分页个数+1
if pageno-int(add/2)<=1 then m=1 else m=pageno-int(add/2)
if m+add>mpage then 
   n=mpage
   if mpage-add<=1 then m=1 else m=mpage-add
else
   n=m+add
end if

for pno=m to n
 if pno=cint(pageno) then
   response.write "&nbsp;<font color=red>"&pno&"</font>"
 else
   response.write "<b>&nbsp;<a href='admin_Gbook.jsp?pageno="&pno&"'>"&pno&"</a></b>"
 end if
next
response.write "&nbsp"

if int(pageno) < int(rs.pagecount) then
  response.write "<a href='admin_Gbook.jsp?pageno="&pageno+1&"'><img alt='下一页' src='images/fbob02.gif' border=0 width='15' height='14'></a>"
else 
  response.write "<img alt='下一页' src='images/fbob02.gif' border=0 width='15' height='14'>"
end if

if int(pageno) < int(rs.pagecount) then
   response.write "<a href='admin_Gbook.jsp?pageno="&mpage&"'><img alt='末页' src='images/fboqb02.gif' border=0 width='15' height='14'></a>"
else
   response.write "<img alt='末页' src='images/fboqb02.gif' border=0 width='15' height='14'>"
end if
%>
          </td>
        </tr>
</table>
      <TABLE width=95% border=0 align="center" cellPadding=0 cellSpacing=0>
        <TBODY>
          <TR> 
            <TD width="100%" valign="top" bgColor=#dedfdf> <TABLE cellSpacing=1 cellPadding=4 width="100%" border=0>
                <TBODY>
                  <TR bgColor=#f8f8ff> 
                    <TD vAlign=center width="18%"><FONT color=#000000>留言者信息</FONT></TD>
                    <TD vAlign=center bgcolor="#f8f8ff"><FONT color=#000000>留言内容:</FONT></TD>
                  </TR>
<%				  
 Dim rc,re
 rc=rs.pagesize
 re=1
 do while not rs.eof and rc>0
 %>				  
				  
                  <TR bgColor=#ffffff> 
                    <TD width="18%" rowSpan=2 align="center" vAlign=middle><FONT 
            color=blue><B><%=rs("F_UserName")%></B></FONT> <TABLE cellSpacing=0 cellPadding=0 border=0>
                          <TBODY>
                            <TR> 
                              <TD align=middle></TD>
                            </TR>
                            
                          </TBODY>
                        </TABLE>
                   </TD>
                    <TD vAlign=top> <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
                        <TBODY>
                          <TR> 
                            <TD vAlign=top width=25> </TD>
                            <TD> <P align=left><FONT color=#0000ff>留言于: <%=rs("F_Addtime")%></FONT></P></TD>
                            <TD width="25%"> <P align=right>&nbsp;&nbsp; <IMG height=19 alt=QQ：<%=rs("F_QQ")%>         src="IMAGEs/oicq.gif" width=19 align=absMiddle 
                  border=0>&nbsp; <IMG height=15 alt=<%=rs("F_IPInfo")%>   src="IMAGEs/ip.gif" width=13 align=absMiddle 
                  border=0></P></TD>
                          </TR>
                        </TBODY>
                      </TABLE>
                      <HR>
                      <%=UBBCODE(rs("F_Content"),0)%>
					  <%if rs("F_ReplyContent") <> "" then%>
					  <BR> <HR SIZE=1> 
					  <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
                        <TBODY>
                          <TR> 
                            <TD width="95%"> <P align=left><FONT color=red>回复于: 
                                <%=rs("F_ReplyTime")%></FONT></P></TD>
                          </TR>
                          <TR> 
                            <TD vAlign=top width="5%"></TD>
                            <TD colSpan=2><%=UBBCODE(rs("F_ReplyContent"),0)%></TD>
                          </TR>
                        </TBODY>
                      </TABLE>
					  <%end if%>
					  
				    </TD>
                  <TR bgColor=#ffffff> 
                    <TD vAlign=bottom>&nbsp; <IMG height=16 alt=回复该留言 
            src="IMAGES/quote.gif" width=16 align=absMiddle 
            border=0> 
			<span style="cursor:hand" onClick="window.open('admin_GbookCallback.jsp?action=read&ID=<%=rs("F_ID")%>','test','height=345,width=488,top=25,left=280,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no, status=no')">
			回复
			</span>
			
			 <IMG height=16 alt=删除该留言 src="IMAGES/recycle.gif" 
            width=16 align=absMiddle border=0> <a href="javascript:jDelete('admin_Gbook.jsp?DeleteID=<%=rs("F_ID")%>&pageno=<%=cstr(pageno)%>')">删除</a></TD>
					
                  <%
rs.movenext
re=re+1
rc=rc-1
loop
end if
%>					
              </table></TD>
          </TR>
        </TBODY>
</TABLE>
      <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="FFFFFF">
        <tr> 
          <td width="40%" height="22"> 共 <font color=red><strong> 
            <% = rs.recordcount%>
            </strong></font> 条记录 当前第 <font color=red><strong> 
            <% = Trim(pageno)%>
            </strong></font>页/共 <font color=red><strong> 
            <% = Trim(mpage)%>
            </strong></font>页 </td>
          <td width="60%" align="right"> 
<%
if pageno>1 then
   response.write "<a href='admin_Gbook.jsp'> <img alt='首页' src='images/boqb02.gif' border=0 width='15' height='14'></a>"
else
   response.write "<img alt='首页' src='images/boqb02.gif' border=0 width='15' height='14'>"
end if

if pageno>1 then
   response.write "<a href='admin_Gbook.jsp?pageno="&pageno-1&"'><img alt='上一页' src='images/bob02.gif' border=0 width='15' height='14'></a>"
else
   response.write "<img alt='上一页' src='images/bob02.gif' border=0 width='15' height='14'>"
end if

add=5'数字分页个数+1
if pageno-int(add/2)<=1 then m=1 else m=pageno-int(add/2)
if m+add>mpage then 
   n=mpage
   if mpage-add<=1 then m=1 else m=mpage-add
else
   n=m+add
end if

for pno=m to n
 if pno=cint(pageno) then
   response.write "&nbsp;<font color=red>"&pno&"</font>"
 else
   response.write "<b>&nbsp;<a href='admin_Gbook.jsp?pageno="&pno&"'>"&pno&"</a></b>"
 end if
next
response.write "&nbsp"

if int(pageno) < int(rs.pagecount) then
  response.write "<a href='admin_Gbook.jsp?pageno="&pageno+1&"'><img alt='下一页' src='images/fbob02.gif' border=0 width='15' height='14'></a>"
else 
  response.write "<img alt='下一页' src='images/fbob02.gif' border=0 width='15' height='14'>"
end if

if int(pageno) < int(rs.pagecount) then
   response.write "<a href='admin_Gbook.jsp?pageno="&mpage&"'><img alt='末页' src='images/fboqb02.gif' border=0 width='15' height='14'></a>"
else
   response.write "<img alt='末页' src='images/fboqb02.gif' border=0 width='15' height='14'>"
end if
%>
          </td>
        </tr>
</table>
    </td>
    </tr>
  </table>
</body>
</html>
<%
rs.Close
CloseDatabase
%>
