send.jsp
上传用户:jhtang88
上传日期:2014-01-27
资源大小:28528k
文件大小:6k
源码类别:

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html;charset=utf-8" %>
  2. <%@ page import="cn.js.fan.util.*"%>
  3. <%@ page import="com.redmoon.oa.person.*"%>
  4. <LINK href="../common.css" type=text/css rel=stylesheet>
  5. <jsp:useBean id="StrUtil" scope="page" class="cn.js.fan.util.StrUtil"/>
  6. <jsp:useBean id="privilege" scope="page" class="com.redmoon.oa.pvg.Privilege"/>
  7. <%
  8. String name = privilege.getUser(request);
  9. String receiver = ParamUtil.get(request, "receiver");
  10. %>
  11. <html>
  12. <head>
  13. <title>撰写消息</title>
  14. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  15. <script language=javascript>
  16. <!--
  17. function form1_onsubmit()
  18. {
  19. errmsg = "";
  20. if (form1.receiver.value=="")
  21. errmsg += "请填写接收者!n"
  22. if (form1.title.value=="")
  23. errmsg += "请填写标题!n"
  24. if (form1.content.value=="")
  25. errmsg += "请填写内容!n"
  26. if (errmsg!="")
  27. {
  28. alert(errmsg);
  29. return false;
  30. }
  31. }
  32. function saveDraft() {
  33. form1.isDraft.value = "true";
  34. form1_onsubmit();
  35. form1.submit();
  36. }
  37. function setPerson(deptCode, deptName, user, userRealName)
  38. {
  39. form1.receiver.value = user;
  40. form1.userRealName.value = userRealName;
  41. }
  42. function getSelUserNames() {
  43. return form1.receiver.value;
  44. }
  45. function getSelUserRealNames() {
  46. return form1.userRealName.value;
  47. }
  48. <%
  49. UserSetupDb usd = new UserSetupDb();
  50. usd = usd.getUserSetupDb(name);
  51. int messageToMaxUser = usd.getMessageToMaxUser();
  52. %>
  53. var messageToMaxUser = <%=messageToMaxUser%>;
  54. function setUsers(users, userRealNames) {
  55. var ary = users.split(",");
  56. var len = ary.length;
  57. if (len>messageToMaxUser) {
  58. alert("对不起,您一次最多只能发往" + messageToMaxUser + "个用户!");
  59. return;
  60. }
  61. form1.receiver.value = users;
  62. form1.userRealName.value = userRealNames;
  63. }
  64. //-->
  65. </script>
  66. </head>
  67. <body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
  68. <%
  69. if (!privilege.isUserLogin(request))
  70. {
  71. out.println(cn.js.fan.web.SkinUtil.makeErrMsg(request, cn.js.fan.web.SkinUtil.LoadString(request, "pvg_invalid")));
  72. return;
  73. }%>
  74. <table width="320" border="0" cellspacing="1" cellpadding="3" align="center" bgcolor="#99CCFF" class="9black" height="260">
  75.   <form action="send_do.jsp" method="post" enctype="multipart/form-data" name="form1" onSubmit="return form1_onsubmit()">
  76.   <tr> 
  77.     <td bgcolor="#CEE7FF" height="23">
  78.         <div align="center"> <b>撰 写 新 消 息</b>
  79. <%
  80. if (privilege.isUserPrivValid(request, "message.group")) {
  81. %>
  82. (<a href="sendtogroup.jsp">群发</a>)
  83. <%}%>
  84. </div>
  85.     </td>
  86.   </tr>
  87.   <tr> 
  88.     <td bgcolor="#FFFFFF" height="50"> 
  89.         <table width="300" border="0" cellspacing="0" cellpadding="0" align="center">
  90.           <tr> 
  91.             <td width="75"> 
  92.               <div align="center"><a href="message.jsp?page=1"><img src="images/inboxpm.gif" width="40" height="40" border="0"></a></div>
  93.             </td>
  94.             <td width="75"> 
  95.               <div align="center"><a href="listdraft.jsp"><img src="images/m_draftbox.gif" width="40" height="40" border="0"></a></div>
  96.             </td>
  97.             <td width="75"> 
  98.               <div align="center"><img src="images/newpm.gif" width="40" height="40" border="0"></div>
  99.             </td>
  100.             <td width="75"> 
  101.               <div align="center"> <img src="images/m_delete.gif" width="40" height="40"></div>
  102.             </td>
  103.           </tr>
  104.         </table>
  105.     </td>
  106.   </tr>
  107.   <tr> 
  108.       <td bgcolor="#FFFFFF" height="152" valign="top">
  109.         <table width="300" border="0" cellspacing="0" cellpadding="0" align="center" class="9black" height="6">
  110.           <tr> 
  111.             <td></td>
  112.           </tr>
  113.         </table>
  114.         <table width="300" border="0" cellspacing="1" cellpadding="3" align="center" class="9black">
  115.           <tr> 
  116.             <td width="68" height="27"> 
  117.               <div align="center">接 收 者:</div>            </td>
  118.             <td width="217" height="27">
  119.               <input type="hidden" name="receiver" class="input1" value="<%=receiver%>">
  120.   <%
  121.   String userRealName = "";
  122.   if (!receiver.equals("")) {
  123.    com.redmoon.oa.person.UserDb ud = new com.redmoon.oa.person.UserDb();
  124.    ud = ud.getUserDb(receiver);
  125. userRealName = ud.getRealName();
  126.   }
  127.   %>
  128.               <input type="text" readonly name="userRealName" class="input1" size="20" maxlength="20" value="<%=userRealName%>">
  129.   
  130.   <input type="hidden" name="isDraft" value="false">
  131.   <a href="#" onClick="javascript:showModalDialog('../user_multi_sel.jsp',window.self,'dialogWidth:600px;dialogHeight:480px;status:no;help:no;')">选择用户</a></td>
  132.           </tr>
  133.           <tr> 
  134.             <td width="68" height="26"> 
  135.               <div align="center">消息标题:</div>            </td>
  136.             <td width="217" height="26">
  137.               <input type="text" name="title" class="input1" size="30">            </td>
  138.           </tr>
  139.           <tr> 
  140.             <td width="68" height="26"> 
  141.               <div align="center">消息内容:</div>            </td>
  142.             <td width="217" height="26"> 
  143.               <textarea name="content" cols="28" rows="3"></textarea>            </td>
  144.           </tr>
  145.           <tr>
  146.             <td height="26" align="center">附&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;件:</td>
  147.             <td height="26"><input type="file" name="filename"></td>
  148.           </tr>
  149.           <tr> 
  150.             <td colspan="2" height="26"> 
  151.               <div align="center">
  152.                 <input type="submit" name="Submit" value="发送" class="button1">
  153.                 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  154.                 <input type="reset" name="Submit2" value="重写" class="button1">
  155. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  156. <input type="button" name="Submit3" value="存草稿" class="button1" onClick="saveDraft()">
  157. <%
  158. if (com.redmoon.oa.sms.SMSFactory.isUseSMS()) {
  159. %>
  160. &nbsp;&nbsp;
  161. <input name="isToMobile" value="true" type="checkbox" checked>
  162. 短讯
  163. <%}%>
  164. </div>            </td>
  165.           </tr>
  166.         </table>
  167.         <table width="300" border="0" cellspacing="0" cellpadding="0" align="center" class="9black" height="6">
  168.           <tr> 
  169.             <td></td>
  170.           </tr>
  171.         </table>
  172.       </td>
  173.   </tr>
  174.   <tr> 
  175.     <td bgcolor="#CEE7FF" height="6"></td>
  176.   </tr></form>
  177. </table>
  178. </body>
  179. </html>