<%
'商易仿淘宝4.0(多用户)
'ACCESS版演示网站：http://www.ftaobao.com(商易仿淘宝商城)
'SQL版演示网站：http://sql.ftaobao.com
'电话：0571-56907100
'QQ：1147100
%>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../include/css.css" type="text/css">
<%qx=4%>
<!--#include file="top.asp"-->
<!--#include file="check.asp"-->
<!--#include file="../include/conn.asp"-->
<%
Set rs = Server.CreateObject("ADODB.Recordset")
sql="Select * From guestbook Order By id DESC"
rs.open sql,conn,3,1 
if rs.eof then

%>
<br>    <table width="100%" border="0" align="center" cellpadding="4" cellspacing="1" class="tableborder">
<tr valign="middle">
  <td height="25" colspan="5" align="center" background="images/admin_bg_4.gif" bgcolor="#FFFFFF"><span class="White_txt"><strong>留言管理</strong></span></td>
  </tr>
<tr valign="middle"> 
      <td width="70" height="21" align="center" bgcolor="#FFFFFF">ID</td>
      <td width="230" height="21" align="center" bgcolor="#FFFFFF">留言人</td>
      <td width="130" height="21" align="center" bgcolor="#FFFFFF">留言时间</td>
      <td width="120" height="21" align="center" bgcolor="#FFFFFF">IP</td>
      <td width="50" height="21" align="center" bgcolor="#FFFFFF">删除</td>
  </tr>
    <tr><td bgcolor="#FFFFFF" height="21" align="center" colspan="5">暂时没有留言！</td></tr>
  </table>
<%
response.end
end if
rs.pagesize = 5
if request("page")=""  or isempty(request("page")) then
page = 1
else
page=int(request("page"))
end if
if page>rs.pagecount then
page=rs.pagecount
end if
if not rs.BOF then
Rs.Move Rs.PageSize*(page-1)
end if%><html>
<head> 
<title>留言管理</title>

<body bgcolor="#FFFFFF" text="#000000">
<br>
    <table width="100%" border="0" align="center" cellpadding="4" cellspacing="1" class="tableborder">
<tr valign="middle">
  <td height="25" colspan="5" align="center" background="images/admin_bg_4.gif" bgcolor="#FFFFFF"><span class="White_txt"><strong>留言管理</strong></span></td>
  </tr>
<tr valign="middle"> 
      <td width="70" height="21" align="center" bgcolor="#FFFFFF">ID</td>
      <td width="230" height="21" align="center" bgcolor="#FFFFFF">留言人</td>
      <td width="130" height="21" align="center" bgcolor="#FFFFFF">留言时间</td>
      <td width="120" height="21" align="center" bgcolor="#FFFFFF">IP</td>
      <td width="50" height="21" align="center" bgcolor="#FFFFFF">删除</td>
  </tr>

  
<%

i=1
do while not rs.eof and i<=rs.pagesize
%>
    <tr valign="middle"> 
      <td height="25" align="center" bgcolor="#FFFFFF"><font color="#FF0000">NO:<%=rs("id")%></font></td>
      <td height="25" bgcolor="#FFFFFF"><%=rs("name")%></td>
      <td height="25" align="center" bgcolor="#FFFFFF"><%=rs("sj")%></td>
      <td align="center" bgcolor="#FFFFFF"><font color="#666666"><%=rs("ip")%></font></td>
      
    <td height="25" align="center" bgcolor="#FFFFFF"> <a href="del.asp?del=a&id=<%=rs("id")%>&page=<%=page%>">删除</a></td>
    </tr>
    <tr valign="middle"> 
      <td colspan="5" bgcolor="#FFFFFF" style="WORD-WRAP: break-word"> <%=rs("content")%> <font color="#666666"> 
        <% if rs("tel")="" then Response.Write "" else Response.Write "<br>&nbsp;【联系电话】"&rs("tel")&"" %>
        <% if rs("email")="" then Response.Write "" else Response.Write "<br>&nbsp;【电子信箱】<a href=mailto:"&rs("email")&"?subject=留言回复>"&rs("email")&"</a>" %>
      </font></td>
    </tr>
<%
i=i+1
 rs.MoveNext                                              
 loop 
 '商易仿淘宝4.0.1演示地址
'http://www.ftaobao.com
%>
    
  <tr align="center" valign="middle"> 
    <form name=form method=get action=?> 
      <td height="25" colspan="5" bgcolor="#FFFFFF"> 
        <%
if rs.recordcount<>0 then
if page-1 mod 10=0 then
		p=(page-1) \ 10
	else
		p=(page-1) \ 10
	end if

	response.write "页次："& page &"/"& rs.pagecount &"页 每页"& rs.pagesize &" 共"& rs.recordcount &"条记录"&_
					" 分页："

	if p*10>0 then response.write "<a href='?page="&p*10&"' title=上十页>[&lt;&lt;]</a>   "
    uming_i=1
	for ii=p*10+1 to P*10+10
		   if ii=page then
	          response.write "<font color=#ff0000>["+Cstr(ii)+"]</font> "
		   else
		      response.write "<a href='?page="&ii&"'>["+Cstr(ii)+"]</a>   "
		   end if
		if ii=rs.pagecount then exit for
		 uming_i=uming_i+1
	next
	if ii<=rs.pagecount and uming_i=11 then response.write "<a href='?page="&ii&"' title=下十页>[&gt;&gt;]</a>   "
response.write(" 　跳页：<input type=text name=page size=2 maxlength=3 class=wenbenkuang> <input type=submit name=Submit value=Go class=go-wenbenkuang>")
end if
rs.close
set rs=nothing
conn.close
set conn=nothing%>      </td>
    </form>
  </tr>
    
  <tr valign="middle" bgcolor="#CCCCCC"> 
    <form name="del" method="post" action="del.asp?del=b">
      <td height="21" colspan="5" align="center" bgcolor="#FFFFFF"> 
        <script language=javascript>
function onlyNum()
{
  if(!((event.keyCode>=48&&event.keyCode<=57)||(event.keyCode>=96&&event.keyCode<=105)))
//考虑小键盘上的数字键
    event.returnValue=false;
}
</script>
        批量删除 
        <input name="sj" type="text" class="wenbenkuang" id="sj" size="5" maxlength="3" onKeyDown="onlyNum();">
      天以前留言
      <input name="2" type="submit" class="go-wenbenkuang" id="22" value="确定执行">
      &nbsp;&nbsp;&nbsp; 注:只能够输入数字</td>
    </form>
  </tr>
</table>
</body>
</html>
