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

OA系统

开发平台:

Java

  1. <%@ page contentType="text/html; charset=GBK" import="java.sql.*,java.lang.*,officeol.mc.tools.*" %>
  2. <%request.setCharacterEncoding("gbk");%>
  3. <jsp:useBean id="sql" scope="page" class="control.sqlcontrol"></jsp:useBean>
  4. <jsp:useBean id="fen" scope="page" class="control.Textcontrol.Pagecontrol"></jsp:useBean>
  5. <html>
  6. <head>
  7. <title>
  8. 天津市河东区经济贸易委员会内部办公网
  9. </title>
  10. <h4>部门内文章列表</h4>
  11. </head>
  12. <body bgcolor="#ffffff">
  13. <a href="myArticleView.jsp">个人文章查看</a>
  14. <a href="depArticleView.jsp">部门文章查看</a>
  15. <a href="allArticleView.jsp">全局文章查看</a>
  16. <br />
  17. <%
  18. try{
  19.   String ud = (String)session.getAttribute("UD");
  20.   String udid = (String)session.getAttribute("UDID");
  21.   String un = (String)session.getAttribute("UN");
  22.   String uid = (String)session.getAttribute("UID");
  23.   String pp = (String)session.getAttribute("POPE");
  24.   String login = (String)session.getAttribute("LOGIN");
  25.   if(login!=null&&login.equals("OK")){
  26.   String where = "";
  27.   if(pp.equals("dep")){//部门权限
  28.     where = " depar = '"+udid+"' ";
  29. Connection conn=sql.getSQL2005conn("dbconfig.xml");
  30. if(request.getParameter("pageID")==null){
  31. }else{
  32.   fen.setpages(request.getParameter("pageID"));
  33. }
  34. String select = fen.getPageinfsql(12,"article","id","desc",where);
  35. out.print(select);
  36. ResultSet show = sql.getStatement(select);
  37. %>
  38. <div align="center">
  39.   <table cellpadding="0" cellspacing="0" border="1" width="80%">
  40.     <tr>
  41.       <td>用户</td>
  42.       <td>文章标题</td>
  43.       <td>用户部门</td>
  44.       <td>发布时间</td>
  45.       <td>文章类型</td>
  46.     </tr>
  47.     <%
  48.     DBConn dbc = new DBConn();
  49.     String bmsql = "";
  50.     while(show.next()){
  51.       bmsql = "";
  52.       %>
  53.       <tr>
  54.         <td><%=show.getString("users") %></td>
  55.         <td><a href=showarticle.jsp?id=<%=show.getString("id")%> target="_blank" ><%=show.getString("title") %></a> </td>
  56.         <td><%
  57.         bmsql ="select deparname from deparment where id = '"+show.getString("depar")+"'";
  58.           String[][] bm = dbc.getArray(bmsql);
  59.           out.print(bm[0][0]);
  60.           %></td>
  61.         <td><%=show.getString("date") %></td>
  62.         <td><%=show.getString("type").equals("0")?"共享文章":"部门内文章" %></td>
  63.       </tr>
  64.       <%
  65.     }
  66.     out.println("</table>");
  67.     out.println("<div>"+fen.controlPage("depArticleView.jsp","pageID",8)+"</div>");
  68.     %>
  69. </div>
  70. <a href="" target="_blank"></a>
  71. <%
  72. show.close();
  73. sql.closeDB();
  74.   }else if(pp.equals("all")){//全局权限
  75.   out.print("你有全局权限,可以在全局文章查看中获得更加详细文章列表<br />");
  76. Connection conn=sql.getSQL2005conn("dbconfig.xml");
  77. if(request.getParameter("pageID")==null){
  78. }else{
  79.   fen.setpages(request.getParameter("pageID"));
  80. }
  81. String select = fen.getPageinfsql(12,"article","id","desc",where);
  82. //out.print(select);
  83. ResultSet show = sql.getStatement(select);
  84. %>
  85. <div align="center">
  86.   <table cellpadding="0" cellspacing="0" border="1" width="80%">
  87.     <tr>
  88.       <td>用户</td>
  89.       <td>文章标题</td>
  90.       <td>用户部门</td>
  91.       <td>发布时间</td>
  92.       <td>文章类型</td>
  93.     </tr>
  94.     <%
  95.     DBConn dbc = new DBConn();
  96.     String bmsql = "";
  97.     while(show.next()){ bmsql = "";
  98.       %>
  99.       <tr>
  100.         <td><%=show.getString("users") %></td>
  101.         <td><a href=showarticle.jsp?id=<%=show.getString("id")%> target="_blank" ><%=show.getString("title") %></a> </td>
  102.         <td><%
  103.         bmsql ="select deparname from deparment where id = '"+show.getString("depar")+"'";
  104.           String[][] bm = dbc.getArray(bmsql);
  105.           out.print(bm[0][0]);
  106.   %></td>
  107.         <td><%=show.getString("date") %></td>
  108.         <td><%=show.getString("type").equals("0")?"共享文章":"部门内文章" %></td>
  109.       </tr>
  110.       <%
  111.     }
  112.     out.println("</table>");
  113.     out.println("<div>"+fen.controlPage("depArticleView.jsp","pageID",8)+"</div>");
  114.     %>
  115. </div>
  116. <a href="" target="_blank"></a>
  117. <%
  118. show.close();
  119. sql.closeDB();
  120.   } else if(pp.equals("com")){//普通权限
  121.     out.print("你没有权限查看这个页面!");
  122.   }
  123. }else{
  124.   response.sendRedirect("userlogin.jsp");
  125.   }
  126. }catch(Exception e){
  127.   e.printStackTrace();
  128. } %>
  129. </body>
  130. </html>