<!--#include file="../SQLconn.asp"-->
<link rel="stylesheet" type="text/css" href="../css/style.css" />
<form id="form1" name="form1" method="post" action="Received.asp">	
		<%
		 tname=request.cookies("tname")
		 author=request("author")
		 strdate1=request("date1")
		 strdate2=request("date2")
		 title=request("title")
		 guanjianci=request("guanjianci")
		 if strdate1="" then 
		   strdate1=date()-100
		 end if
		 if strdate2="" then 
		   strdate2=date()
		   end if
		   
   Set rs=Server.CreateObject("Adodb.Recordset")
   sql="SELECT  f.*, s.*   FROM email f INNER JOIN  emailsee s ON f.id = s.fid  where f.upDatetime BETWEEN '"&strdate1&"'  AND   '"&dateadd("d",1,strdate2)&"' AND f.Title like  '%"&title&"%'  AND f.Content like  '%"&guanjianci&"%' and  f.Author like  '%"&author&"%'  and  shouname ='"&tname&"' and s.isdel=0  order by f.id desc"
   rs.open sql,conn,1,1
%>

<%
   rs.pagesize=13 '每页记录条数
   curpage=Request.QueryString("curpage") '将URL参数curpage传给curpage变量
   rs.absolutepage=curpage '将本页设为curpage设置的页数
   if curpage=0 then
     curpage=1
   end if 
%>

<!--打开sendfile-->

<script>
function open_sendfile(NOTIFY_ID,FORMAT)
{
 URL="viewFile.asp?id="+NOTIFY_ID;
 myleft=(screen.availWidth-700)/2;
 mytop=150
 mywidth=800;
 myheight=500;
 if(FORMAT=="1")
 {
    myleft=0;
    mytop=0
    mywidth=screen.availWidth-10;
    myheight=screen.availHeight-40;
 }
 window.open(URL,"read_news","height="+myheight+",width="+mywidth+",status=1,toolbar=no,menubar=no,location=no,scrollbars=yes,top="+mytop+",left="+myleft+",resizable=yes");
}




</script>


<script language=javascript>


function unselectall(){
if(document.myform.chkAll.checked){
document.myform.chkAll.checked = document.myform.chkAll.checked&0;
}
}
function CheckAll(form){
for (var i=0;i<form.elements.length;i++){
var e = form.elements[i];
if (e.Name != 'chkAll'&&e.disabled==false)
e.checked = form.chkAll.checked;
}
}
</script>
<link rel="stylesheet" type="text/css" href="../css/style.css" />
<table width="95%" border="1" align="center" cellpadding="3"   cellspacing="0"  bordercolor="#6D8DD8"  class="mtablehui">
    <tr style="background-color:#D6E4FF"  class="TableHeader">
      <td height="30" colspan="3" align="center" nowrap="nowrap" class="NemuNot"><table width="696" border="0" align="center" cellspacing="0">
        <tr>
          <td width="35" nowrap="nowrap" class="STYLE1"><div align="right"><span class="STYLE1 STYLE2">开始&nbsp;</span></div></td>
          <td width="70" class="STYLE1"><b><b>
            <input name="date1" onclick="javascript:window.open('day.asp?form=form1&amp;field=date1&amp;oldDate='+this.value,'','directorys=no,toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,width=250,height=200,top=220,left=250');"  size="10" readonly="readonly"  value="<%=strdate1%>" />
          </b></b></td>
          <td width="35" class="STYLE1"><div align="right"><span class="STYLE2">结束&nbsp;</span></div></td>
          <td width="70" class="STYLE1"><b><b>
            <input name="date2" onclick="javascript:window.open('day.asp?form=form1&amp;field=date2&amp;oldDate='+this.value,'','directorys=no,toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,width=250,height=200,top=220,left=250');"  size="10" readonly="readonly"  value="<%=strdate2%>" />
          </b></b></td>
          <td width="35" class="STYLE1"><div align="right"><span class="STYLE1 STYLE2">标题&nbsp;</span></div></td>
          <td width="68" class="STYLE1"><span class="STYLE2">
            <input name="title" type="text" id="title" size="10" value="<%=title%>" />
          </span></td>
          <td width="45" class="STYLE1"><div align="right"><span class="STYLE2">关键词&nbsp;</span></div></td>
          <td width="78" class="STYLE1"><span class="STYLE2">
            <input name="guanjianci" type="text" id="guanjianci" size="10" value="<%=guanjianci%>" />
          </span></td>
          <td width="45"   class="STYLE1"><div align="right"><span class="STYLE2">发件人&nbsp;</span></div></td>
          <td width="92" class="STYLE1"><span class="STYLE2">
            <input name="author" type="text" id="author" value="<%=author%>" size="10" />
          </span></td>
          <td width="60" class="STYLE1 STYLE2"><input name="Submit" type="submit" class="topanniu" value="搜索" /></td>
        </tr>
      </table></td>
    </tr>
  </table>
</FORM>
<FORM ACTION="deleteDuoReceived.asp?author=<%=author%>&curpage=<%=curpage%>&guanjianci=<%=guanjianci%>&title=<%=title%>&date1=<%=strdate1%>&date2=<%=strdate2%>" METHOD="post"  NAME="form2">
  <table width="95%" align="center" border="1" cellpadding="3"   cellspacing="0"  bordercolor="#6D8DD8"  class="mtable">   
