depFiles.jsp~12~
资源名称:bangong.rar [点击查看]
上传用户:dlqqsh
上传日期:2021-11-13
资源大小:7840k
文件大小:4k
源码类别:
OA系统
开发平台:
Java
- <%@ page contentType="text/html; charset=GBK" import="officeol.mc.tools.*,control.Textcontrol.*" %>
- <%request.setCharacterEncoding("GBK"); %>
- <html>
- <head>
- <title>
- 天津市河东区经济贸易委员会内部办公网
- </title>
- </head>
- <body bgcolor="#ffffff">
- <h4>
- 部门内文件管理
- </h4>
- <%
- try{
- String message = request.getAttribute("msg")==null?"":request.getAttribute("msg").toString();
- out.print(message);
- String ud = (String)session.getAttribute("UD");
- String udid = (String)session.getAttribute("UDID");
- String un = (String)session.getAttribute("UN");
- String uid = (String)session.getAttribute("UID");
- String pp = "com";//(String)session.getAttribute("POPE");
- String login = (String)session.getAttribute("LOGIN");
- if(login!=null&&login.equals("OK")){
- DBConn dbc = new DBConn();
- Pagecontrol pct = new Pagecontrol();
- if(request.getParameter("pageID")==null){
- }else{
- pct.setpages(request.getParameter("pageID"));
- }
- String sql = "";
- String sql1 = "";
- boolean temp = true;
- if(pp.equals("com")){//普通权限
- //sql = " select f.*,u.username,d.deparname from files as f inner join [user] as u on u.id = f.upuserid inner join deparment as d on d.id = f.upuserdeparid and f.upuserid = "+uid+" order by uptime desc";
- //sql = pct.getPageinfsql(20,"files","id","desc","filetype=0 and upuserid = "+uid);
- //out.print(sql);
- //sql = "select * from files where upuserid = "+uid+" ";
- temp =false;
- out.print("你没有权限查看这个页面!");
- }else if(pp.equals("dep")){//部门权限
- sql = " select f.*,u.username,d.deparname from files as f inner join [user] as u on u.id = f.upuserid inner join deparment as d on d.id = f.upuserdeparid and f.upuserdeparid = '"+udid+"' order by uptime desc ";
- sql = pct.getPageinfsql(20,"files","id","desc","upuserdeparid = "+udid);
- //sql = pct.getPageinfsql(20,"files","id","desc","filetype=0 and upuserdeparid = "+udid);
- }else if(pp.equals("all")){//全局权限
- sql = " select f.*,u.username,d.deparname from files as f inner join [user] as u on u.id = f.upuserid inner join deparment as d on d.id = f.upuserdeparid order by uptime desc ";
- sql = pct.getPageinfsql(20,"files","id","desc","upuserdeparid = "+udid);
- }else{//没有权限
- temp = false;
- }
- //sql = pct.getPageinfsql(20,"files","id","desc","upuserdeparid = "+udid);
- if(temp){
- //out.print(sql);
- String[][] df = dbc.getArray(sql);
- if(df!=null){
- %>
- <table border="1">
- <tr>
- <td colspan="7">文件下载列表</td>
- </tr>
- <tr>
- <td>上传文件名</td>
- <td>上传文件说明</td>
- <td>上传日期</td>
- <td>上传人</td>
- <td>上传部门</td>
- <td>文件类型</td>
- <td>修改文件</td>
- <td>删除文件</td>
- </tr>
- <%
- for(int i = 0; i < df.length; i++){
- %>
- <tr>
- <td><%=df[i][1] %></td>
- <td><%=df[i][4] %></td>
- <td><%=df[i][2] %></td>
- <td><%String usql = "select username from [user] where id="+
- df[i][3];
- String[][] uuu = dbc.getArray(usql);
- out.print(uuu[0][0]);
- %></td>
- <td><%
- String udsql = "select deparname from [deparment] where id="+
- df[i][5];
- String[][] ddd = dbc.getArray(udsql);
- out.print(ddd[0][0]);
- %></td>
- <td><%if(df[i][7]!=null)out.print(df[i][7].equals("0")?"部门内":"共享");
- %></td>
- <td>
- <a href="fileEdit.jsp?fn=<%=df[i][0] %>">修改</a>
- </td>
- <td><a href="fileDel.jsp?fn=<%=df[i][0] %>">删除</a></td>
- <%
- }
- %>
- <tr>
- <td colspan="7"><%out.println("<div>"+pct.controlPage("filedown.jsp","pageID",8)+"</div>"); %></td>
- </tr>
- <%
- }
- }else{
- out.print("你没有权限查看这个页面!");
- }
- }else{
- response.sendRedirect("userlogin.jsp");
- }
- }catch(Exception ex){
- ex.printStackTrace();
- }
- %>
- </body>
- </html>