depArticleView.jsp~40~
上传用户: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")%>  ><%=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><%if(show.getString("type").equals("0")){
  63.           out.print("共享文章");
  64.         }else if(show.getString("type").equals("1")){
  65.           out.print("部门内文章");
  66.         }else if(show.getString("type").equals("2")){
  67.           out.print("多部门编辑文章");
  68.         } %></td>
  69.       </tr>
  70.       <%
  71.     }
  72.     out.println("</table>");
  73.     out.println("<div>"+fen.controlPage("depArticleView.jsp","pageID",8)+"</div>");
  74.     %>
  75. </div>
  76. <a href="" target="_blank"></a>
  77. <%
  78. show.close();
  79. sql.closeDB();
  80.   }else if(pp.equals("all")){//全局权限
  81.   out.print("你有全局权限,可以在全局文章查看中获得更加详细文章列表<br />");
  82. Connection conn=sql.getSQL2005conn("dbconfig.xml");
  83. if(request.getParameter("pageID")==null){
  84. }else{
  85.   fen.setpages(request.getParameter("pageID"));
  86. }
  87. String select = fen.getPageinfsql(12,"article","id","desc",where);
  88. //out.print(select);
  89. ResultSet show = sql.getStatement(select);
  90. %>
  91. <div align="center">
  92.   <table cellpadding="0" cellspacing="0" border="1" width="80%">
  93.     <tr>
  94.       <td>用户</td>
  95.       <td>文章标题</td>
  96.       <td>用户部门</td>
  97.       <td>发布时间</td>
  98.       <td>文章类型</td>
  99.     </tr>
  100.     <%
  101.     DBConn dbc = new DBConn();
  102.     String bmsql = "";
  103.     while(show.next()){ bmsql = "";
  104.       %>
  105.       <tr>
  106.         <td><%=show.getString("users") %></td>
  107.         <td><a href=showarticle.jsp?id=<%=show.getString("id")%> ><%=show.getString("title") %></a> </td>
  108.         <td><%
  109.         bmsql ="select deparname from deparment where id = '"+show.getString("depar")+"'";
  110.           String[][] bm = dbc.getArray(bmsql);
  111.           out.print(bm[0][0]);
  112.   %></td>
  113.         <td><%=show.getString("date") %></td>
  114.         <td><%if(show.getString("type").equals("0")){
  115.           out.print("共享文章");
  116.         }else if(show.getString("type").equals("1")){
  117.           out.print("部门内文章");
  118.         }else if(show.getString("type").equals("2")){
  119.           out.print("多部门编辑文章");
  120.         } %></td>
  121.       </tr>
  122.       <%
  123.     }
  124.     out.println("</table>");
  125.     out.println("<div>"+fen.controlPage("depArticleView.jsp","pageID",8)+"</div>");
  126.     %>
  127. </div>
  128. <a href="" target="_blank"></a>
  129. <%
  130. show.close();
  131. sql.closeDB();
  132.   } else if(pp.equals("com")){//普通权限
  133.     out.print("你没有权限查看这个页面!");
  134.   }
  135. }else{
  136.   response.sendRedirect("userlogin.jsp");
  137.   }
  138. }catch(Exception e){
  139.   e.printStackTrace();
  140. } %>
  141. </body>
  142. </html>