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