deparuseradd.jsp~72~
上传用户: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. <h1>
  11. 部门用户添加
  12. </h1>
  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. <form name="form1" method="post" action="deparuserAddAction.do">
  32.   <table width="90%" border="1">
  33.     <tr>
  34.       <td>部门</td>
  35.       <td>
  36.       <input type="hidden" name="dep" value="<%=dep[0][0] %>" />
  37.       <%=dep[0][1] %>
  38.             </td>
  39.       <td>&nbsp;</td>
  40.     </tr>
  41.     <tr>
  42.       <td colspan="3">部门用户</td>
  43.     </tr>
  44.     <%
  45.     int j = 0;
  46.     if(user!=null){
  47.       for(int i = 0; i < user.length; i++){
  48.         j++;
  49.         String check = "checked="checked"";
  50.         %>
  51.         <tr>
  52.           <td>
  53.             <input name="un<%=i%>" type="checkbox" value="<%=user[i][0] %>" <%=check%>/>
  54.           </td>
  55.           <td>
  56.             <%=user[i][1] %>
  57.           </td>
  58.           <td>&nbsp;</td>
  59.         </tr>
  60.         <%
  61.         }
  62.       }
  63.       for(int i = 0; i < un.length; i++){
  64.         %>
  65.         <tr>
  66.           <td>
  67.             <input name="un<%=j%>" type="checkbox" value="<%=un[i][0] %>"/>
  68.           </td>
  69.           <td>
  70.             <%=un[i][1] %>
  71.           </td>
  72.           <td>&nbsp;</td>
  73.         </tr>
  74.         <%
  75.         j++;
  76.         }
  77.         %>
  78.         <tr>
  79.           <td colspan="3">
  80.             <input type="hidden" value="<%=j%>" name="j" />
  81.             <input type="submit" name="Submit" value="提交">
  82.           </td>
  83.         </tr>
  84.   </table>
  85. </form>
  86. <p>&nbsp;</p>
  87. </body>
  88. </html>