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

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html; charset=utf-8"%>
  2. <%@ page import="com.redmoon.oa.emailpop3.*"%>
  3. <%@ page import="java.util.*"%>
  4. <%@ page import="cn.js.fan.util.*"%>
  5. <html>
  6. <head>
  7. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  8. <title>发邮件</title>
  9. <%@ include file="../inc/nocache.jsp"%>
  10. <link href="../common.css" rel="stylesheet" type="text/css">
  11. </head>
  12. <script language=javascript>
  13. function form1_onsubmit() {
  14. if (form1.email.value=="")
  15. {
  16. alert("邮箱不能为空!");
  17. return false;
  18. }
  19. }
  20. </script>
  21. <body leftmargin="0" topmargin="5">
  22. <jsp:useBean id="fchar" scope="page" class="cn.js.fan.util.StrUtil"/>
  23. <jsp:useBean id="userservice" scope="page" class="com.redmoon.oa.person.UserService"/>
  24. <jsp:useBean id="privilege" scope="page" class="com.redmoon.oa.pvg.Privilege"/>
  25. <%
  26. String priv="read";
  27. if (!privilege.isUserPrivValid(request,priv))
  28. {
  29. out.println(cn.js.fan.web.SkinUtil.makeErrMsg(request, cn.js.fan.web.SkinUtil.LoadString(request, "pvg_invalid")));
  30. return;
  31. }
  32. %>
  33. <table width="80%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" class="tableframe">
  34.   <tr> 
  35.     <td width="100%" height="23" valign="bottom" class="right-title">&nbsp;POP3 
  36.       邮 箱 设 置</td>
  37.   </tr>
  38.   <tr>
  39.     <td height="301" valign="top">
  40. <%
  41. String op = fchar.getNullString(request.getParameter("op"));
  42. if (op.equals("add")) {
  43. boolean re = false;
  44. try {
  45. EmailPop3Mgr epm = new EmailPop3Mgr();
  46. re = epm.create(request);
  47. }
  48. catch (ErrMsgException e) {
  49. out.print(StrUtil.Alert(e.getMessage()));
  50. }
  51. if (re)
  52. out.print(StrUtil.Alert("操作成功!"));
  53. }
  54. String sql;
  55. String myname = privilege.getUser(request);
  56. sql = "select id from email_pop3 where userName="+fchar.sqlstr(myname);
  57. EmailPop3Db epd = new EmailPop3Db();
  58. Iterator ir = epd.list(sql).iterator();
  59. int i = 0;
  60. String email = "",email_user="",email_pwd="",mailserver="";
  61. int id,port;
  62. %>
  63.       <table width="90%" height="5" border="0" align="center">
  64.         <tr> 
  65.           <td></td>
  66.         </tr>
  67.       </table>
  68.       <table width="98%" border="0" align="center" cellpadding="2" cellspacing="0">
  69.         <tr align="center" bgcolor="#C4DAFF" class="stable"> 
  70.           <td width="21%"> 邮箱名称</td>
  71.           <td>邮箱设置</td>
  72.           <td width="22%">操作 </td>
  73.         </tr>
  74.       </table>
  75.       <%
  76. while (ir.hasNext()) {
  77. epd = (EmailPop3Db)ir.next();
  78. i++;
  79. email = epd.getEmail();
  80. email_user = epd.getEmailUser();
  81. email_pwd = epd.getEmailPwd();
  82. id = epd.getId();
  83. mailserver = epd.getServer();
  84. port = epd.getPort();
  85. %>
  86.       <table width="98%" border="0" align="center" cellpadding="2" cellspacing="1">
  87.         <form id=formadd<%=i%> action="pop3_setup_do.jsp?op=edit" method=post>
  88.           <tr align="center" bgcolor="#EEEEEE" class="stable"> 
  89.             <td width="21%" rowspan="5"> <div align="left"><%=email%> 
  90.                 <input name=email type=hidden value="<%=email%>"><input type="hidden" name="id" value="<%=id%>">
  91.               </div>
  92.             <div align="center"></div></td>
  93.             <td width="17%">用户名 </td>
  94.             <td width="40%"><input name=emailUser class="singleboarder" id="emailUser" value="<%=email_user%>" size=25>            </td>
  95.             <td width="22%" rowspan="5"> <input name="Submit3" type="submit" class="button1" value="修改"> 
  96.             &nbsp; <input name="Submit4" type="button" class="button1" value="删除" onClick="javascript:window.location.href='pop3_setup_do.jsp?op=del&id=<%=id%>&email=<%=email%>'"></td>
  97.           </tr>
  98.           <tr align="center" bgcolor="#EEEEEE" class="stable">
  99.             <td>密&nbsp;&nbsp;&nbsp; 码</td>
  100.             <td><input name=emailPwd type=password class="singleboarder" id="emailPwd" value="<%=email_pwd%>" size=25></td>
  101.           </tr>
  102.           <tr align="center" bgcolor="#EEEEEE" class="stable"> 
  103.             <td>邮件服务器</td>
  104.             <td><input name=server class="singleboarder" id="server" value="<%=mailserver%>" size=25></td>
  105.           </tr>
  106.           <tr align="center" bgcolor="#EEEEEE" class="stable"> 
  107.             <td>smtp端口</td>
  108.             <td><input name=smtpPort class="singleboarder" value="<%=epd.getSmtpPort()%>" size=25></td>
  109.           </tr>
  110.           <tr align="center" bgcolor="#EEEEEE" class="stable">
  111.             <td>pop3端口</td>
  112.             <td><input name=port class="singleboarder" value="<%=port%>" size=25></td>
  113.           </tr>
  114.         </form>
  115.       </table>
  116.       <%
  117. }
  118. %>
  119.       <br>
  120.       <table width="58%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#E1E6EC" class="tableframe">
  121.         <form id=form1 name="form1" action="?op=add" method="post" onSubmit="return form1_onsubmit()">
  122.           <tr align="center"> 
  123.             <td colspan="2" class="right-title"><strong>增加邮箱</strong></td>
  124.           </tr>
  125.           <tr> 
  126.             <td align="right">邮&nbsp;&nbsp;&nbsp;&nbsp;箱:</td>
  127.             <td><input type=text class="singleboarder" size="20" name="email"></td>
  128.           </tr>
  129.           <tr> 
  130.             <td width="28%" align="right">用户名:</td>
  131.             <td width="72%"><input name="emailUser" type=text class="singleboarder" id="emailUser" size="20">            </td>
  132.           </tr>
  133.           <tr> 
  134.             <td align="right">密&nbsp;&nbsp;&nbsp;&nbsp;码:</td>
  135.             <td><input name="emailPwd" type=password class="singleboarder" id="emailPwd" size="20"></td>
  136.           </tr>
  137.           <tr> 
  138.             <td align="right">邮件服务器:</td>
  139.             <td><input name="server" type=text class="singleboarder" id="server" size="20"></td>
  140.           </tr>
  141.           <tr>
  142.             <td align="right">smtp端&nbsp;口:</td>
  143.             <td><input type=text class="singleboarder" size="20" name="smtpPort"></td>
  144.           </tr>
  145.           <tr>
  146.             <td align="right">pop3端口:</td>
  147.             <td><input type=text class="singleboarder" size="20" name="port"></td>
  148.           </tr>
  149.           <tr align="center"> 
  150.             <td colspan="2"><br> <input name="Submit" type="submit" class="singleboarder" value="提交"> 
  151.               &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input name="Submit2" type="reset" class="singleboarder" value="重置">            </td>
  152.           </tr>
  153.         </form>
  154.       </table>    
  155.       <br></td>
  156.   </tr>
  157. </table>
  158. </body>
  159. </html>