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

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html;charset=utf-8"%>
  2. <%@ page import = "java.net.URLEncoder"%>
  3. <%@ page import = "java.util.*"%>
  4. <%@ page import = "cn.js.fan.util.*"%>
  5. <%@ page import = "cn.js.fan.web.*"%>
  6. <%@ page import = "com.redmoon.oa.address.*"%>
  7. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  8. <html>
  9. <head>
  10. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  11. <title>添加分组类别</title>
  12. <link href="../common.css" rel="stylesheet" type="text/css">
  13. <%@ include file="../inc/nocache.jsp"%>
  14. <style type="text/css">
  15. <!--
  16. .style2 {font-size: 14px}
  17. .STYLE3 {color: #FFFFFF}
  18. .STYLE4 {
  19. color: #000000;
  20. font-weight: bold;
  21. }
  22. .STYLE5 {color: #FF0000}
  23. .STYLE6 {color: #000000}
  24. -->
  25. </style>
  26. </head>
  27. <body background="" leftmargin="0" topmargin="5" marginwidth="0" marginheight="0">
  28. <jsp:useBean id="fchar" scope="page" class="cn.js.fan.util.StrUtil"/>
  29. <jsp:useBean id="privilege" scope="page" class="com.redmoon.oa.pvg.Privilege"/>
  30. <%
  31. int type = ParamUtil.getInt(request, "type");
  32. String op = ParamUtil.get(request, "op");
  33. if (type==AddressDb.TYPE_PUBLIC) {
  34. if (!privilege.isUserPrivValid(request, "admin.address.public")) {
  35. out.print(SkinUtil.makeErrMsg(request, SkinUtil.LoadString(request, "pvg_invalid")));
  36. return;
  37. }
  38. }
  39. if (op.equals("add")) {
  40. AddressTypeMgr atm = new AddressTypeMgr();
  41. boolean re = false;
  42. try {
  43.   re = atm.create(request);
  44. }
  45. catch (ErrMsgException e) {
  46. out.print(StrUtil.Alert(e.getMessage()));
  47. }
  48. if (re)
  49. out.print(StrUtil.Alert("操作成功!"));
  50. }
  51. if (op.equals("del")) {
  52. AddressTypeMgr atm = new AddressTypeMgr();
  53. boolean re = false;
  54. try {
  55. re = atm.del(request);
  56. }
  57. catch (ErrMsgException e) {
  58. out.print(StrUtil.Alert(e.getMessage()));
  59. }
  60. if (re)
  61. out.print(StrUtil.Alert("操作成功!"));
  62. }
  63. %>
  64. <table width="541" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" class="tableframe">
  65. <tr>
  66.   <td height="23" background="../images/top-right.gif" class="right-title">&nbsp;分组类别管理</td>
  67. </tr>
  68.  
  69.       <tr>
  70.         <td align="center"><table width="88%"  border="0" cellpadding="0" cellspacing="0" class=" STYLE3 STYLE3">
  71.           <tr>
  72.             <td class="p14"></td>
  73.           </tr>
  74.           <tr> </tr>
  75.           
  76.           <tr>
  77.             <td class="p14"><%
  78.   AddressTypeDb atd = new AddressTypeDb();
  79.   String userName = privilege.getUser(request);
  80.   if (type==AddressDb.TYPE_PUBLIC)
  81.    userName = AddressTypeDb.PUBLIC;
  82.   String sql = "select id from address_type where USER_NAME=" + StrUtil.sqlstr(userName);
  83.   
  84.   Iterator ir = atd.list(sql).iterator();
  85.   while (ir.hasNext()) {
  86.    atd = (AddressTypeDb)ir.next();%> 
  87.                 <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
  88.                   <tr>
  89.     <td width="59%"><%=atd.getName()%></td>
  90.                     <td width="16%"><a href="address_type_edit.jsp?id=<%=atd.getId()%>">编辑</a></td>
  91.                     <td width="11%"><a href="#" onClick="if (confirm('您确定要删除<%=atd.getName()%>吗?')) window.location.href='?op=del&id=<%=atd.getId()%>&type=<%=type%>'">删除</a></td>
  92.                   </tr>
  93.                 </table>
  94.               <%}%>            </td>
  95.           </tr>
  96.         </table></td>
  97.       </tr>
  98.   
  99.   <tr> 
  100.   <tr>
  101.     <td></td>
  102.   </tr>
  103.   <form id=form1 name="form1" action="?op=add" method=post>
  104.     <td valign="top">
  105.     <tr>
  106.    <td>&nbsp;</td>
  107.     </tr>
  108.   <tr>
  109.         <td height="26" align="center"><span class="STYLE6">分组类别名称(<span class="STYLE5">*</span>)</span><span class="STYLE4">:</span>
  110.           <input name="name" width="200"><input name="type" value="<%=type%>" type="hidden">
  111.           &nbsp;&nbsp;&nbsp;&nbsp;
  112.           <input name="submit" type=submit class="button1" value="添  加">
  113.     &nbsp;</span></td>
  114.       </tr>
  115.   </form>
  116. </table>
  117. </td>
  118.   </tr>
  119.   <tr> 
  120.     <td height="9">&nbsp;</td>
  121.   </tr>
  122. <br>
  123. <br>
  124. </body>
  125. </html>