<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<!--#include file="../head.asp"-->
  <!--#include file="../checkrole.asp"-->
 <%
     call checkuser("ly")
	 %>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<TABLE width=778 border=0 align="center" cellPadding=0 cellSpacing=0>
  <TBODY>
  <TR>
    <TD 
    style="BACKGROUND-POSITION: right 50%; BACKGROUND-IMAGE: url(i../mages/bg1.gif); BACKGROUND-REPEAT: repeat-y; BACKGROUND-COLOR: #ffffff" 
    vAlign=top align=middle>
      
      <TABLE cellSpacing=0 cellPadding=0 width=100% border=0>
        <TBODY>
        <TR>
              <TD width="14%"><IMG height=32 src="../images/myoutbox.gif" 
            border=0></TD>
              <TD width="86%" background="../images/info_bg.gif">&nbsp;</TD>
        </TR></TBODY></TABLE>
<%
if issession=0 then
gsid=Replace_Text(request.Cookies("Yxmemberid"))
else
gsid=session("id")
end if

sendcid=gsid
set rs=server.createobject("adodb.recordset") 

 sql="select Yixiang_getprice1.*,Yixiang_corporation.qymc from Yixiang_getprice1,Yixiang_corporation where Yixiang_getprice1.sendcid="&sendcid&" and Yixiang_corporation.id=Yixiang_getprice1.mycid  and  Yixiang_corporation.flag=1  order by Yixiang_getprice1.id desc"
rs.open sql,conn,1,1 
if rs.eof or rs.bof then 
response.write " <table border=1 cellpadding=0 cellspacing=2 bordercolor=#DCEDFC align=center width='100%' ><tr><td height=100 align=center><font color=red>对不起，你还没有给任何公司发留言!</font></td></tr></table> " 
else 
msg_per_page=10  
rs.pagesize=msg_per_page  

if not (rs.eof and rs.bof) then
	totalrec=RS.RecordCount 
	if rs.recordcount mod msg_per_page=0 then 
		n=rs.recordcount\msg_per_page 
	else
		n=rs.recordcount\msg_per_page+1                        
	end if                                                                
	currentpage=request("page") 
	If currentpage <> "" then
		currentpage =  cint(currentpage)
		if currentpage < 1 then  
			currentpage = 1
		end if  
		if err.number <> 0 then 
			err.clear
			currentpage=1
		end if
	else
		currentpage=1
	End if                                                                
	if currentpage*msg_per_page > totalrec and not((currentpage-1)*msg_per_page < totalrec)then 
		currentPage=1
	end if
	rs.absolutepage=currentpage 
	rowcount=rs.pagesize 
end if


if not isempty(request("selAnnounce")) then
idlist=request("selAnnounce")
if instr(idlist,",")>0 then
idArr=split(idlist)
for i = 0 to ubound(idarr)
id=cint(idarr(i))
call deleteannounce(id)
next
response.Redirect"sendmessagelist.asp?page="&currentpage&""
else
call deleteannounce(cint(idlist))
response.Redirect"sendmessagelist.asp?page="&currentpage&""
end if
end if 
%>

<Form name="form1" method="POST" action="">
          <TABLE width="100%" border="1" cellpadding="4" cellspacing="0" bordercolor="#111111" bordercolorlight="#D7EBFF" bordercolordark="#D7EBFF" style="border-collapse: collapse">
            <TBODY>
<TR height=25 bgcolor="#e8f4ff"> 
      <TD align="center"><font color="#CC3300"><b>状态</b></font></TD>
      <TD align="center"><font color="#CC3300"><b>标题</b></font></TD>
      <TD align="center"><font color="#CC3300"><b>发给</b></font></TD>
            <TD align="center"><font color="#CC3300"><b>时间</b></font></TD>

<TD width="40" align="center"><input type='submit' value='删除'></TD>
</TR>
<%do while not rs.eof and rowcount > 0%>
<TR height="20" bgcolor="#ffffff"> 
<TD width="63" align="center">
<%
if rs("sendFlag")=true then %>
        <font color="#666666">对方已读</font>
          <%else%>
        <font color="#FF0000">对方未读</font>
          <%end if%>
      </td>
<TD width="210" align="center"><a title="<%=rs("title")%>" href="readmessage1.asp?id=<%=rs("id")%>"><%=rs("title")%></a>　</td>
<TD width="171" align="center"><%=rs("qymc")%></td>
<TD width="64" align="center"><%=rs("datetime")%></td>


<TD width="40" align="center"><input type='checkbox' name='selAnnounce' value='<%=cstr(rs("ID"))%>'></td>
</TR>
<% 
rowcount=rowcount-1
rs.movenext
loop
%>
</TABLE>
          <TABLE width="100%" border="1" cellpadding="4" cellspacing="0" bordercolor="#111111" bordercolorlight="#D7EBFF" bordercolordark="#D7EBFF" style="border-collapse: collapse">
<TR height=25 bgcolor="#e8f4ff"> <td><%call listPages()%></td></tr></table>
<BR><BR>
</form>
<%end if%>
</TABLE>
<%
sub deleteannounce(id)
'dim rs,sql
sql="delete from [Yixiang_getprice1] where sendcid="&sendcid&" and id="&id&""
conn.execute sql
if err.Number<>0 then
err.clear
response.write "删 除 失 败 !<br>"
end if
End sub

sub listPages() 
   if not (rs.eof and rs.bof) then
	gopage=currentpage
	totalpage=n
	blockPage=Int((gopage-1)/10)*10+1
	if blockPage = 1 Then
		Response.Write "<span disabled>【←前10页</span>&nbsp;&nbsp;"
	Else
		Response.Write("<span disabled>【</span><a href=sendmessagelist.asp?page="&blockPage-10&">←前10页</a>&nbsp;&nbsp;")
	End If
   i=1
   Do Until i > 10 or blockPage > n
    If blockPage=int(gopage) Then
		Response.Write("<font color=#FF0000>[<b>"&blockPage&"</b>]</font>")
	Else
		Response.Write("<a href=sendmessagelist.asp?page="&blockPage&">["&blockPage&"]</a>")
    End If
    blockPage=blockPage+1
    i = i + 1
    Loop
	if blockPage > totalpage Then
		Response.Write "&nbsp;&nbsp;<span disabled>后10页→】"
	Else
		Response.Write("&nbsp;&nbsp;<a href=sendmessagelist.asp?page="&blockPage&">后10页→</a><span disabled>】")
	End If
		Response.Write("&nbsp;&nbsp;共"&n&"页 每页"&msg_per_page&"条记录 共"&totalrec&"条记录")
end if
end sub
 
rs.close
set rs=nothing
conn.close
set conn=nothing
%>