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

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. <h4>
  11. 部门用户添加
  12. </h4>
  13. <p>
  14.   <%
  15. String message = request.getAttribute("msg")==null?"":request.getAttribute("msg").toString();
  16. out.print(message);
  17. DBConn dbc = new DBConn();
  18. String dm = request.getParameter("dep");
  19. String depsql = "select id,deparname from deparment where dnmd5 ='"+dm+"' ";
  20. //out.print(depsql+"<br />");
  21. String[][] dep = dbc.getArray(depsql);
  22. String unsql = "select * from [user] where deparment = 0 ";
  23. //out.print(unsql+"<br />");
  24. String[][] un = dbc.getArray(unsql);
  25. String usql = "select ud.userid,u.username from userdepar as ud inner join [user] as u on ud.userid = u.id where deparid = "+dep[0][0]
  26. +" group by ud.userid,u.username";
  27. //out.print(usql+"<br />");
  28. String[][] user = dbc.getArray(usql);
  29. %>
  30. </p>
  31. <a href="userdeparadd.jsp">用户部门添加</a>
  32. <a href="userdeparmod.jsp">用户部门修改</a>
  33. <a href="deparusermod.jsp">部门所属用户修改</a><br />
  34. <form name="form1" method="post" action="deparuserAddAction.do">
  35.   <table width="90%" border="1">
  36.     <tr>
  37.       <td>部门</td>
  38.       <td>
  39.       <input type="hidden" name="dep" value="<%=dep[0][0] %>" />
  40.       <%=dep[0][1] %>
  41.             </td>
  42.       <td>&nbsp;</td>
  43.     </tr>
  44.     <tr>
  45.       <td colspan="3">部门用户</td>
  46.     </tr>
  47.     <%
  48.     int j = 0;
  49.     if(user!=null){
  50.       for(int i = 0; i < user.length; i++){
  51.         j++;
  52.         String check = "checked="checked"";
  53.         %>
  54.         <tr>
  55.           <td>
  56.             <input name="un<%=i%>" type="checkbox" value="<%=user[i][0] %>" <%=check%>/>
  57.           </td>
  58.           <td>
  59.             <%=user[i][1] %>
  60.           </td>
  61.           <td>&nbsp;</td>
  62.         </tr>
  63.         <%
  64.         }
  65.       }
  66. if(un!=null){
  67.   for(int i = 0; i < un.length; i++){
  68.     %>
  69.     <tr>
  70.       <td>
  71.         <input name="un<%=j%>" type="checkbox" value="<%=un[i][0] %>"/>
  72.       </td>
  73.       <td>
  74.         <%=un[i][1] %>
  75.       </td>
  76.       <td>&nbsp;</td>
  77.     </tr>
  78.     <%
  79.     j++;
  80.   }
  81. }
  82.         %>
  83.         <tr>
  84.           <td colspan="3">
  85.             <input type="hidden" value="<%=j%>" name="j" />
  86.             <input type="submit" name="Submit" value="保存">
  87.           </td>
  88.         </tr>
  89.   </table>
  90. </form>
  91. <p>&nbsp;</p>
  92. </body>
  93. </html>