<tr style="background-color:#D6E4FF"  class="TableHeader">
    <td width="875" height="28" class="STYLE1"><div align="center">收件箱</div></td>
      <td><div align="center" class="STYLE1">操作</div></td>
      <td class="STYLE1"><div align="center">发送人</div></td>
      <td class="STYLE1"><div align="center">时间</div></td>
  </tr>
	<%
   for i= 1 to rs.pagesize
      if rs.eof then
         exit for
      end if
%>
    
    <tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#EFF8FF'">
      <td   height="28" class="STYLE1">&nbsp;
	  <input type="checkbox" name="checkbox" value=<%=rs("fid")%>>&nbsp;
    
                
                  <%if rs("Havesee")="未查阅" then  %>
                  <img src="../images/<%=request.cookies("imgdir")%>/gonggaoNew.gif" width="22" height="9"> 
				  
                  <%end if %>	  
     
	  <span class="STYLE3"><a href="javascript:open_sendfile(<%=rs("id")%>,'0');"><%=rs("title")%></td>
      <td width="170" nowrap="nowrap" class="STYLE1"><div align="center">
	 
	 
	  <%if rs("标星")="是"   then %>      
            <a href="bianxing.asp?yemian=filelist&id=<%=rs("id")%>&biaoxing=0&date1=<%=strdate1%>&date2=<%=strdate2%>&title=<%=title%>&guanjianci=<%=guanjianci%>&ftype=<%=strftype%>&curpage=<%=curpage%>&author=<%=author%>"><img src="../images/img/main/biaoxing1.jpg" width="16" height="16"  border="0">&nbsp;</a>
       <%  else %>
           <a href="bianxing.asp?yemian=filelist&id=<%=rs("id")%>&biaoxing=1&date1=<%=strdate1%>&date2=<%=strdate2%>&title=<%=title%>&guanjianci=<%=guanjianci%>&ftype=<%=strftype%>&curpage=<%=curpage%>&author=<%=author%>"><img src="../images/img/main/biaoxing0.jpg" width="16" height="16"  border="0">&nbsp;</a>
		   <%end if %>
	  
	  
	  
	  
	  <a href="sendfile.asp?sendtoname=<%=rs("author")%>"  target="main" class="STYLE1"> 回复</a> &nbsp;  
	  <a href="ZhuanFa.asp?curpage=<%=curpage%>&id=<%=rs("id")%>&date1=<%=strdate1%>&date2=<%=strdate2%>&title=<%=title%>&guanjianci=<%=guanjianci%>&author=<%=author%>" target="main" class="STYLE1"> 转发</a> &nbsp; 
	  <a href="delreceived.asp?curpage=<%=curpage%>&id=<%=rs("sid")%>&date1=<%=strdate1%>&date2=<%=strdate2%>&title=<%=title%>&guanjianci=<%=guanjianci%>&author=<%=author%>" target="main" class="STYLE1">删除</a> </div></td>
      <td width="70" class="STYLE1"><div align="center"><%=left(rs("author"),9)%></div></td>
      <td width="90" class="STYLE1"><div align="center"><span class="STYLEDATE"><%=formatdatetime(rs("upDatetime"),2)%></span></div></td> 
	</tr>
<%  rs.movenext
    next%>
	<tr>
    <td height="28" colspan="4">
	
	<span class="STYLE1">&nbsp;&nbsp;<input name='chkAll' type='checkbox' id='chkAll' onclick='CheckAll(this.form)' value='checkbox'>全选</span>&nbsp;&nbsp;&nbsp;&nbsp;
	<input name="Submit2" type="submit" class="topanniu" value="删除"></td>
  </tr>
	
</table>
 <br>
</div>
<div align="center">
  <span class="STYLE1">
  <%if curpage=1 then%>
首页
<%else%>
<a href="?curpage=1&date1=<%=strdate1%>&date2=<%=strdate2%>&title=<%=title%>&guanjianci=<%=guanjianci%>&author=<%=author%>">首页</a>
<%end if%>

<%if curpage=1 then%>
上一页
<%else%>
<a href="?curpage=<%=curpage-1%>&date1=<%=strdate1%>&date2=<%=strdate2%>&title=<%=title%>&guanjianci=<%=guanjianci%>&author=<%=author%>">上一页</a>
<%end if%>

<%if rs.pagecount<curpage+1 then%>
下一页
<%else%>
<a href="?curpage=<%=curpage+1%>&date1=<%=strdate1%>&date2=<%=strdate2%>&title=<%=title%>&guanjianci=<%=guanjianci%>&author=<%=author%>">下一页</a>
<%end if%>

<%if rs.pagecount<curpage+1 then%>
尾页
<%else%>
<a href="?curpage=<%=rs.pagecount%>&date1=<%=strdate1%>&date2=<%=strdate2%>&title=<%=title%>&guanjianci=<%=guanjianci%>&author=<%=author%>">尾页</a>
<%end if%>
(当前第<%=curpage%>页，共有<%=rs.pagecount%>页，共有：<%=rs.recordcount%>条记录)</span></div>
</form>

<p align="center"> 
		<input name="button" type="button" class="topanniu" onClick="location='../main_Email.asp';"  value="返回桌面" />
	 
</p>