<!--#include file="inc/conn.asp"-->
<!--#include file="inc/safe.asp"-->
<!--#include file="inc/config.asp"-->
<!--#include file="inc/const.asp"-->
<%
if MemberName="" then
  response.Redirect("userlogin.asp")
  response.end
end if
%>
<%
dim pmcount,pageno

Function verifyNews(idstr)
	sqld = "delete from sd_ly where id="& idstr
	conn.execute sqld
End Function

if request("action")="del" then	
	Dim strIdList,arrIdList,iId,i
	strIdList = Trim(Request("id"))
	If Not IsEmpty(strIdList) Then
		arrIdList = Split(strIdList,",")
		
		For i=0 To UBound(arrIdList)
			iId = clng(arrIdList(i))			
			Call verifyNews(iId)			
		Next	
		
		response.write "<script language=javascript>"
		response.write "alert('您所选定的留言信息已经成功删除！');window.location='guestbook.asp';"
		response.write "</script>"
	End If
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>红嫂视屏交友网</title>
<meta name="keywords" content="情感,在线,新新,照片,动感影片,诗歌,爱情,纯洁,心连心">
<meta name="description" content="红嫂视屏交友情缘 情感在线">
<link href="style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body {
	background-image: url();
}
.STYLE8 {
	color: #CC0099;
	font-size: 12px;
	font-weight: bold;
}
.STYLE31 {color: #666666; font-size: 12px;}
-->
</style>
<script language="JavaScript">
<!--
function verify(){
if (confirm("你确认要删除这些留言信息吗？")){
	document.frmly.submit();
	}
}

function SelectCheckBox()
{
	for(i=0;i<document.frmly.elements.length;i++)
	{
		if(document.all("selectCheck").checked == true)
		{
			document.frmly.elements[i].checked = true;					
		}
		else
		{
			document.frmly.elements[i].checked = false;
		}
	}
}
//-->
</script>
</head>
<body>
<table width="1002" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><!--#include file="top.asp"--></td>
  </tr>
</table>
<table width="950" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="204" height="328" valign="top"><!--#include file="memberleft.asp"--></td>
    <td width="583" valign="top"><table width="565" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td><TABLE width="100%" border=0 
            cellPadding=0 cellSpacing=0 bgColor=white class="STYLE4" >
              <TBODY>
                <TR>
                  <TD width="2%" align=center background="image/tiao_4.gif"><img src="image/tiao_3.gif" width="10" height="31"></TD>
                  <TD width="14%" align=center background="image/tiao_4.gif"><table width="52" height="25" border="0" cellpadding="0" cellspacing="0">
                      <tr>
                        <td width="52" align="center" class="pgd"><div align="left">收件箱</div></td>
                      </tr>
                  </table></TD>
                  <TD width="50%" height="20" align="center" background="image/tiao_4.gif">&nbsp;</TD>
                  <TD width="32%" align="center" background="image/tiao_4.gif">&nbsp;</TD>
                  <TD width="2%" align="center"><img src="image/tiao_2.gif" width="10" height="31"></TD>
                </TR>
              </TBODY>
          </TABLE></td>
        </tr>
        <tr>
          <td height="436" valign="top" style="border-left:#C7C8CC 1px solid;border-right:#C7C8CC 1px solid;border-bottom:#C7C8CC 1px solid"><br>
            <table width="540" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#9DCCF6" bordercolordark="#ffffff" class="STYLE31">
              <form name="frmly" action="guestbook.asp?action=del" method=post>
                <%
set rs=server.CreateObject("adodb.recordset")
sql="select id,title,addtime,postid,postname,isread from sd_ly where userid="& userid &" order by id desc"			
rs.open sql,conn,1,1
rcount=rs.recordcount

pmcount=20
rs.pagesize=pmcount   	'设置每页数
mpage=rs.pagecount    	'得到总页数
pageno=clng(request("pageno"))
	
if isempty(pageno) or cint(pageno)<1 or cint(pageno)>mpage then
	pageno=1
end if

if rs.bof and rs.eof then
	response.write "<tr><td height='300' vlign='top'><br><div align='center' style='style31'><p>你还没有留言信息！<br><br></p></div></td></tr>"
else
	rs.absolutepage=pageno	'将指针移至指定页的第一条记录
	loopno=pmcount	
%>
                <tr class="style30">
                  <td width="26" align="center" class="STYLE4">&nbsp;</td>
                  <td height="30" class="STYLE4"><div align="center" class="STYLE1">主题</div></td>
                  <td height="30" class="STYLE4"><div align="center" class="STYLE1">时间</div></td>
                  <td height="30" class="STYLE4"><div align="center" class="STYLE1">发信人</div></td>
                </tr>
                <%	do while not rs.eof and loopno>0%>
                <tr>
                  <td align="center" class="STYLE4"><input name='id' type='checkbox' id="id" value='<%=Trim(rs("id"))%>'></td>
                  <td width="275" height="30" class="STYLE4"><a href="show_mail.asp?id=<%=rs("id")%>" class="a1"><%=rs("title")%></a>
                      <%if rs("isread")=0 then response.Write "&nbsp;<img src='image/new2.gif'>"%></td>
                  <td width="117" class="STYLE4"><div align="center"><%=rs("addtime")%></div></td>
                  <td width="112" class="STYLE4"><div align="center">
                      <%response.Write "<a href=userinfo.asp?user_id="& rs("postid") &" target=_blank class=a1>"&rs("postname")&"</a>"
					if chkonline(rs("postid")) then response.Write "&nbsp;<font color='#FF0000'>正在线上！</font>"
					%>
                  </div></td>
                </tr>
                <%
rs.movenext
loopno=loopno-1
loop
%>
                <tr>
                  <td height="30" colspan="4"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="STYLE31">
                      <tr>
                        <td width="31%"><input name='selectCheck' type='checkbox' id=selectCheck onClick="SelectCheckBox()">
              全部选中
                <input name="delbtn" value="删除" type="button" class="st" onClick="verify();" /></td>
                        <td width="69%"><div align="right">跳到第
                                <input type=text size=2 name="pageno" value="<%=pageno%>" class="st">
                页
                <%if cint(pageno)>1 then%>
                [<a href='guestbook.asp?pageno=<%=pageno-1%>' class="a5">上一页</a>]
                <%end if
			if cint(pageno)<cint(mpage) then
			%>
                [<a href='guestbook.asp?pageno=<%=pageno+1%>' class="a5">下一页</a>]
                <%end if%>
                共<%=cstr(pageno)&"/"&cstr(mpage)&"页 "&cstr(rcount)%>条留言 </div></td>
                      </tr>
                  </table></td>
                </tr>
              </form>
              <%end if
 rs.close
 set rs=nothing
 conn.close
 set conn=nothing
 %>
            </table>
          </td>
        </tr>
    </table></td>
    <td width="163" valign="top"><!--#include file="fenlei.asp"--></td>
  </tr>
</table>
<table width="1002" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><!--#include file="root.asp"--></td>
  </tr>
</table>
</body>
</html>
