<!--#include file="../checkLogin.asp"-->
<!--#include file="../SQLconn.asp"-->
<!doctype html>
<html>
<head>
<title>已发邮件</title>
<head>

<link rel="stylesheet" type="text/css" href="../images/<%=request.cookies("imgdir")%>/css/style.css" media="all"/>
</head>
<body> 
<script src="../laydate/laydate.js"></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>
<table width="100%" height="495" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="27">
	<div class="header">
	<div class="nav">
        <ul>
            <li><a href="sendfile.asp">发送邮件</a></li>
			<li class="on">已发邮件</li>
            <li><a href="Received.asp">收邮件箱</a></li>
			<li><a href="caogao.asp">草稿件箱</a></li>
			<li><a href="lajixiang.asp">垃圾件箱</a></li>
        </ul>
    </div>	
	</td>
  </tr>
  <tr>
   <td height="400" valign="top"   class="NemuMainBox"><br>




<form id="form1" name="form1" method="post" action="Havesended.asp">	
		<%
		 tname=request.cookies("tname")
		
		 strdate1=request("date1")
		 strdate2=request("date2")
		 title=request("title")
		 
		 sendto=request("sendto")
		 
		 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 * from email  where  upDatetime BETWEEN '"&strdate1&"'  AND   '"&dateadd("d",1,strdate2)&"' AND Title like  '%"&title&"%'  AND Content like  '%"&guanjianci&"%'   and  sendto like  '%"&sendto&"%'   AND  upname ='"&tname&"' and isdel=0 and iscaogao=0 order by id desc"
		rs.open sql,conn,1,1
		%>
		
		<%
		rs.pagesize=12 '每页记录条数
		curpage=Request.QueryString("curpage") '将URL参数curpage传给curpage变量
		rs.absolutepage=curpage '将本页设为curpage设置的页数
		if curpage=0 then
		curpage=1
		end if 
		
		%>
		<table width="95%" border="1" align="center" cellpadding="3"   cellspacing="0"  bordercolor="#6D8DD8"  style="border-collapse:collapse" class="mtablehui">
          <tr style="background-color:#D6E4FF"  class="TableHeader">
            <td height="30" colspan="3" align="center" nowrap="nowrap" class="NemuNot"><table width="800" border="0" align="center" cellspacing="0">
              <tr>
                <td width="51" class="STYLE1"><div align="right"><span class="STYLE1 STYLE2">开始&nbsp;</span></div></td>
                <td width="93" class="STYLE1"><b><b>
                 <input name=date1  placeholder="请输入日期"  style="width:90px"  value=<%=strdate1%> class="laydate-icon" onClick="laydate()">
                </b></b></td>
                <td width="51" class="STYLE1"><div align="right"><span class="STYLE2">结束&nbsp;</span></div></td>
                <td width="93" class="STYLE1"><b><b>
                 <input name=date2  placeholder="请输入日期"  style="width:90px"  value=<%=strdate2%> class="laydate-icon" onClick="laydate()">
                </b></b></td>
                <td width="53" class="STYLE1"><div align="right"><span class="STYLE1 STYLE2">标题&nbsp;</span></div></td>
                <td width="70" class="STYLE1"><span class="STYLE2">
                  <input name="title" type="text" id="title" size="10" class="text"  value=<%=title%>>
                </span></td>
                <td width="64" class="STYLE1"><div align="right"><span class="STYLE2">关键词&nbsp;</span></div></td>
                <td width="77" class="STYLE1"><span class="STYLE2">
                  <input name="guanjianci" type="text" id="guanjianci" size="10" class="text"  value=<%=guanjianci%>>
                </span></td>
				<td width="63"   class="STYLE1"><div align="right"><span class="STYLE2">收件人&nbsp;</span></div></td>
          <td width="117" class="STYLE1"><span class="STYLE2">
               
			    <input name="sendto" type="text" id="sendto" size="10"  class="text" value=<%=sendto%>>
          </span></td>
                <td width="46" class="STYLE1 STYLE2"><input name="Submit" type="submit" class="topanniu" value="搜索" /></td>
              </tr>
            </table></td>
          </tr>
        </table>
  </FORM>
