<!--#INCLUDE FILE="conn.asp" -->
<%
PageTitile("留言薄首页")
response.cookies("online")="yes"
exec="Select * from guestbook order by ID desc"
set rs=server.createobject("adodb.recordset")
rs.open exec,conn,1,1
if rs.RecordCount=0 then
response.redirect "say.asp"
end if
rs.PageSize=PageSize
pagecount=rs.PageCount 
page=int(request.QueryString ("page"))
if page<=0 then page=1
if request.QueryString("page")="" then page=1
rs.AbsolutePage=page 
%>
<html>
<head>
<script>
function runEx(cod1)  {
 cod=document.all(cod1)
  var code=cod.value;
  if (code!=""){
  var newwin=window.open('','','');  
  newwin.opener = null 
  newwin.document.write(code);                                                              
  newwin.document.close();
}
}

</script>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>

<body bgcolor="#FFFFFF" text="#000000" topmargin="0" leftmargin="0" background="images/skin<%=skin%>/beijing.gif">
<div align="center">
<table width="766" height="661" border="0" cellpadding="0" cellspacing="1" bgcolor="#000000">
  <tr>
    <td width="99%" height="130" bgcolor="#FFFFFF"></td>
  </tr>
  <tr>
    <td width="99%" height="11" background="images/skin<%=skin%>/bg004.gif" bgcolor="#FFFFFF">
      <table border="0" width="100%" cellspacing="0" cellpadding="0" height="24">
        <tr>
          <td width="52%" height="24"></td>
          <td width="48%" height="24"><p align="center">&nbsp; 
            <%if session("user_id")="" then%><a href="../user/loginform.asp?url=../guestbook">管理登陆</a>
            <%else%><a href=../user/login.asp?online=quit>退出登陆</a>
            <%end if%>&nbsp;    
            |&nbsp; <a href="say.asp">我要留言</a>&nbsp;&nbsp;</td>   
        </tr>
      </table>
    </td>  
  </tr>
  <tr> 
    <td width="99%" height="19" align="left" bgcolor="#FFFFFF"></td>
  </tr>
  <tr> 
    <td width="99%" height="394" bgcolor="#FFFFFF"> 
      <table width="100%" border="0" cellspacing="0" cellpadding="0" background="images/skin<%=skin%>/bg.gif">
        <tr background="images/skin<%=skin%>/bg002.gif"> 
          <td width="3%" height="30" background="images/skin<%=skin%>/bg002.gif"> 
            <%
i = 0
total = 0
%>
            <%Scriptname=Request.Servervariables("script_name") %>
          </td>
          <td width="94%" align="center" height="30" background="images/skin<%=skin%>/bg002.gif"> 
            <%listpage%>
          </td>
          <td width="3%" height="30" background="images/skin<%=skin%>/bg002.gif" align="center">&nbsp;</td>
        </tr>
        <tr> 
          <td height="169" width="3%">&nbsp;</td>
          <td height="169" align="center" width="94%"> 
            <%totalsize=cint(rs.PageSize)%>
            <%
thecolors=colors1
do until rs.Eof or total = totalsize
%>
            <br>
            <table width="100%" height="90" border="0" cellpadding="3" cellspacing="1" bgcolor="#000000">
              <tr background="images/skin<%=skin%>/bg003.gif"> 
                <td width="21%" height="28" align="left"  background="images/skin<%=skin%>/bg003.gif" bgcolor="#FFFFFF">&nbsp;[<font color=red><%=rs("user_type")%></font>]<font color=red>
<%=rs("names")%></font></td>           
                <td width="79%" height="28" align="left"  background="images/skin<%=skin%>/bg003.gif" bgcolor="#FFFFFF"> 
                  <table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%">
                    <tr>
                      <td align="left" width="0%" height="21">&nbsp;&nbsp;</td>
                      <td align="left" width="62%" height="21"> 
