reademail.jsp
上传用户:lm2018
上传日期:2015-12-12
资源大小:30449k
文件大小:8k
源码类别:

Jsp/Servlet

开发平台:

Java

  1. <%@ page language="java" pageEncoding="GBK"%>
  2. <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
  3. <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
  4. <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
  5. <%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
  6. <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
  7. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  8. <html xmlns="http://www.w3.org/1999/xhtml">
  9. <head>
  10. <meta http-equiv="Content-Type" content="text/html; charset=gbk" />
  11. <title>无标题文档</title>
  12. <style>
  13. <!--
  14. a{TEXT-DECORATION:none}
  15. body{ font-size:12px}
  16. -->
  17. </style> 
  18. <script>
  19. function go(){
  20. location.href="${pageContext.request.contextPath}/email.do?method=receiveBox&emailtype=0&receiveid=${sessionScope.user.uno}";
  21. }
  22. function init() {
  23.     var select_left = emailForm.arryusername;
  24.     var select_right = emailForm.senduser;
  25. }
  26. //left to right
  27. function right() {
  28.     var select_left = emailForm.arryusername;
  29.     var select_right = emailForm.senduser;
  30.     var len = select_left.options.length;
  31.     for (var i = 0; i < len; i++) {
  32.         try {
  33.             if (select_left.options[i].selected == true) {
  34.                 var tmp = select_left.options[i];
  35.                 var oOption = document.createElement("OPTION");
  36.                 oOption.text = tmp.text;
  37.                 oOption.value = tmp.value;
  38. //oOption.selected="selected";
  39.                 select_right.add(oOption);
  40.                 select_left.options[i] = null;
  41.                 i--;
  42.             }
  43.         }
  44.         catch (e) {
  45.         }
  46.     }
  47. }
  48. //right to left
  49. function left() {
  50.     var select_left = emailForm.arryusername;
  51.     var select_right = emailForm.senduser;
  52.     var len = select_right.options.length;
  53.     for (var i = 0; i < len; i++) {
  54.         try {
  55.             if (select_right.options[i].selected == true) {
  56.                 var tmp = select_right.options[i];
  57.                 var oOption = document.createElement("OPTION");
  58.                 oOption.text = tmp.text;
  59.                 oOption.value = tmp.value;
  60.                 select_left.add(oOption);
  61.                 select_right.options[i] = null;
  62.                 i--;
  63.             }
  64.         }
  65.         catch (e) {
  66.         }
  67.     }
  68. }
  69. function selecttrue() {
  70.     var select_right = emailForm.senduser;
  71.     var len = select_right.options.length;
  72.     for (var i = 0; i < len; i++) {
  73.         select_right.options[i].selected = "selected";
  74.     }
  75. }
  76. </script>
  77. <script>
  78. function ToRight(){
  79. init();
  80. var moveright =document.getElementById("rightmove");
  81. right();
  82. }
  83. function ToLeft(){
  84. init();
  85. var moveleft= document.getElementById("leftmove");
  86. left();
  87. }
  88. function check(method){
  89.  var user = emailForm.senduser;
  90.  if(user.options.length<=0){
  91.   alert("请右下角选择要转发的用户");
  92.   return false;
  93.  }
  94.  for(var i = 0; i<user.options.length; i++){
  95.   user.options[i].selected = true;
  96.  }
  97.  
  98.  document.getElementById("method").value=method;
  99.  emailForm.submit();
  100.  
  101. }
  102. function back(id,name){
  103. location.href="${pageContext.request.contextPath}/email.do?method=writeEmail&sendid="+id+"&checkeduserList="+name;
  104. }
  105. </script>
  106. </head>
  107. <body>
  108. <html:form action="/email" method="post">
  109. <html:hidden property="method" value=""/>
  110. <table width="100%" border="1">
  111.   <tr>
  112.     <td colspan="2">操作:
  113.      <a href="${pageContext.request.contextPath}/email.do?method=writeEmail&sendid=<bean:write name='emailForm' property='sendid'/>&checkeduserList=<bean:write name='emailForm' property='sendname'/>" style="margin-left:10px">回复</a>-
  114.     
  115.             <a href="${pageContext.request.contextPath}/email.do?method=delToRublish&emailid=<bean:write name='emailForm' property='emailid'/>" style="margin-left:10px">删除</a>-
  116.             <a href="${pageContext.request.contextPath}/email.do?method=delForever&emailid=<bean:write name='emailForm' property='emailid'/>" style="margin-left:10px">彻底删除</a>     
  117.     </td>
  118.  
  119.  
  120.  
  121.   </tr>
  122.   <tr>
  123.     <td colspan="2">
  124.         <table width="100%" border="1">
  125.         <html:hidden name="emailForm" property="emailid"/>
  126.           <tr>
  127.             <td width="14%">日期</td>
  128.             <td width="86%">
  129.              <bean:write name="emailForm" property="sendtime"/>
  130.             </td>
  131.           </tr>
  132.           <tr>
  133.             <td >发件人</td>
  134.             <td>
  135.              <bean:write name="emailForm" property="sendname"/>
  136. </td>
  137.           </tr>
  138.           <tr>
  139.             <td>收件人</td>
  140.             <td>
  141.              <bean:write name="emailForm" property="receivename"/>
  142.             </td>
  143.           </tr>
  144.           <tr>
  145.             <td>主题</td>
  146.             <td>
  147.              <bean:write name="emailForm" property="title"/>
  148.             </td>
  149.           </tr>
  150.           <tr>
  151.             <td>附件</td>
  152.             <td>
  153.              <logic:notPresent  name="emailForm" property="fujian">
  154.              无附件
  155.              </logic:notPresent>
  156.              <logic:present  name="emailForm" property="fujian">
  157.              <logic:empty  name="emailForm" property="fujian">
  158.              无附件
  159.              </logic:empty>
  160.              <logic:notEmpty  name="emailForm" property="fujian">
  161.              <logic:iterate id="temp" name="emailForm" property="fujian">
  162.              <a href="${pageContext.request.contextPath}/downLoadServlet?filepath=${temp.filepath}&filename=${temp.filename}" style="margin-left: 20px">
  163.              <bean:write name="temp" property="filename" />
  164.              </a>
  165.              </logic:iterate>
  166.              </logic:notEmpty>
  167.              </logic:present>
  168.             
  169. </td>
  170.           </tr>
  171.           <tr>
  172.             <td >
  173. <textarea cols="80" rows="15" readonly="readonly">
  174. <bean:write name="emailForm" property="content" />
  175. </textarea>
  176.             </td>
  177.             <td>
  178.              <table width="100%" border="0" align="center">
  179.                <tr>
  180.                 <td colspan="3" align="center">
  181.                 <font color="red">转发请选择发送的用户</font> 
  182.                 </td>
  183.                </tr>
  184.                   <tr>
  185.                     <td width="44%" align="right">
  186.                 
  187.                     <select name="arryusername" size=15 multiple style="width: 100px">
  188. <c:forEach var="temp" items="${requestScope.userList}">
  189. <option value="${temp.uno},${temp.uname}">${temp.uname}</option>
  190. </c:forEach>
  191.                         
  192.                         
  193.                     </select>
  194.                     </td>
  195.                     <td width="11%" align="center"><br /><br />
  196.                       <input type="button"  id="rightmove" value="&gt;&gt;" onclick="ToRight();" /><br /><br />
  197.                       <input type="button"  id="leftmove" value="&lt;&lt;" onclick="ToLeft();" /><br /><br />
  198.                     </td>
  199.                     <td width="45%" align="left">
  200.                     
  201.                     
  202.                     <html:select property="senduser" multiple="true" size="15" style="width: 100px">
  203.                     </html:select>
  204.                         <!--<select name="senduser" size=15 multiple>
  205.                    
  206.                      </select>
  207.                      -->
  208.                     </td>
  209.                   </tr>
  210.        
  211.                 </table>
  212.             
  213.             
  214.             
  215.             </td>
  216.           </tr>
  217.     </table></td>
  218.     
  219.   </tr>
  220.    <tr>
  221.     <td colspan="2">
  222.      <input type="button" value="回复" onclick="back('<bean:write name='emailForm' property='sendid'/>','<bean:write name='emailForm' property='sendname'/>');"/>
  223.         <input type="button" value="转发" onclick="return check('sendToOther');"/>
  224.         <input type="button" value="返回" onclick="go();"/>
  225.     </td>
  226.     
  227.   </tr>
  228. </table>
  229. </html:form>
  230. </body>
  231. </html>