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

OA系统

开发平台:

Java

  1. <%@ page contentType="text/html; charset=GBK" import="officeol.mc.tools.*,control.Textcontrol.*" %>
  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. <%
  14. try{
  15.   String message = request.getAttribute("msg")==null?"":request.getAttribute("msg").toString();
  16.   out.print(message);
  17.   String ud = (String)session.getAttribute("UD");
  18.   String udid = (String)session.getAttribute("UDID");
  19.   String un = (String)session.getAttribute("UN");
  20.   String uid = (String)session.getAttribute("UID");
  21.   String pp = (String)session.getAttribute("POPE");
  22.   String login = (String)session.getAttribute("LOGIN");
  23.   if(login!=null&&login.equals("OK")){
  24.     DBConn dbc = new DBConn();
  25.     Pagecontrol pct = new Pagecontrol();
  26.     if(request.getParameter("pageID")==null){
  27.     }else{
  28.       pct.setpages(request.getParameter("pageID"));
  29.     }
  30.     String sql = "";
  31.     String sql1 = "";
  32.     boolean temp = true;
  33.     if(pp.equals("com")){//普通权限
  34.     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";
  35.     sql = pct.getPageinfsql(3,"files","id","desc","filetype=0 and upuserid = "+uid);
  36.     //out.print(sql);
  37.     //sql = "select * from files where upuserid = "+uid+" ";
  38.   }else if(pp.equals("dep")){//部门权限
  39.   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 ";
  40.   sql = "select * from files where upuserdeparid = "+udid+" ";
  41.   sql = pct.getPageinfsql(3,"files","id","desc","filetype=0 and upuserid = "+uid);
  42. }else if(pp.equals("all")){//全局权限
  43. 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 ";
  44. sql = "select * from files where upuserdeparid = "+udid+" ";
  45. }else{//没有权限
  46. temp = false;
  47. }
  48. if(temp){
  49.   //out.print(sql);
  50.   String[][] df = dbc.getArray(sql);
  51.   if(df!=null){
  52.     %>
  53.     <table border="1">
  54.       <tr>
  55.         <td colspan="7">文件下载列表</td>
  56.       </tr>
  57.       <tr>
  58.         <td>上传文件名</td>
  59.         <td>上传文件说明</td>
  60.         <td>上传日期</td>
  61.         <td>上传人</td>
  62.         <td>上传部门</td>
  63.         <td>文件类型</td>
  64.         <td>下载文件</td>
  65.       </tr>
  66.       <%
  67.       for(int i = 0; i < df.length; i++){
  68.         %>
  69.         <tr>
  70.           <td><%=df[i][1] %></td>
  71.           <td><%=df[i][4] %></td>
  72.           <td><%=df[i][2] %></td>
  73.           <td><%=df[i][3] %></td>
  74.           <td><%=df[i][5] %></td>
  75.           <td><%if(df[i][7]!=null)out.print(df[i][7].equals("0")?"部门内":"共享");
  76.             %></td>
  77.             <td>
  78.               <a href="download.jsp?fn=<%=df[i][6] %>">下载文件</a>
  79.             </td>
  80.             <%
  81.             }
  82.             %>
  83.             <tr>
  84.             <td colspan="7"><%out.println("<div>"+pct.controlPage("filedown.jsp","pageID",8)+"</div>"); %></td>
  85.             </tr>
  86.             <%
  87.           }
  88.         }else{
  89.           out.print("你没有权限查看这个页面!");
  90.         }
  91.       }else{
  92.         response.sendRedirect("userlogin.jsp");
  93.       }
  94.     }catch(Exception ex){
  95.       ex.printStackTrace();
  96.     }
  97. %>
  98. </body>
  99. </html>