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

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="DeleteServlet?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="DeleteServlet?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. alert("此功能不存在");
  113. if(confirm('邮件删除操作将把邮件移到垃圾箱,是否执行该操作?')){
  114. ListForm.newBox.value="delbox";
  115. }
  116. }
  117. function show(id)
  118. {
  119. ListForm.cid.value=id;
  120. ListForm.easyJWebCommand.value="show";
  121. //ListForm.target="_blank";
  122. ListForm.submit();
  123. //ListForm.target="_self";
  124. }
  125. function gotoPage(n)
  126. {
  127. ListForm.page.value=n;
  128. ListForm.submit();
  129. }
  130. function ChangeNoEx()
  131. {
  132.     if(!CheckPositiveInt(form1.txtPageNo,"请输入一个正整数!",false))
  133.     return false;    
  134.     ChangePageNo(form1.txtPageNo.value);
  135. }
  136. //=================
  137. function setMailID(id)
  138. {
  139.   if(event.ctrlKey)
  140.   {
  141.     EmailID=id;
  142.     if(form1.msgID.value !='')
  143.       form1.msgID.value+=','+id;
  144.     else
  145.       form1.msgID.value=id;
  146.   }
  147.   else
  148.   {
  149.     EmailID=id;
  150.     form1.msgID.value=id;
  151.   }
  152. }
  153. //================
  154. //排序
  155. function doSort(fld)
  156. {
  157. if(ListForm.field.value==fld){
  158. if(ListForm.orderType.value=='asc')
  159. ListForm.orderType.value='desc';
  160. else
  161. ListForm.orderType.value='asc';
  162. }
  163. ListForm.field.value=fld;
  164. ListForm.method="post";
  165.     ListForm.submit();
  166. }
  167. //document.onselectstart =function () {return false;}
  168. function Exec_Click(n){
  169.   var SelectedId = '';
  170.   var arrUsers = temp;
  171.   var i = 0 ;
  172.    if(form1.delid.value=='')// &&SelectedId == '')
  173. {
  174. alert('请先选择邮件!') ;
  175. return ;
  176. }
  177. SelectedId = form1.delid.value;
  178. if(SelectedId.indexOf(",")==0)
  179. SelectedId = SelectedId.substring(1);
  180. form1.delid.value = "";
  181. //alert(SelectedId)
  182. //  }
  183.   switch(n){
  184.     case 0://移动到垃圾箱
  185.       //form1.Actions.value=0;
  186.       form1.msgID.value=SelectedId;
  187.       form1.action='del1.jsp';
  188.       form1.submit();
  189.       break;
  190.     case 1://彻底删除
  191.       if(confirm('邮件将不可恢复,是否真的要永久删除此邮件?')){
  192.         //form1.Actions.value=1;
  193.         form1.msgID.value=SelectedId;
  194.         form1.action='del.jsp';
  195.         form1.submit();
  196.       }
  197.       break;   
  198.     case 2://查看邮件内容
  199.     case 3://回复邮件
  200.     case 4://转发邮件
  201.       if(SelectedId.indexOf(',') == -1){
  202.         switch(n){
  203.           case 2://查看邮件内容
  204.             var urls='ShowMail.jsp?id='+SelectedId+'&uls=0';
  205.             OpenWin(urls,'ShowMail',700,450);
  206.             break;
  207.           case 3://回复邮件
  208.             self.location='replyForm.jsp?actions=RE&id='+SelectedId+"&uri=inbox";
  209.             break;
  210.           case 4://转发邮件
  211.             self.location='replyForm.jsp?actions=FWD&id='+SelectedId+"&uri=inbox";
  212.             break;
  213.         }
  214.       }
  215.       else{
  216.         alert('一次只能选择一个邮件!') ;
  217.         return ;
  218.       }
  219.       break;
  220.       case 5://移动邮件
  221.   form1.Tombx.value=document.all('lstFolderList').value;
  222.   form1.msgID.value=SelectedId;
  223.   form1.action='MoveToMailBox.jsp';
  224.   form1.method='post';
  225.   form1.submit();
  226.   break;   
  227. }
  228. }
  229. function check(obj)
  230. {
  231. var slt = form1.delid.value;
  232. if(obj.checked==true)
  233. {
  234. if(slt.indexOf(obj.value+",")<0)slt = slt+","+obj.value;
  235. }
  236. else
  237. {
  238. if(slt.indexOf(","+obj.value)>=0)slt = slt.replace(","+obj.value,"");
  239. }
  240. form1.delid.value = slt;
  241. //alert(form1.delid.value);
  242. }
  243. function checkAll(obj,value)
  244. {
  245. for(var i=0;i<obj.length;i++)
  246. {
  247. if(value=="1")
  248. {
  249. if(obj[i].checked==false)obj[i].click();
  250. }
  251. else
  252. {
  253. if(obj[i].checked==true)obj[i].click();
  254. }
  255. }
  256. }
  257. function ck(obj)
  258. {
  259. if(obj==undefined)return;
  260. if(form1.delall.checked)
  261. {
  262. form1.delall.value = "1";
  263. checkAll(obj,'1');
  264. //alert(form1.delid.value);
  265. }
  266. else
  267. {
  268. form1.delall.value = "0";
  269. checkAll(obj,'0');
  270. //alert(form1.delid.value);
  271. }
  272. }
  273. function doMoveToDel(theForm)
  274. {
  275. if(confirm('确认要删除邮件吗?')){
  276. theForm.toBoxName.value='delbox';
  277. doMove(theForm);
  278. }
  279. }
  280. //-->
  281. </SCRIPT>
  282. <link href="css/css.css" rel="stylesheet" type="text/css">
  283. </head>
  284. <body bgcolor="#F2F1F2" leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0" scroll="no" background="images/login_bg.gif">
  285. <table width="100%" height="5%"  border="0" cellpadding="0" cellspacing="0">
  286.   <tr>
  287.     <td width="11" height="11"></td>
  288.     <td ></td>
  289.   </tr>
  290. </table>
  291. <table width="100%" height="95%"  border="0" cellpadding="0" cellspacing="0" bgcolor="ECF4F5">
  292.   <FORM id='ListForm' name="ListForm" METHOD='POST' ACTION='ManageDelServlet'>
  293. <input type="hidden" name="box" value="delbox">
  294. <input type="hidden" name="easyJWebCommand" value="list">
  295. <input type="hidden" name="subCommand" value="">
  296. <input type="hidden" name="cid"   value="">
  297. <input type="hidden" name="mulitCid"   value="">
  298. <input type="hidden" name="page"   value="0">
  299. <input name="field" type="hidden" value="">
  300.        <input name="orderType" type="hidden" value="">
  301. <tr>
  302.           <td height="20" align="center"><table height="20">
  303.               <tr>               
  304.                 <td nowrap class='coolbutton' onClick='doReply()' style="cursor:hand"><img src='images/replytogroup.gif' width='20' height='18' border='0' align='absmiddle'>回复</td>
  305.                 <td nowrap class='coolbutton' onClick='doForward()' style="cursor:hand"><img src='images/forward.gif' width='20' height='18' border='0' align='absmiddle'>转发</td>
  306. <td align="center" nowrap class='coolbutton' onClick='doMove();' style="cursor:hand">转移到
  307. <img src='images/right.gif' width='9' height='13' border='0' align='absmiddle'>
  308. </td>
  309. <td nowrap>
  310. <select name='newBox'>
  311. <option value='inbox'>收件箱</option>
  312. <option value='drafts'>草稿箱</option>
  313. <option value='sendbox'>发件箱</option>
  314. <option value='laji'>垃圾箱</option>
  315. </select>  
  316. </td>
  317.                 <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>
  318.                 <td nowrap class='coolbutton' onClick='doMoveToDel()' style="cursor:hand"><img src='images/delete2.gif' width='20' height='18' border='0' align='absmiddle'>删除</td>
  319.                 <td align="center" style="cursor:hand">选中全部
  320.                     <input type="checkbox" name="delall"  value="0" onClick="selectAll(cids,this.checked);"></td>
  321.               </tr>
  322.       </table></td>
  323.     </tr>
  324.        
  325.    <tr height="100%">
  326. <td valign="top" height="100%">
  327. <div style="overflow: auto;height:95%;width:100%;">
  328.           <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">
  329.             <thead>
  330.               <TR align="center" valign="middle"> 
  331.                 <Td height="20" nowrap><div style="height:20;width:100%;" align="center" >选择</div></td>
  332.                 <TD height="20" nowrap > <div style="height:20;width:100%;cursor:hand"  title="点击按是否已读排序" onClick="doSort('isRead')" align="center" >状态</div></TD>
  333.                 <TD height="20" nowrap ><div style="height:20;width:100%;" align="center" >附件</div></TD>
  334.                 <TD height="20" nowrap> <div style="height:20;width:100%;cursor:hand"  title="点击按发件人排序" onClick="doSort('sendCID')" align="center">发件人</div></TD>
  335.                 <TD height="20" nowrap> <div style="height:20;width:100%;cursor:hand"  title="点击按主题排序" onClick="doSort('subject')" align="center">主题 
  336.                   </div></TD>
  337.                 <TD height="20" nowrap> <div style="height:20;width:100%;cursor:hand"  title="点击按日期排序" onClick="doSort('sendTime')" align="center">日期</div></TD>
  338.                 <TD height="20" nowrap> <div style="height:20;width:100%;cursor:hand"  title="点击按大小排序" onClick="doSort('emailSize')" align="center">大小</div></TD>
  339.               </TR>
  340.             </thead>
  341.             
  342.              <c:forEach items="${delbox}" var="del">
  343.                    <TR bgcolor='F1F6F8'  id='2009092471131106253.eml' > 
  344.               <td height="26" align="center"> <input type="checkbox"   name="cids" id="cids" value="${del.id }" onClick="if(this.checked)selectRow(this.value);"> 
  345.               </td>
  346.               <TD height="40" align="center">
  347.               <c:if test="${del.stat=='1'}">
  348.               <img src="images/new2.gif" border="0">  
  349.               </c:if> 
  350.               </TD>
  351.               <TD height="26" align="center" style='word-break:break-all'>
  352.               <c:if test="${del.add !=null}">
  353.               <a href="${del.add}"><img src="images/paperclip.gif" border="0"></a>
  354.               </c:if>
  355.               
  356.               </TD>
  357.               <TD ><span style="word-break:break-all">${del.mail_from }<jaty_613@163.com></span></TD>
  358.               <TD  ><font color="#0000FF"><a href="#" target="_self" onClick="show('2009092471131106253.eml');return false;" ><span style="word-break:break-all">${del.subject }</span></a></font></TD>
  359.               <TD align='center'><span style="word-break:break-all">${del.date }</span></TD>
  360.               <TD align='center'><span style="word-break:break-all">${del.mail_size }B</span></TD>
  361.             </TR>
  362.             </c:forEach>
  363.             
  364.                    <TR bgcolor='F1F6F8'  id=2005102816402618 > 
  365.               <td colspan="7" align="center"></td>
  366.             </TR>
  367.           </TABLE>
  368. </div>
  369.  </td>
  370. </tr>
  371.    
  372.    
  373.         <tr>
  374.           <td height="40" class="TableTitle" valign='top'><table bgcolor="#C1F9FD" class='cooltbl-b' width='100%' cellspacing='0' id='table_bar'>
  375.               <tr bgcolor="#C1F9FD">
  376.                 <td height="100%" align='left' bgcolor="#FFFFFF"><table bgcolor="#FFFFFF" id='table_page' width="100%">
  377.                     <tr>
  378.                       <td nowrap><b>收件箱: ${total } 封邮件</b></td>
  379.                       <td nowrap>&nbsp;</td>
  380.                       <td nowrap><b> 封邮件未读</b></td>
  381.                       <td align='left' nowrap>
  382.                       <a href="DelboxServlet?page=1">首页</a>
  383.                        <c:if test="${currentpage==1}">上一页</c:if>
  384.                        <c:if test="${currentpage!=1}"><a href="DelboxServlet?page=${currentpage-1 }">上一页</a></c:if> 
  385.                       <c:if test="${currentpage==lastpage}">下一页</c:if>
  386.                       <c:if test="${currentpage!=lastpage}"><a href="DelboxServlet?page=${currentpage+1 }">下一页</a> </c:if>
  387.                       <a href="DelboxServlet?page=${lastpage}">末页</a> 
  388.                         <table align="right" >
  389.                         
  390.                         </table></td>
  391.                     </tr>
  392.                 </table></td>
  393.               </tr>
  394.           </table></td>                    
  395.         </tr>
  396. </table>
  397. </body>
  398. </html>