<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!--#include file="Inc/SysProduct.asp" -->

<%
UserName=Session("UserName")
set rs = Server.CreateObject("ADODB.recordset")
sql="select * from User where UserName='"&UserName&"'"
rs.open sql,conn,1,1
%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title><%=SiteTitle%></title>
<link href="css/css.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="container">
  <!-- #include file="top.asp" -->
  <div class="content">
  <table border="0" cellpadding="0" cellspacing="0" width="920" style=" margin-left:6px;">
    <!-- fwtable fwsrc="未命名" fwbase="content.jpg" fwstyle="Dreamweaver" fwdocid = "2089954175" fwnested="0" -->
    <tr>
      <td><img src="images/spacer.gif" width="6" height="1" border="0" alt="" /></td>
      <td><img src="images/spacer.gif" width="908" height="1" border="0" alt="" /></td>
      <td><img src="images/spacer.gif" width="6" height="1" border="0" alt="" /></td>
      <td><img src="images/spacer.gif" width="1" height="1" border="0" alt="" /></td>
    </tr>
    <tr>
      <td colspan="3"><img name="content_r1_c1" src="images/content_r1_c1.jpg" width="920" height="6" border="0" id="content_r1_c1" alt="" /></td>
      <td><img src="images/spacer.gif" width="1" height="6" border="0" alt="" /></td>
    </tr>
    <tr>
      <td rowspan="5" background="images/content_r3_c1.jpg">&nbsp;</td>
      <td rowspan="5" bgcolor="fcfaf7" >
	  
	  <div class="mleft1">
	   <div class="slogin"><!-- #include file="login.asp" --></div>
	   <div class="comclass">
	     <div class="leftbar">
           <div class="left_title2">
             <div class="title_top">留言中心</div>
             <div class="title_middle">
               <ul>
                 <li><a href="Feedback.asp">留言反馈</a></li>
                 <li><a href="FeedbackView.asp">客户留言</a></li>
               </ul>
             </div>
           </div>
	       </div>
	   </div>
	  </div>
	  <div class="mright1">
	 
	  <div class="rtitle">留言中心</div>
	  <div class="rcontent">
	    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td>
                <%
set rs=server.createobject("adodb.recordset")
sql="select * from Feedback where Language='0' and Publish<>'1' order by id desc"
rs.open sql,conn,1,1

dim MaxPerPageFeedback
MaxPerPageFeedback=5

'取得页数,并判断留言输入的是否数字类型的数据，如不是将以第一页显示
dim text,checkpage
text="0123456789"
Rs.PageSize=MaxPerPageFeedback
for i=1 to len(request("page"))
checkpage=instr(1,text,mid(request("page"),i,1))
if checkpage=0 then
exit for
end if
next

If checkpage<>0 then
If NOT IsEmpty(request("page")) Then
CurrentPage=Cint(request("page"))
If CurrentPage < 1 Then CurrentPage = 1
If CurrentPage > Rs.PageCount Then CurrentPage = Rs.PageCount
Else
CurrentPage= 1
End If
If not Rs.eof Then Rs.AbsolutePage = CurrentPage end if
Else
CurrentPage=1
End if

call list

'显示帖子的子程序
Sub list()%>
                <%
If rs.eof and rs.bof then
  If rs.eof and rs.bof then
  response.write "<br>&nbsp;&nbsp;&nbsp;&nbsp;没有留言"
  exit Sub
End if
End if
%>
                <br />
                <%
