draftbox.jsp
上传用户:liangcc
上传日期:2019-05-24
资源大小:4412k
文件大小:17k
源码类别:

WEB邮件程序

开发平台:

Java

  1. <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
  2. <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
  3. <html>
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  6. <title>收件箱</title>
  7. <script src="js/public.js" type="text/JavaScript"></script>
  8. <script language="JavaScript" src="include/CheckDataFunction.js" type="text/JavaScript"></script>
  9. <SCRIPT LANGUAGE=javascript>
  10.   <!--
  11.     var EmailID=0;
  12. function selectRow(id)
  13. {
  14. ListForm.cid.value=id;
  15. }
  16. function selectAll(obj,value)
  17. {
  18. if(obj.length==undefined)
  19. {
  20. obj.checked=value;
  21. }
  22. for(var i=0;i<obj.length;i++)
  23. obj[i].checked=value;
  24. }
  25. function getId(){
  26. var str="";
  27. var obj=document.getElementsByName("cids");
  28. for(var i = 0;i<obj.length;i++){
  29.  if(obj[i].checked){
  30.    str+=obj[i].value+":";
  31.  }
  32. }
  33. window.location.href="DraftboxDeleteServlet?str="+str;
  34. }
  35. function doDel()
  36. {
  37. var str="";
  38. var obj=document.getElementsByName("cids");
  39. for(var i=0;i<obj.length;i++){
  40. if(obj[i].checked){
  41. str+=obj[i].value+":";
  42. }else if(str==""){
  43. str=":";
  44. }
  45. }
  46. if((str!=":")){
  47. if(confirm('邮件将不可恢复,是否真的要永久删除此邮件?'))
  48. window.location.href="DraftboxDeleteServlet?str="+str;
  49. }else{
  50. alert("请选择要删除的内容!");
  51. }
  52. }
  53. function doMove()
  54. {
  55. var ids="";
  56. var obj=ListForm.cids;
  57. for(var i=0;i<obj.length;i++)
  58. if(obj[i].checked)ids+=obj[i].value+",";
  59. if(ids=="")ids=ListForm.cid.value+",";
  60. ListForm.mulitCid.value=ids;
  61. if(ids==",")
  62. {
  63. alert("请选择要移动的邮件!");
  64. return false;
  65. }
  66. ListForm.easyJWebCommand.value="move";
  67. ListForm.cid.value=ids;
  68. ListForm.submit();
  69. }
  70. function doReply()
  71. {
  72.     if(ListForm.cid.value==""){
  73. alert("请选择要回复的邮件!");
  74. return ;
  75. }
  76. //alert(ListForm.cid.value);
  77.     ListForm.easyJWebCommand.value="reply";
  78. ListForm.submit();
  79. }
  80. function doEdit()
  81. {
  82.     if(ListForm.cid.value==""){
  83. alert("请选择要修改的邮件!");
  84. return ;
  85. }
  86. //alert(ListForm.cid.value);
  87.     ListForm.easyJWebCommand.value="edit";
  88. ListForm.submit();
  89. }
  90. function doForward()
  91. {
  92.     if(ListForm.cid.value==""){
  93. alert("请选择转发的邮件!");
  94. return ;
  95. }
  96. //alert(ListForm.cid.value);
  97.     ListForm.easyJWebCommand.value="forward";
  98. ListForm.submit();
  99. }
  100. function doReplyAll(id)
  101. {
  102.  if(ListForm.cid.value==""){
  103. alert("请选择要回复的邮件!");
  104. return ;
  105. }
  106.     ListForm.easyJWebCommand.value="replyAll";
  107. //ListForm.cid.value=id;
  108. ListForm.submit();
  109. }
  110. function doMoveToDel()
  111. {
  112. var str="";
  113. var obj=document.getElementsByName("cids");
  114. for(var i=0;i<obj.length;i++){
  115. if(obj[i].checked){
  116. str+=obj[i].value+":";
  117. }
  118. else if(str==""){
  119. str=":";
  120. }
  121. }
  122. if(str!=":"){
  123. if(confirm('邮件删除操作将把邮件移到垃圾箱,是否执行该操作?'))
  124. window.location.href="DeleteDraftServlet?str="+str;
  125. }else{
  126. alert("请选择要删除的内容!");
  127. }
  128. }
  129. function show(id)
  130. {
  131. ListForm.cid.value=id;
  132. ListForm.easyJWebCommand.value="show";
  133. //ListForm.target="_blank";
  134. ListForm.submit();
  135. //ListForm.target="_self";
  136. }
  137. function gotoPage(n)
  138. {
  139. ListForm.page.value=n;
  140. ListForm.submit();
  141. }
  142. function ChangeNoEx()
  143. {
  144.     if(!CheckPositiveInt(form1.txtPageNo,"请输入一个正整数!",false))
  145.     return false;    
  146.     ChangePageNo(form1.txtPageNo.value);
  147. }
  148. //=================
  149. function setMailID(id)
  150. {
  151.   if(event.ctrlKey)
  152.   {
  153.     EmailID=id;
  154.     if(form1.msgID.value !='')
  155.       form1.msgID.value+=','+id;
  156.     else
  157.       form1.msgID.value=id;
  158.   }
  159.   else
  160.   {
  161.     EmailID=id;
  162.     form1.msgID.value=id;
  163.   }
  164. }
  165. //================
  166. //排序
  167. function doSort(fld)
  168. {
  169. if(ListForm.field.value==fld){
  170. if(ListForm.orderType.value=='asc')
  171. ListForm.orderType.value='desc';
  172. else
  173. ListForm.orderType.value='asc';
  174. }
  175. ListForm.field.value=fld;
  176. ListForm.method="post";
  177.     ListForm.submit();
  178. }
  179. //document.onselectstart =function () {return false;}
  180. function Exec_Click(n){
  181.   var SelectedId = '';
  182.   var arrUsers = temp;
  183.   var i = 0 ;
  184.    if(form1.delid.value=='')// &&SelectedId == '')
  185. {
  186. alert('请先选择邮件!') ;
  187. return ;
  188. }
  189. SelectedId = form1.delid.value;
  190. if(SelectedId.indexOf(",")==0)
  191. SelectedId = SelectedId.substring(1);
  192. form1.delid.value = "";
  193. //alert(SelectedId)
  194. //  }
  195.   switch(n){
  196.     case 0://移动到垃圾箱
  197.       //form1.Actions.value=0;
  198.       form1.msgID.value=SelectedId;
  199.       form1.action='del1.jsp';
  200.       form1.submit();
  201.       break;
  202.     case 1://彻底删除
  203.       if(confirm('邮件将不可恢复,是否真的要永久删除此邮件?')){
  204.         //form1.Actions.value=1;
  205.         form1.msgID.value=SelectedId;
  206.         form1.action='del.jsp';
  207.         form1.submit();
  208.       }
  209.       break;   
  210.     case 2://查看邮件内容
  211.     case 3://回复邮件
  212.     case 4://转发邮件
  213.       if(SelectedId.indexOf(',') == -1){
  214.         switch(n){
  215.           case 2://查看邮件内容
  216.             var urls='ShowMail.jsp?id='+SelectedId+'&uls=0';
  217.             OpenWin(urls,'ShowMail',700,450);
  218.             break;
  219.           case 3://回复邮件
  220.             self.location='replyForm.jsp?actions=RE&id='+SelectedId+"&uri=inbox";
  221.             break;
  222.           case 4://转发邮件
  223.             self.location='replyForm.jsp?actions=FWD&id='+SelectedId+"&uri=inbox";
  224.             break;
  225.         }
  226.       }
  227.       else{
  228.         alert('一次只能选择一个邮件!') ;
  229.         return ;
  230.       }
  231.       break;
  232.       case 5://移动邮件
  233.   form1.Tombx.value=document.all('lstFolderList').value;
  234.   form1.msgID.value=SelectedId;
  235.   form1.action='MoveToMailBox.jsp';
  236.   form1.method='post';
  237.   form1.submit();
  238.   break;   
  239. }
  240. }
  241. function check(obj)
  242. {
  243. var slt = form1.delid.value;
  244. if(obj.checked==true)
  245. {
  246. if(slt.indexOf(obj.value+",")<0)slt = slt+","+obj.value;
  247. }
  248. else
  249. {
  250. if(slt.indexOf(","+obj.value)>=0)slt = slt.replace(","+obj.value,"");
  251. }
  252. form1.delid.value = slt;
  253. //alert(form1.delid.value);
  254. }
  255. function checkAll(obj,value)
  256. {
  257. for(var i=0;i<obj.length;i++)
  258. {
  259. if(value=="1")
  260. {
  261. if(obj[i].checked==false)obj[i].click();
  262. }
  263. else
  264. {
  265. if(obj[i].checked==true)obj[i].click();
  266. }
  267. }
  268. }
  269. function ck(obj)
  270. {
  271. if(obj==undefined)return;
  272. if(form1.delall.checked)
  273. {
  274. form1.delall.value = "1";
  275. checkAll(obj,'1');
  276. //alert(form1.delid.value);
  277. }
  278. else
  279. {
  280. form1.delall.value = "0";
  281. checkAll(obj,'0');
  282. //alert(form1.delid.value);
  283. }
  284. }
  285. //-->
  286. </SCRIPT>
  287. <link href="css/css.css" rel="stylesheet" type="text/css">
  288. </head>
  289. <body bgcolor="#F2F1F2" leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0" scroll="no" background="images/login_bg.gif">
  290. <table width="100%" height="5%"  border="0" cellpadding="0" cellspacing="0">
  291.   <tr>
  292.     <td width="11" height="11"></td>
  293.     <td ></td>
  294.   </tr>
  295. </table>
  296. <table width="100%" height="95%"  border="0" cellpadding="0" cellspacing="0" bgcolor="ECF4F5">
  297.   <FORM id='ListForm' name="ListForm" METHOD='POST' ACTION='ManageDraftServlet'>
  298. <input type="hidden" name="box" value="draftbox">
  299. <input type="hidden" name="easyJWebCommand" value="list">
  300. <input type="hidden" name="subCommand" value="">
  301. <input type="hidden" name="cid"   value="">
  302. <input type="hidden" name="mulitCid"   value="">
  303. <input type="hidden" name="page"   value="1">
  304. <input name="field" type="hidden" value="">
  305.        <input name="orderType" type="hidden" value="">
  306. <tr>
  307.           <td height="20" align="center"><table height="20">
  308.               <tr>               
  309.                 <td nowrap class='coolbutton' onClick='doReply()' style="cursor:hand"><img src='images/replytogroup.gif' width='20' height='18' border='0' align='absmiddle'>回复</td>
  310.                 <td nowrap class='coolbutton' onClick='doForward()' style="cursor:hand"><img src='images/forward.gif' width='20' height='18' border='0' align='absmiddle'>转发</td>
  311.                 <td align="center" nowrap class='coolbutton' onClick="doEdit()" style="cursor:hand"><img src='images/pm.gif' width='20' height='18' border='0' align='absmiddle'> 修改 </td>                  <td align="center" nowrap class='coolbutton' onClick='doMove();' style="cursor:hand">转移到
  312. <img src='images/right.gif' width='9' height='13' border='0' align='absmiddle'>
  313. </td>
  314. <td nowrap>
  315. <select name='newBox'>
  316. <option value='recbox'>收件箱</option>
  317. <option value='drafts'>草稿箱</option>
  318. <option value='sendbox'>发件箱</option>
  319. <option value='laji'>垃圾箱</option>
  320. </select>  
  321. </td>
  322.                 <td align="center" nowrap class='coolbutton' onClick='doDel()' style="cursor:hand"><img src='images/delete2.gif' width='20' height='18' border='0' align='absmiddle'>永久删除 </td>
  323.                 <td nowrap class='coolbutton' onClick='doMoveToDel()' style="cursor:hand"><img src='images/delete2.gif' width='20' height='18' border='0' align='absmiddle'>删除</td>
  324.                 <td align="center" style="cursor:hand">选中全部
  325.                     <input type="checkbox" name="delall"  value="0" onClick="selectAll(cids,this.checked);"></td>
  326.               </tr>
  327.       </table></td>
  328.     </tr>
  329.        
  330.    <tr height="100%">
  331. <td valign="top" height="100%">
  332. <div style="overflow: auto;height:95%;width:100%;">
  333.           <TABLE WIDTH='99%' height="100%" BORDER='1' bordercolor="C7D0D2" align='center' CELLPADDING='4' CELLSPACING='0' style="border-collapse: collapse" class="table1" background="images/table_headbg.gif">
  334.             <thead>
  335.               <TR align="center" valign="middle"> 
  336.                 <Td height="20" nowrap><div style="height:20;width:100%;" align="center" >选择</div></td>
  337.                 <TD height="20" nowrap > <div style="height:20;width:100%;cursor:hand"  title="点击按是否已读排序" onClick="doSort('isRead')" align="center" >状态</div></TD>
  338.                 <TD height="20" nowrap ><div style="height:20;width:100%;" align="center" >附件</div></TD>
  339.                 <TD height="20" nowrap> <div style="height:20;width:100%;cursor:hand"  title="点击按发件人排序" onClick="doSort('sendCID')" align="center">发件人</div></TD>
  340.                 <TD height="20" nowrap> <div style="height:20;width:100%;cursor:hand"  title="点击按主题排序" onClick="doSort('subject')" align="center">主题 
  341.                   </div></TD>
  342.                 <TD height="20" nowrap> <div style="height:20;width:100%;cursor:hand"  title="点击按日期排序" onClick="doSort('sendTime')" align="center">日期</div></TD>
  343.                 <TD height="20" nowrap> <div style="height:20;width:100%;cursor:hand"  title="点击按大小排序" onClick="doSort('emailSize')" align="center">大小</div></TD>
  344.               </TR>
  345.             </thead>
  346.             
  347.             <c:forEach items="${draftbox}" var="draft">
  348.                    <TR bgcolor='F1F6F8'  id='2009092471131106253.eml' > 
  349.               <td height="26" align="center"> <input type="checkbox"   name="cids" id="cids" value="${draft.id }" onClick="if(this.checked)selectRow(this.value);"> 
  350.               </td>
  351.               <TD height="40" align="center">
  352.               <c:if test="${draft.stat=='1'}">
  353.               <img src="images/new2.gif" border="0">  
  354.               </c:if> 
  355.               </TD>
  356.               <TD height="26" align="center" style='word-break:break-all'>
  357.                <c:if test="${draft.add !=null}">
  358.               <a href="${draft.add}"><img src="images/paperclip.gif" border="0"></a>
  359.               </c:if>
  360.               </TD>
  361.               <TD ><span style="word-break:break-all">${draft.mail_from }<jaty_613@163.com></span></TD>
  362.               <TD  ><font color="#0000FF"><a href="#" target="_self" onClick="show('2009092471131106253.eml');return false;" ><span style="word-break:break-all">${draft.subject }</span></a></font></TD>
  363.               <TD align='center'><span style="word-break:break-all">${draft.date }</span></TD>
  364.               <TD align='center'><span style="word-break:break-all">${draft.mail_size }B</span></TD>
  365.             </TR>
  366.             </c:forEach>
  367.           
  368.               <!--  
  369.             <TR bgcolor='F1F6F8'  id='2009092471132238303.eml' > 
  370.               <td height="26" align="center"> <input type="checkbox"   name="cids"  value="2009092471132238303.eml" onClick="if(this.checked)selectRow(this.value);"> 
  371.               </td>
  372.               <TD height="40" align="center"> </TD>
  373.               <TD height="26" align="center" style='word-break:break-all'><img src="images/paperclip.gif" border="0"> </TD>
  374.               <TD ><span style="word-break:break-all">jaty_613<jaty_613@163.com></span></TD>
  375.               <TD  ><font color="#0000FF"><a href="#" target="_self" onClick="show('2009092471132238303.eml');return false;" ><span style="word-break:break-all">ssssssssss</span></a></font></TD>
  376.               <TD align='center'><span style="word-break:break-all">2009-09-04 11:32</span></TD>
  377.               <TD align='center'><span style="word-break:break-all">73.45KB</span></TD>
  378.             </TR>
  379.             
  380.  
  381.             <TR bgcolor='F1F6F8'  id='2009092471135086116.eml' > 
  382.               <td height="26" align="center"> <input type="checkbox"   name="cids"  value="2009092471135086116.eml" onClick="if(this.checked)selectRow(this.value);"> 
  383.               </td>
  384.               <TD height="40" align="center"> </TD>
  385.               <TD height="26" align="center" style='word-break:break-all'></TD>
  386.               <TD ><span style="word-break:break-all">jaty_613<jaty_613@163.com></span></TD>
  387.               <TD  ><font color="#0000FF"><a href="#" target="_self" onClick="show('2009092471135086116.eml');return false;" ><span style="word-break:break-all">fdsafdsa</span></a></font></TD>
  388.               <TD align='center'><span style="word-break:break-all">2009-09-04 11:35</span></TD>
  389.               <TD align='center'><span style="word-break:break-all">.17KB</span></TD>
  390.             </TR>
  391.             
  392.             <TR bgcolor='F1F6F8'  id='2009092471135206833.eml' > 
  393.               <td height="26" align="center"> <input type="checkbox"   name="cids"  value="2009092471135206833.eml" onClick="if(this.checked)selectRow(this.value);"> 
  394.               </td>
  395.               <TD height="40" align="center"> </TD>
  396.               <TD height="26" align="center" style='word-break:break-all'></TD>
  397.               <TD ><span style="word-break:break-all">jaty_613<jaty_613@163.com></span></TD>
  398.               <TD  ><font color="#0000FF"><a href="#" target="_self" onClick="show('2009092471135206833.eml');return false;" ><span style="word-break:break-all">fsdafsafdas</span></a></font></TD>
  399.               <TD align='center'><span style="word-break:break-all">2009-09-04 11:35</span></TD>
  400.               <TD align='center'><span style="word-break:break-all">.17KB</span></TD>
  401.             </TR>
  402.             
  403.             <TR bgcolor='F1F6F8'  id='2009092471135331245.eml' > 
  404.               <td height="26" align="center"> <input type="checkbox"   name="cids"  value="2009092471135331245.eml" onClick="if(this.checked)selectRow(this.value);"> 
  405.               </td>
  406.               <TD height="40" align="center"> </TD>
  407.               <TD height="26" align="center" style='word-break:break-all'></TD>
  408.               <TD ><span style="word-break:break-all">jaty_613<jaty_613@163.com></span></TD>
  409.               <TD  ><font color="#0000FF"><a href="#" target="_self" onClick="show('2009092471135331245.eml');return false;" ><span style="word-break:break-all">fdsafas</span></a></font></TD>
  410.               <TD align='center'><span style="word-break:break-all">2009-09-04 11:35</span></TD>
  411.               <TD align='center'><span style="word-break:break-all">.16KB</span></TD>
  412.             </TR>
  413.             -->
  414.             
  415.             <TR bgcolor='F1F6F8'  id=2005102816402618 > 
  416.               <td colspan="7" align="center"></td>
  417.             </TR>
  418.           </TABLE>
  419. </div>
  420.  </td>
  421. </tr>
  422.    
  423.    
  424.         <tr>
  425.           <td height="40" class="TableTitle" valign='top'><table bgcolor="#C1F9FD" class='cooltbl-b' width='100%' cellspacing='0' id='table_bar'>
  426.               <tr bgcolor="#C1F9FD">
  427.                 <td height="100%" align='left' bgcolor="#FFFFFF"><table bgcolor="#FFFFFF" id='table_page' width="100%">
  428.                     <tr>
  429.                       <td nowrap><b>收件箱: ${total } 封邮件</b></td>
  430.                       <td nowrap>&nbsp;</td>
  431.                       <td nowrap><b> 封邮件未读</b></td>
  432.                       <td align='left' nowrap>第  <a href="DraftboxServlet?page=1"><font color=red>1</font></a>&nbsp;&nbsp; 页 
  433.                       <c:if test="${currentpage==lastpage}">下一页</c:if>
  434.                       <c:if test="${currentpage!=lastpage}"><a href="DraftboxServlet?page=${currentpage+1 }">下一页</a> </c:if>
  435.                       <a href="DraftboxServlet?page=${lastpage}">末页</a> 
  436.                         <table align="right" >
  437.                         
  438.                         </table></td>
  439.                     </tr>
  440.                 </table></td>
  441.               </tr>
  442.           </table></td>                    
  443.         </tr>
  444.   
  445. </table>
  446. </body>
  447. </html>