<!--#include virtual="inc/General.inc.asp"-->
<%
set rs = server.createobject("adodb.recordset")
p = request("p")
if cint("0"&p)<=1 then p="1"
pagesize = 8
strsql="select count(id) from Guest"
rs.open strsql,conn,1,1
totalcount = rs(0)
rs.cancel:rs.close
totalpage = totalcount \ pagesize
if totalcount mod pagesize > 0 then totalpage = totalpage+1
if cint("0"&p)>totalpage then p=totalpage
if cint("0"&p)<=1 then
strsql = "select top " & pagesize & " * from Guest order by id desc"
else
strsql = "select top " & pagesize & " * from Guest where id not in (select top " & ((cint("0"&p)-1)*pagesize) & " id from Guest order by id desc) order by id desc"
end if
%>
<HTML>

<HEAD>
<TITLE></TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
<link href="../css/info.css" rel="stylesheet" type="text/css">
<script language="javascript" src="../js/yzqm.js.asp"></script>
<script language="javascript">
function checkData(theform)
{
	if (theform.username.value=="")
	{
		alert("姓名不能为空！");
		theform.username.focus();
		return false;
	}
	else if (theform.comment.value=="")
	{
		alert("留言内容不能为空！");
		theform.comment.focus();
		return false;
	}
	return true;
}
</script>
</HEAD>

<BODY BGCOLOR=#600000 LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>
<table width="775" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><!--#include virtual="IncludeFile/Header.inc.html"--></td>
  </tr>
  <tr>
    <td><script language="javascript">ShowMenu("");</script></td>
  </tr>
  <tr>
    <td>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td width="5" bgcolor="9E0B0E">&nbsp;</td>
    <td><img src="../uppic/ad/guest.jpg"></td>
    <td width="5" bgcolor="9E0B0E">&nbsp;</td>
  </tr>
  <tr>
    <td height="1" bgcolor="9E0B0E"></td>
    <td bgcolor="9E0B0E"></td>
    <td bgcolor="9E0B0E"></td>
  </tr>
