<!--#include file="../check.asp"--><!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">
<head>
<title>商户后台 - 我的留言信箱</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link type="text/css" rel="stylesheet" href="/css/reset.css" />
<link type="text/css" rel="stylesheet" href="/css/main.css" />
<link type="text/css" rel="stylesheet" href="/css/template_vendor.css" />
<script type="text/javascript" src="/scripts/common.js"></script>
<script type="text/javascript" src="/scripts/nav.js"></script>
<script type="text/javascript" src="/scripts/footerdock.js"></script>
</head>
<body>
<!--#include file="top.asp"-->

<%
Nowpage=cint(request.QueryString("page"))



Action = Request("Action")

if Action="del" then

id=trim(YeSqlStr(request("id"),3))
set rss=server.CreateObject("adodb.recordset")
rss.open "select * from qq Where id='"&id&"' and msgToMerchantId="&Session("Usr_userid")&"",conn,1,3	  	
		  if not rss.eof then
			Rss.delete
			Rss.update
			Rss.close
			ErrStr="操作成功"
		  else
			ErrStr="操作失败"
		  end if
response.write "<script language='JavaScript'>{window.alert('"&ErrStr&"');window.location='"&Request.ServerVariables("HTTP_REFERER")&"';}</script>"

end if



if Action="delall" then

set rss=server.CreateObject("adodb.recordset")
rss.open "select * from qq Where msgToMerchantId="&Session("Usr_userid")&"",conn,1,3	  	
		  if not rss.eof then

	do while not rss.eof

	rss.delete
	rss.update
		rss.movenext
	Loop
	rss.close
			ErrStr="操作成功"
		  else
			ErrStr="操作失败"
		  end if
response.write "<script language='JavaScript'>{window.alert('"&ErrStr&"');window.location='"&Request.ServerVariables("HTTP_REFERER")&"';}</script>"

end if


%>

	<div id="mainborder">
		<div id="main">
			
		<h3 class="bigico bigico_book">我的留言信箱   <a onclick="javascript:return confirm('确定删除全部留言吗?');" href="MessageBox.asp?action=delall">删除全部留言</a></h3>
		<div class="vspace"></div>

		
		<div class="shrink">



            <%
			  	Set Rs=GrateRs("select  * from qq Where msgToMerchantId="&trim(Session("Usr_userid"))&" order by id desc",1)
				if rs.eof or rs.bof then
		%>


				
				<div>
					<span class="t3">没有符合条件的记录。</span>
					<div class="vspace"></div>
				</div>

		<%else
				Rs.PageSize=10
		   		If isnumeric(Nowpage) then
				 Nowpage=Nowpage
				 else
				 Nowpage=1
				 end if
				if Nowpage=0 then Nowpage=1
		   		Rs.AbsolutePage=Nowpage	
				pageC=Rs.PageCount
		for i= 1 to rs.pagesize
		if rs.eof then
		exit for
		end if

			  %>

					<div class="gridwrap" style="border-width:1px 4px 4px 1px; margin-bottom:12px">
						<table class="grid">
							<tr>
								<td style="padding:8px" colspan="2"><%=Rs("msgContent")%></td>
							</tr>
							<tr>
								<td style="padding:4px 8px; background: #f3f3f3;">
									<span class="small"><%=Rs("time")%></span><span class="gray simsun"> ┊ </span>
									<a onclick="javascript:return confirm('确定删除这条留言吗?');" href="MessageBox.asp?action=del&id=<%=Rs("id")%>">删除</a>
								</td>
								<td style="padding:4px 8px; background: #f3f3f3;" align="right">
									<span class='gray'>分类:</span> <%
			select case Rs("msgType")
			case 3
			 response.write("意见建议")
			case 1
			 response.write("充值失败")
			case 2
			 response.write("服务器故障")
			case 4
			 response.write("投诉抱怨")
			case 99
			 response.write("其它")
			case else
			 response.write("其它")
			end select
			%>
<span class='gray'>&nbsp;&nbsp;用户:</span> <%=Rs("msgSender")%>
<span class='gray'>&nbsp;&nbsp;QQ:</span> <%=Rs("msgQQ")%>
<span class='gray'>&nbsp;&nbsp;手机:</span> <%=Rs("msgCell")%>

								</td>
							</tr>
						</table>
					</div>




		

                                
 
          <%
	 Rs.movenext
next
	 %>

					

						<div class="vspace"></div>
					
				
				<div id="p" class="p_left">


	<div class="p_navigates">
      <%
		  
  myurl="?"
 response.write("共"&Rs.recordcount&"条记录，共"&Rs.PageCount&"页，"&Rs.PageSize&"条/页，第"&NowPage&"页&nbsp;")
   response.write("<a href='"&myurl&"page=1'>"&"首页</a>&nbsp;&nbsp;")
 if NowPage>1 then response.write("<a href='"&myurl&"page="&Nowpage-1&"'>上一页</a>&nbsp;&nbsp;")
 if int(NowPage)<int(pageC) then response.write("<a href='"&myurl&"page="&Nowpage+1&"'>下一页</a>&nbsp;&nbsp;")
 response.write("<a href='"&myurl&"page="&Rs.PageCount&"'>尾页</a>&nbsp;")
end if
		%>

</div><div class="clear"></div>
</div>
		</div>
	
		</div>
	</div>
</div>
</body>
</html>