<%
if rs("address")="None" then
response.write  "没说明来自何方的“"  
else
response.write "来自于“"
response.write rs("address")
response.write "”的“"
end if
response.write rs("names") 
if rs("sex")="男" then
response.write "”先生"  
else
response.write "”小姐"  
end if
%>
                      </td>
                      <td align="right" width="40%" height="21"> <font size=3><img src="<%=rs("userface")%>" align="absmiddle">&nbsp;</font>留言于：<font color="red"><%=rs("date")%></font> &nbsp; </td>           
                    </tr>
                  </table>
                </td>
              </tr>
              <tr> 
                <td width="21%" rowspan="2" align="center" valign="top" bgcolor=<%=colorimages%>>
<br>
<img src="<%=rs("face")%>" alt="<%=rs("names")%>">
<%if not rs("QQ")=0 then%><br>
<br><a target="_blank" href="http://wpa.qq.com/msgrd?V=1&Uin=<%=rs("QQ")%>&Site=幸运留言&Menu=yes"><img border="0" src="http://wpa.qq.com/pa?p=1:<%=rs("QQ")%>:7" alt="在线交流"></a><%end if%>
</td>
                <td width="79%" height="89" valign="top" bgcolor=<%=thecolors%>> 
                  &nbsp;&nbsp; 
                  <table width="100%" border="0" cellspacing="0" cellpadding="0" height="100">
                    <tr>
                      <td width="2%"></td>
                      <td width="96%"><table width="98%"><tr><td width=520 class=noword><%=txtToURL(rs("message"))%></td></tr></table>                      
                        <%if not rs("reply") ="None" then%>
                        <br>
                        <hr WIDTH="98%" size="1" color=<%=Colorline%> ALIGN="LEFT">
                        <img src="userface/icon10.gif">回复：<font color=red><%=txtToURL(rs("reply"))%></font><br><br>
                        <%end if%>
                      </td>
                    </tr>
                  </table>
                </td>
              </tr>
              <tr> 
                <td width="79%" height="2" align="right" background="images/skin<%=skin%>/bg003.gif" bgcolor="#FFFFFF"> 
                  <table width="0%" border="0" cellspacing="0" cellpadding="0">
                    <tr align="center"> 
                      <td width="30" height="25"> 
                        <div align="center">
                        <%if rs("Email")="None" or rs("Email")="@" then%><img src="images/skin<%=skin%>/email0.gif" width="16" height="16" border="0" alt="我现在还没有电子邮箱啊，您帮我申请个怎么样！"><%else%><a href="mailto:<%=rs("Email")%>"><img src="images/skin<%=skin%>/email.gif" width="16" height="16" border="0" alt="我的电子邮箱为<%=rs("Email")%>欢迎给我发信哦！"></a>
                        <%end if%></div>
                      </td>
                      <td width="30" height="25"> 
                        <div align="center">
                        <%if rs("homeurl")="None" or rs("homeurl")="http://" then%><img src="images/skin<%=skin%>/home0.gif" width="16" height="16" border="0" alt="我还没有主页呢！"><%else%><a href="<%=rs("HomeUrl")%>"><img src="images/skin<%=skin%>/home.gif" width="16" height="16" border="0" alt="我的主页是<%=rs("HomeUrl")%>"，欢迎您来做客啊！"></a>
                        <%end if%></div>
                      </td>
                      <td width="30" height="25"> 
                        <div align="center"> 
                          <%if rs("ip")="none" then%>
                          <img src="images/skin<%=skin%>/ip0.gif" border="0" alt="想查我IP没那么容易！"> 
                          <%else%>
                          <img src="images/skin<%=skin%>/ip.gif" width="13" height="15" alt="我的IP是:<%=rs("ip")%>,不要黑我啊！"> 
                          <%end if%>
                        </div>
                      </td>
                      <td width="30" height="25"> 
                        <div align="left">
                        <%if rs("QQ")="0" then%><img src="images/skin<%=skin%>/oicq0.gif" alt="我还没有OICQ号码呢！" width="16" height="16" border="0">
                        <%else%>
                        <a target=_blank href="http://friend.qq.com/cgi-bin/friend/user_show_info?ln=<%=rs("QQ")%>"><img src="images/skin<%=skin%>/oicq.gif" width="16" height="16" alt=我的OICQ号码为:<%=rs("QQ")%> border="0"></a>
                        <%end if%></div>
                      </td>
                      <%if session("user_type")="管理员" then%>
                      <td width="30" height="25"> 
                        <div align="center"><a href="reply.asp?id=<%=rs("ID")%>"><img src="images/skin<%=skin%>/reply.gif" width="16" height="16" border="0" alt="通过我可以帮您回复留言!"></a></div>
                      </td>
                      <td width="30" height="25"> 
                        <div align="center"><a href=# onclick=if(confirm("您确实要删除这条消息吗？")){window.location.href="delthis.asp?id=<%=rs("ID")%>"};><img src="images/skin<%=skin%>/recycle.gif" width="16" height="16" border="0" alt="我可以帮您删除这条留言!"></a></div>
                      </td>
                      <%end if%>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
            <br>
            <%   