i=0
do while not rs.eof
%>
                <table width="100%"  border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF" >
                  <tr bgcolor="#DFDFDF">
                    <td width="17%" height="22" align="right" bgcolor="#DFDFDF" > 主　题： </td>
                    <td colspan="5" bgcolor="#DFDFDF">&nbsp;
                        <%if rs("username")="管理员"then%>
                      [管理员公告]
                      <%end if%>
                      <%=rs("title")%></a></td>
                  </tr>
                  <tr bgcolor="#DFDFDF">
                    <td height="22" align="right" bgcolor="#EFEFEF" > 反馈内容： </td>
                    <td colspan="5" align="center" bgcolor="#EFEFEF" ><table width="97%"  border="0" cellpadding="0" cellspacing="0">
                        <tr>
                          <td height="4">&nbsp;</td>
                        </tr>
                        <tr>
                          <td height="40" ><%=rs("Content")%> </td>
                        </tr>
                        <tr>
                          <td height="4"></td>
                        </tr>
                    </table></td>
                  </tr>
                  <tr bgcolor="#EFEFEF">
                    <td height="22" align="right" > 留言者： </td>
                    <td width="22%" ><%=rs("Receiver")%> </td>
                    <td width="12%" align="right" >留言时间：</td>
                    <td width="17%" ><%=rs("Time")%></td>
                    <td width="12%" align="right" >回复时间：</td>
                    <td width="20%" ><%=rs("Retime")%> </td>
                  </tr>
                  <tr bgcolor="#DFDFDF">
                    <td height="22" align="right" bgcolor="#EFEFEF" > 管理员回复： </td>
                    <td colspan="5" align="center" bgcolor="#EFEFEF" ><table width="97%"  border="0" cellpadding="0" cellspacing="0" >
                        <tr>
                          <td height="4"></td>
                        </tr>
                        <tr>
                          <td height="40" ><%if rs("ReFeedback")=""then%>
                            [&quot;未回复&quot;]
                            <%else%>
                            <%=rs("ReFeedback")%>
                            <%end if%>
                          </td>
                        </tr>
                        <tr>
                          <td height="4"></td>
                        </tr>
                    </table></td>
                  </tr>
                  <tr valign="top" bgcolor="#F7F7F7">
                    <td height="12" colspan="6" ><img src="Images/Hrbackup.gif" width="96" height="10" /></td>
                  </tr>
                </table>
              <%
i=i+1
if i >= MaxPerPageFeedback then exit do
rs.movenext
loop
%>
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td><div align="right">
                        <%
Response.write "全部"
Response.write "共" & Cstr(Rs.RecordCount) & "条留言&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
Response.write "第" & Cstr(CurrentPage) &  "/" & Cstr(rs.pagecount) & "&nbsp;"
If currentpage > 1 Then
response.write "<a href='FeedbackView.asp?&page="+cstr(1)+"'>&nbsp;首页&nbsp;</a>"
Response.write "<a href='FeedbackView.asp?page="+Cstr(currentpage-1)+"'>&nbsp;上一页&nbsp;</a>"
Else
Response.write "&nbsp;上一页&nbsp;"
End if
If currentpage < Rs.PageCount Then
Response.write "<a href='FeedbackView.asp?page="+Cstr(currentPage+1)+"'>&nbsp;下一页&nbsp;</a>"
Response.write "<a href='FeedbackView.asp?page="+Cstr(Rs.PageCount)+"'>&nbsp;尾页&nbsp;</a>"
Else
Response.write ""
Response.write "&nbsp;下一页&nbsp;"
End if
Response.write "转到第"
response.write"<select name='sel_page' onChange='javascript:location=this.options[this.selectedIndex].value;'>"
    for i = 1 to Rs.PageCount
       if i = currentpage then 
          response.write"<option value='FeedbackView.asp?page="&i&"&id="&id&"' selected>"&i&"</option>"
       else
          response.write"<option value='FeedbackView.asp?page="&i&"&id="&id&"'>"&i&"</option>"
       end if
    next
response.write"</select>页"
%>
                    </div></td>
                  </tr>
                </table>
              <%end sub%>
            </td>
          </tr>
        </table>
	  </div>
	  </div>	  </td>
      <td rowspan="5" background="images/content_r5_c3.jpg">&nbsp;</td>
      <td><img src="images/spacer.gif" width="1" height="" border="0" alt="" /></td>
    </tr>
    <tr>
      <td><img src="images/spacer.gif" width="1" height="10" border="0" alt="" /></td>
    </tr>
    <tr>
      <td><img src="images/spacer.gif" width="1" height="9" border="0" alt="" /></td>
    </tr>
    <tr>
      <td><img src="images/spacer.gif" width="1" height="11" border="0" alt="" /></td>
    </tr>
    <tr>
      <td><img src="images/spacer.gif" width="1" height="197" border="0" alt="" /></td>
    </tr>
    <tr>
      <td colspan="3"><img name="content_r7_c1" src="images/content_r7_c1.jpg" width="920" height="10" border="0" id="content_r7_c1" alt="" /></td>
      <td><img src="images/spacer.gif" width="1" height="10" border="0" alt="" /></td>
    </tr>
  </table>
</div>
<%
rs.close
set rs=nothing
%>   
<div id="footer"><!-- #include file="foot.asp" --></div>
</div>
</body>
</html>
