<!--#include file="head.asp"-->
<%if session("nyeee_uid")="" then
response.redirect "login.asp"
end if

dim sql,rs
keyword=replace(trim(request.form("keyword")),"'","")
if keyword <>"" then
sql="select * from message where uid='"&session("nyeee_uid")&"' and ( messagename like '%" & keyword & "%' or  messagelxfs like '%" & keyword & "%' or messagetext like '%" & keyword & "%' ) order by id desc"
else
sql="select * from message where uid='"&session("nyeee_uid")&"' order by id desc"
end if
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1%>
      <table width="760" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="CAE2F8">
        <tr>
          <td bgcolor="#FFFFFF"><TABLE width=760 border=0 align="center" cellPadding=0 cellSpacing=0 bgcolor="CAE2F8">
              <TBODY>
                <TR bgcolor="CAE2F8">
                  <TD bgcolor="CAE2F8"><TABLE width=100% border=0 cellPadding=0 cellSpacing=0>
                      <TBODY>
                        <TR bgcolor="EFF7FE">
                          <TD width=23 vAlign=top><IMG alt=arrow 
src="images/arrow_01.gif"></TD>
                          <TD><a href="user.asp"><font color="#CC0000">会员中心</font></a> &gt;&gt; 查看留言信息</TD>
                          <TD align="right"><font color="#A2CCF2"><b>Www.Hacom.Cn</b></font></TD>
                        </TR>
                      </TBODY>
                  </TABLE></TD>
                </TR>
              </TBODY>
          </TABLE></tD>
        </tr>
        <tr>
          <td bgcolor="#FFFFFF"><div align="center"> <br>
                 <table border="0" width="100%"  cellspacing="0" cellpadding="0">
                   <tr>
                     <td width="100%"><div align="center">
                         <table border="0" width="750" bordercolorlight="#000000" bordercolordark="#FFFFFF" cellspacing="1" cellpadding="0" bgcolor="CAE2F8" style="word-break:break-all">
                           <tr bgcolor="EFF7FE">
                             <td width="30" align="center">编号</td>
                             <td width="80" align="center">留&nbsp; 言&nbsp; 人</td>
                             <td width="140" align="center">联系方式</td>
                             <td width="374"><p align="center">留言内容</td>
                             <td width="35" align="center">来源</td>
                             <td width="90"><p align="center">留言日期</td>
                           </tr>
                           <%if rs.eof or rs.bof then
response.write"<tr><td colspan='8' bgcolor='#ffffff'><p align='center'><font color='red'>暂无留言！</font></p></td></tr>"
else
const maxperpage=10
dim currentpage
rs.pagesize=maxperpage
currentpage=request.querystring("pageid")
if isnumeric(currentpage)=false then
response.write "<script>alert('参数错误，关闭窗口！');window.close();</script>"
response.end
end if
if currentpage="" then
currentpage=1
elseif currentpage<1 then
currentpage=1
else
currentpage=clng(currentpage)
	if currentpage > rs.pagecount then
	currentpage=rs.pagecount
	end if
end if

dim totalput,n
totalput=rs.recordcount
if totalput mod maxperpage=0 then
n=totalput\maxperpage
else
n=totalput\maxperpage+1
end if
if n=0 then
n=1
end if
rs.move(currentpage-1)*maxperpage
i=0
do while i< maxperpage and not rs.eof%>
                           <tr bgcolor="#FFFFFF">
                             <td><p align="center"><%=i+currentpage*maxperpage-maxperpage+1%></td>
                             <td valign="top"><%=rs("messagename")%> </td>
                             <td valign="top"><%=rs("messagelxfs")%></td>
                             <td valign="top"><%=rs("messagetext")%></td>
                             <td align="center" valign="top"><a href="show.asp?id=<%=rs("adid")%>" target="_blank">查看</a></td>
                             <td><p align="center"><font color="999999"><%=rs("messagedate")%></font></td>
                           </tr>
                           <%i=i+1                     
    rs.movenext                                                               
    loop    
    rs.close  
    set rs=nothing                                                                                     
    conn.close   
    set conn=nothing                                                                                        
    end if%>
                         </table>
                     </div></td>
                   </tr>
                 </table>
                 <table border="0" width="100%" cellspacing="0" cellpadding="0">
                   <tr>
                     <td height="30"><p align="center">页数：<%=currentpage%>/<%=n%>
                             <%k=currentpage                                                                                         
   	if k<>1 then%>
                             <a href="?pageid=1">首页</a> <a href="?pageid=<%=k-1%>">上一页</a>
                             <%else%>
        首页&nbsp;上一页
        <%end if%>
        <%if k<>n then%>
        <a href="?pageid=<%=k+1%>">下一页</a> <a href="?pageid=<%=n%>">尾页</a>
        <%else%>
        下一页&nbsp;尾页
        <%end if%>
        共有 <%=totalput%> 条广告</p></td>
                   </tr>
                   <tr>
                     <td><form action="" method="post" name="search">
                         <p align="center"><font style="font-size:14px">留言搜索：</font>
                             <input  maxLength="20" name="keyword" onfocus="this.value=''" size="18"  value="<%=keyword%>">
                             <input  type="submit" value="搜索" style="font-size: 12px" name="search">
                       </form></td>
                   </tr>
                 </table> 
            <br>
          </div></td>
        </tr>
      </table>
      <!--#include file="foot.asp"-->  