rs.MoveNext             
i = i + 1
if thecolors=colors1 then
thecolors=overcolor
else
thecolors=outcolor
end if
if i = 2 then
 i = 0   
 end if
total = total + 1   
loop               
%>
          </td>
          <td height="169" width="3%">&nbsp;</td>
        </tr>
        <tr> 
          <td width="3%" height="27" background="images/skin<%=skin%>/bg001.gif">&nbsp;</td>
          <td width="94%" height="27" align="center" background="images/skin<%=skin%>/bg001.gif">
            <%listpage%>
            <br>
           </td>
          <td width="3%" height="27" background="images/skin<%=skin%>/bg001.gif">&nbsp;</td>
        </tr>
      </table>
    </td>
  </tr>
  <tr> 
    <td width="99%" height="72" align="center" bgcolor="#FFFFFF">
      <%guanggao%><a target="_blank" href="http://wpa.qq.com/msgrd?V=1&Uin=24211369&Site=幸运留言&Menu=yes"><img border="0" src="http://wpa.qq.com/pa?p=1:24211369:7" alt="给管理员留言"></a>
     </td>
  </tr>
</table>
</div>
</body>
</html>
<%
'分页函数
Function listpage
Totals=rs.RecordCount
pagelist=int(pagecount/showpage)      '求出一共要显示多少次才能显示出所有的页面
thispagelist= int((page-1)/showpage)  '申明一个变量来判断当前显示页面的ID
if page > 1  then
if thispagelist >0 then
Response.write "<a href='"&Scriptname&"?page=1'>[最前页]</a>"
end if
Response.write "<a href='"&Scriptname&"?page="&page-1&"'>[上一页]</a>"
end if
if pagelist>0 then
if thispagelist<pagelist+1 then
for n=1 to showpage
listid=thispagelist*showpage+n
if not listid>pagecount then
 if listid=page then
  Response.write "<a href='"&Scriptname&"?page="&listid&"'>[<font color=red>"&listid&"</font>]</a>"
 else
  Response.write "<a href='"&Scriptname&"?page="&listid&"'>["&listid&"]</a>"
 end if
end if
next
end if
else
for i=1 to pagecount
if i=page then
Response.write "<a href='"&Scriptname&"?page="&i&"'>[<font color=red>&nbsp;"&i&"&nbsp;</font>]</a>"
else
Response.write "<a href='"&Scriptname&"?page="&i&"'>[&nbsp;"&i&"&nbsp;]</a>"
end if
next
end if
if not page= pagecount then
Response.write "<a href='"&Scriptname&"?page="&page+1&"'>[下一页]</a>"
if not thispagelist=pagelist then
Response.write "<a href='"&Scriptname&"?page="&pagecount&"'>[最后页]</a>"
end if
end if
Response.write "&nbsp;第<font color=red>"&page&"</font>页,共<font color=red>"&pagecount&"</font>页"
if not page=pagecount then
Response.write "&nbsp;第<font color=red>"&(page-1)*PageSize+1&"</font>条到<font color=red>"&(page*PageSize)&"</font>条留言,共<font color=red>"&Totals&"</font>条留言"
else
Response.write "&nbsp;第<font color=red>"&(page-1)*PageSize+1&"</font>条到<font color=red>"&Totals&"</font>条留言,共<font color=red>"&Totals&"</font>条留言"
end if
END Function  
%>
<%
rs.Close
set rs=nothing   
conn.Close   
set conn = nothing 
%>