<FORM ACTION="deleteDuoHavesended.asp?ftype=<%=strftype%>&curpage=<%=curpage%>&guanjianci=<%=guanjianci%>&sendto=<%=sendto%>&title=<%=title%>&date1=<%=strdate1%>&date2=<%=strdate2%>" METHOD="post"  NAME="form2">
		<table width="95%" align="center" border="1" cellpadding="3"   cellspacing="0"  bordercolor="#6D8DD8"  style="border-collapse:collapse" class="mtable">   
		<tr style="background-color:#D6E4FF"  class="TableHeader">
		<td height="30"><div align="center" class="STYLE1">发件箱</div></td>
		<td><div align="center" class="STYLE1">阅览情况</div></td>
		<td><div align="center" class="STYLE1">收件人</div></td>
		<td><div align="center" class="STYLE1">操作</div></td>
		<td><div align="center" class="STYLE1">发送日期</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 width="650" height="30" class="STYLE1">
		&nbsp;
	  <input type="checkbox" name="checkbox" value=<%=rs("id")%>>&nbsp;
		
		<span class="STYLE3"><a href="viewHaveSend.asp?curpage=<%=curpage%>&id=<%=rs("id")%>"  target="_blank" class="STYLE1">
		<span class="STYLE1"><%=rs("title")%></span></td>
		<td width="200" class="STYLE1">&nbsp;
  <%
					
			Set rssee=Server.CreateObject("Adodb.Recordset")
			sqlsee="Select count(*) as zongshu,(Select count(*) as zongshu from emailsee where  fID='"&rs("id")& "'  and havesee='已经查阅') as yiyue   from emailsee where  fID='"&rs("id")& "'"
			rssee.open sqlsee,conn,1,1
			shuliang=rssee("zongshu")
			%>	
							
		<img src="../images/img/Email/bg.jpg" border="1" height="10" width="<%=FormatNumber(rssee("yiyue")/rssee("zongshu")*100,0)%>">
           <%=rssee("yiyue")%>/<%=rssee("zongshu")%>		
		 </td>
		 
		 <td width="330" class="STYLE1">  <%
					
			Set rssee=Server.CreateObject("Adodb.Recordset")
			sqlsee="Select   *   from emailsee where  fID='"&rs("id")& "'"
			rssee.open sqlsee,conn,1,1
				 
			%>	
			<%if shuliang<4 then
			for j= 1 to shuliang
			 %>			   
			 <a href="?sendto=<%=rssee("ShouName")%>" ><%=rssee("ShouName")%></a>&nbsp;
		   
		  <%  rssee.movenext
		    next%>
		   <%end if %>	
				
			          
		<%if shuliang>3 then
			for j= 1 to 3
			 %>			   
		    <a href="?sendto=<%=rssee("ShouName")%>" ><%=rssee("ShouName")%></a>&nbsp;
		  <%  rssee.movenext
		    next%>
			 …
		   <%end if %>	
		
		   
		 </td>
		 
		 
		 
		 
		
		 
		<td width="86" class="STYLE1">
		<div align="center"> <a href="delsend.asp?curpage=<%=curpage%>&id=<%=rs("id")%>&date1=<%=strdate1%>&date2=<%=strdate2%>&title=<%=title%>&guanjianci=<%=guanjianci%>&sendto=<%=sendto%>"   target="main" class="STYLE1"> 删除</a> </div></td>
		<td width="131" class="STYLE1"><div align="center" class="STYLEDATE"><span class="STYLE2"><%=formatdatetime(rs("upDatetime"),2)%></span></div></td> 
		</tr>
		<%  rs.movenext
		next%>
		<tr>
    <td height="28" colspan="5">
	
	<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" class="STYLE1">
		<span class="STYLE1">
		<%if curpage=1 then%>
		首页
		<%else%>
		<a href="?curpage=1&date1=<%=strdate1%>&date2=<%=strdate2%>&title=<%=title%>&guanjianci=<%=guanjianci%>&sendto=<%=sendto%>" >首页</a>
		<%end if%>
		
		<%if curpage=1 then%>
		上一页
		<%else%>
		<a href="?curpage=<%=curpage-1%>&date1=<%=strdate1%>&date2=<%=strdate2%>&title=<%=title%>&guanjianci=<%=guanjianci%>&sendto=<%=sendto%>" >上一页</a>
		<%end if%>
		
		<%if rs.pagecount<curpage+1 then%>
		下一页
		<%else%>
		<a href="?curpage=<%=curpage+1%>&date1=<%=strdate1%>&date2=<%=strdate2%>&title=<%=title%>&guanjianci=<%=guanjianci%>&sendto=<%=sendto%>" >下一页</a>
		<%end if%>
		
		<%if rs.pagecount<curpage+1 then%>
		尾页
		<%else%>
		<a href="?curpage=<%=rs.pagecount%>&date1=<%=strdate1%>&date2=<%=strdate2%>&title=<%=title%>&guanjianci=<%=guanjianci%>&sendto=<%=sendto%>" >尾页</a>
		<%end if%>
(当前第<%=curpage%>页，共有<%=rs.pagecount%>页，共有：<%=rs.recordcount%>条记录)</span></div>
</form>



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

</body>
</html>