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

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. <%@ page import="com.redmoon.oa.sms.*"%>
  5. <LINK href="../common.css" type=text/css rel=stylesheet>
  6. <jsp:useBean id="StrUtil" scope="page" class="cn.js.fan.util.StrUtil"/>
  7. <jsp:useBean id="privilege" scope="page" class="com.redmoon.oa.pvg.Privilege"/>
  8. <%
  9. String name = privilege.getUser(request);
  10. String mobile = ParamUtil.get(request, "mobile");
  11. String op = ParamUtil.get(request, "op");
  12. boolean re = false;
  13. if (op.equals("send")) {
  14.     IMsgUtil imu = SMSFactory.getMsgUtil();
  15. String content = ParamUtil.get(request, "content");
  16. if (imu!=null) {
  17. imu.send(mobile, content, name);
  18. out.print(StrUtil.Alert_Back("发送成功!"));
  19. return;
  20. }
  21. else {
  22. out.print(StrUtil.Alert_Back("短讯发送功能未开通!"));
  23. }
  24. return;
  25. }
  26. %>
  27. <html><head>
  28. <title>撰写消息</title>
  29. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  30. <script language=javascript>
  31. <!--
  32. function form1_onsubmit()
  33. {
  34. errmsg = "";
  35. if (form1.mobile.value=="")
  36. errmsg += "请填写手机号码!n"
  37. if (form1.content.value=="")
  38. errmsg += "请填写内容!n"
  39. if (form1.content.value.length>70)
  40. errmsg += "请不要超过70个字符!n";
  41. if (errmsg!="")
  42. {
  43. alert(errmsg);
  44. return false;
  45. }
  46. }
  47. //-->
  48. </script>
  49. </head>
  50. <body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
  51. <%
  52. if (!privilege.isUserLogin(request))
  53. {
  54. out.println(cn.js.fan.web.SkinUtil.makeErrMsg(request, cn.js.fan.web.SkinUtil.LoadString(request, "pvg_invalid")));
  55. return;
  56. }%>
  57. <br>
  58. <table width="320" border="0" cellspacing="1" cellpadding="3" align="center" bgcolor="#99CCFF" class="9black" height="230">
  59.   <form action="?op=send" method="post" name="form1" onSubmit="return form1_onsubmit()"><tr> 
  60.     <td bgcolor="#CEE7FF" height="23">
  61.         <div align="center"> <b>撰 写 手 机 短 讯</b><strong></strong></div>    </td>
  62.   </tr>
  63.   <tr> 
  64.       <td bgcolor="#FFFFFF" height="100" valign="top">
  65.         <table width="300" border="0" cellspacing="0" cellpadding="0" align="center" class="9black" height="6">
  66.           <tr> 
  67.             <td></td>
  68.           </tr>
  69.         </table>
  70.         <table width="300" border="0" cellspacing="1" cellpadding="3" align="center" class="9black">
  71.           <tr> 
  72.             <td width="68" height="27"> 
  73.               <div align="center">手机号码:</div>            </td>
  74.             <td width="217" height="27"><input type="text" name="mobile" size="20" maxlength="12" value="<%=mobile%>"></td>
  75.           </tr>
  76.           
  77.           <tr> 
  78.             <td width="68" height="26"> 
  79.               <div align="center">短讯内容:</div>            </td>
  80.             <td width="217" height="26"> 
  81.               <textarea name="content" cols="28" rows="5"></textarea>            </td>
  82.           </tr>
  83.           
  84.           <tr> 
  85.             <td colspan="2" height="26"> 
  86.               <div align="center">
  87.                 <input type="submit" name="Submit" value="发送" class="button1">
  88.                 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  89.                 <input type="reset" name="Submit2" value="重写" class="button1">
  90. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div>            </td>
  91.           </tr>
  92.         </table>
  93.         <table width="300" border="0" cellspacing="0" cellpadding="0" align="center" class="9black" height="6">
  94.           <tr> 
  95.             <td></td>
  96.           </tr>
  97.       </table>      </td>
  98.   </tr>
  99.   <tr> 
  100.     <td bgcolor="#CEE7FF" height="6"></td>
  101.   </tr></form>
  102. </table>
  103. </body>
  104. </html>