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