usergroupadd.jsp~53~
上传用户:dlqqsh
上传日期:2021-11-13
资源大小:7840k
文件大小:3k
源码类别:

OA系统

开发平台:

Java

  1. <%@ page contentType="text/html; charset=GBK" import="officeol.mc.tools.*" %>
  2. <%request.setCharacterEncoding("GBK"); %>
  3. <html>
  4. <head>
  5. <title>
  6. 天津市河东区经济贸易委员会内部办公网
  7. </title>
  8. </head>
  9. <body bgcolor="#ffffff">
  10. <h1>
  11. 用户组添加
  12. </h1>
  13. <br />
  14. 第一步,添加用户组所属部门
  15. <%
  16. String message = request.getAttribute("msg")==null?"":request.getAttribute("msg").toString();
  17. out.print(message);
  18. DBConn dbc = new DBConn();
  19. String un = (String)session.getAttribute("un");
  20. String uid = (String)session.getAttribute("uid");
  21. String ud = (String)session.getAttribute("ud");
  22. String udid = (String)session.getAttribute("udid");
  23. String[][] pope = (String[][])session.getAttribute("pope");
  24. PopedomCheck pc = new PopedomCheck();
  25. String pageType = "pope";
  26. String op = "add";
  27. if(un!=null && ud!=null&&pope!=null){
  28. if(pc.getPagePope(pageType,pope)){
  29. String fw = pc.getFanwei(pageType,op,pope);
  30. boolean temp = true;
  31. String add ="";
  32. System.out.println("fw"+fw);
  33. if(fw.equals("com")){//普通权限
  34. temp = false;
  35. }else if(fw.equals("dep")){//部门权限
  36. add = " where deparname = '"+ud+"'";
  37. }else if(fw.equals("all")){//全局权限
  38. }else{//没有权限
  39.   temp = false;
  40. }
  41. if(temp){
  42. //String usql = "select u.id,u.username,d.deparname from [user] AS u inner join deparment AS d on u.deparment = d.id";
  43. //注意添加权限SQL
  44. //String[][] users = dbc.getArray(usql);
  45. //如果是某个部门则只能是这个部门,注意权限
  46. String dsql = "select * from deparment "+add;
  47. out.print(dsql);
  48. String[][] dep = dbc.getArray(dsql);
  49. if(dep==null){
  50.   out.print("系统没用部门!");
  51. }else{
  52.   %>
  53.   <form name="form1" method="post" action="usergroupadds2.jsp">
  54.   <table width="90%" border="1">
  55.     <tr>
  56.       <td><div align="center">用户组名</div></td>
  57.       <td colspan="3"><div align="center">
  58.         <input type="text" name="ugname">
  59. </div></td>
  60.     </tr>
  61.     <tr>
  62.       <td>用户组所属部门</td>
  63.       <td>
  64.         <select name="dep">
  65.         <%for(int i = 0; i < dep.length; i++){ %>
  66.         <option value="<%=dep[i][0]%>"><%=dep[i][1] %></option>
  67.         <%
  68.         }
  69.         %>
  70.       </select></td>
  71.       <td>&nbsp;</td>
  72.       <td>&nbsp;</td>
  73.     </tr>
  74.       <tr>
  75.         <td colspan="4"><div align="center">
  76.           <input type="submit" name="Submit" value="提交">
  77. </div></td>
  78.       </tr>
  79.   </table>
  80.   </form>
  81.   <%
  82.   }}else{
  83.   out.print("你没有权限查看这个页面!");
  84. }
  85. }else{
  86.   out.print("你没有权限查看这个页面!");
  87. }
  88. }else{
  89.     out.print("请登录!");
  90.     %>
  91.     <br /><a href="userlogin.jsp" target="mainFrame">用户登录</a>
  92.     <%
  93.   }
  94.   %>
  95.   </body>
  96. </html>