</table></td>
  </tr>
  <tr>
    <td>
	  <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
		<tr>
		  <td width="5" bgcolor="9E0B0E" rowspan="2"><img src="" width="5" height="0"></td>
		  <td width="175" nowrap bgcolor="F3DDC2" valign="top">
				  <table width="100%" border="0" cellspacing="0" cellpadding="0">
					<tr> 
					  <td height="22" background="/images/L_0.gif"><div align="center"></div></td>
					</tr>
				  </table></td>
		  <td width="100%" bgcolor="F8EDD1">
				  <table width="100%" border="0" cellspacing="0" cellpadding="0">
					<tr>
					  <td height="22" background="/images/bg.gif">
						<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
						  <tr>
							<td><strong><font color="#996600">留言簿</font></strong></td>
						  </tr>
						</table>
					  </td>
					</tr>
				  </table>
			<%
			rs.open strsql,conn,1,1
			rsindex=(cint("0"&p)-1)*pagesize%>
			<%while not rs.eof
			rsindex=rsindex+1%><br>
			<table width="95%" border="0" cellspacing="1" cellpadding="1" bgcolor="#600000" align="center">
			  <tr bgcolor="F3DDC2"> 
				<td width="20%" rowspan="3" align="center"><img src="/images/Header/<%=rs("HeadImage")%>"><br><br><b><%=rs("UserName")%></b></td>
				<td width="80%" align="right"><a href="mailto:<%=rs("title")%>" class=a><img src="/images/homepage.gif" border="0" target="_blank" align="absmiddle"> <a href="mailto:<%=rs("email")%>" class=a><img src="/images/email.gif" border="0" align="absmiddle"> <a href="#" onclick="alert('<%=rs("UserName")%>的OICQ号码是：<%=rs("oicq")%>')" class=a><img src="/images/oicq.gif" border="0" width="19" align="absmiddle">　&nbsp;</td>
			  </tr>
			  <tr bgcolor="F3DDC2">
				<td valign="top" style="padding-left:12;padding-top:6;line-height:150%" height="60"><%=AdjustString(rs("Comment"))%><br>&nbsp;　<font color="#333333"><%if rs("ReComment")&""<>"" then response.write "<font color=#FF0000>回复：" & AdjustString(rs("ReComment")&"")&"</font>" end if%></font></td>
			  </tr>
			  <tr bgcolor="F3DDC2">
				<td height="30" style="padding-left:12"><%=rs("UserName")%> 发表于 <%=year(cdate(rs("AddDateTime")))%>-<%=month(cdate(rs("AddDateTime")))%>-<%=day(cdate(rs("AddDateTime")))%>　<%=hour(cdate(rs("AddDateTime")))%>:<%=minute(cdate(rs("AddDateTime")))%>:<%=second(cdate(rs("AddDateTime")))%><!--　　IP：<%=left(rs("IPAddress")&"",instrrev(rs("IPAddress")&"","."))%>*--></td>
			  </tr>
			</table>
			<%rs.movenext
			wend%>
			<%if totalpage>1 then%>
			<br>
			<table width="95%" border="0" cellspacing="1" cellpadding="1" align="center">
			  <tr> 
				<td height="30" align="right"><%=PagerNumeric(cdbl("0"&p),cdbl(pagesize),cdbl(totalpage),cdbl(totalcount))%></td>
			  </tr>
			</table>
			<%end if%>
			<table width="95%" border="0" cellspacing="1" cellpadding="1" align="center">
			  <tr> 
				<td height="22"></td>
			  </tr>
			  <tr> 
				<td height="100%" valign="bottom">
				  <table width="100%" border="0" cellspacing="1" cellpadding="1" align="center" bgcolor="#600000">
					<tr> 
					  <td height="22" bgcolor="#F3DDC2" colspan="2">&nbsp;&nbsp;我要留言</td>
					</tr>
					<form name="guestform" method="post" action="saveguest.asp" onsubmit="return checkData(this)">
					<tr height="25" bgcolor="#F8EDD1"> 
					  <td width="50%">&nbsp;&nbsp;姓&nbsp;&nbsp;&nbsp;名：<input type="text" name="username" class="inbox" onchange="this.value=this.value.replace(/(^\s*)|(\s*$)|[\']/gi,'')"></td>
					  <td width="50%">&nbsp;&nbsp;头&nbsp;&nbsp;像：<select name="HeadImg" onchange="document.all.imghead.src='/images/Header/' + this.value;"><%for i=1 to 20%><option value="image<%=i%>.gif">image<%=i%></option><%next%></select> <img src="/images/Header/image1.gif" id="imghead" align="absmiddle" width="28"></td>
					</tr>
					<tr height="30" bgcolor="#F8EDD1"> 
					  <td>&nbsp;&nbsp;Email：<input type="text" name="email" class="inbox" onchange="this.value=this.value.replace(/(^\s*)|(\s*$)|[\']/gi,'')"></td>
					  <td>&nbsp;&nbsp;OICQ：<input type="text" name="oicq" class="inbox" onchange="this.value=this.value.replace(/\D/gi,'')"></td>
					</tr>
					<tr height="30" bgcolor="#F8EDD1"> 
					  <td colspan="2">&nbsp;&nbsp;主&nbsp;&nbsp;&nbsp;页：<input type="text" name="title" class="inbox" onchange="this.value=this.value.replace(/(^\s*)|(\s*$)|[\']/gi,'')" size="50"></td>
					</tr>
					<tr height="30" bgcolor="#F8EDD1"> 
					  <td colspan="2" align='center'><textarea name="comment" rows="5" style="width:90%" onchange="this.value=this.value.replace(/(^\s*)|(\s*$)|[\']/gi,'')"></textarea></td>
					</tr>
					<tr height="35" bgcolor="#F8EDD1"> 
					  <td colspan="2" align="center"><input type="submit" value=" 确定 " class="in3">　　　　<input type="reset" value=" 重置 " class="in3"></td>
					</tr>
					</form>
				  </table>
				</td>
			  </tr>
			</table>
			<br>
		  </td>
		  <td width="5" bgcolor="9E0B0E" rowspan="2"><img src="" width="5" height="0"></td>
        </tr>
	<tr>
	  <td colspan="3">
			<script language="javascript">ShowFooter();</script>
	  </td></tr>
	  </table>
	</td>
  </tr>
</table>
</BODY>
</HTML>
<%rs.close
set rs = nothing
CloseConnection()%>