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

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>&nbsp;
  14. <a href="depArticleView.jsp">部门文章查看  </a>&nbsp;
  15. <a href="allArticleView.jsp">全局文章查看 </a>&nbsp;
  16. <br />
  17. <br />
  18. <%
  19. try{
  20.   String ud = (String)session.getAttribute("UD");
  21.   String udid = (String)session.getAttribute("UDID");
  22.   String un = (String)session.getAttribute("UN");
  23.   String uid = (String)session.getAttribute("UID");
  24.   String pp = (String)session.getAttribute("POPE");
  25.   String login = (String)session.getAttribute("LOGIN");
  26.   if(login!=null&&login.equals("OK")){
  27.   String where = "";
  28.   if(pp.equals("dep")){//部门权限
  29.     where = " depar = '"+udid+"' ";
  30. Connection conn=sql.getSQL2005conn("dbconfig.xml");
  31. if(request.getParameter("pageID")==null){
  32. }else{
  33.   fen.setpages(request.getParameter("pageID"));
  34. }
  35. String select = fen.getPageinfsql(12,"article","id","desc",where);
  36. //out.print(select);
  37. ResultSet show = sql.getStatement(select);
  38. %>
  39. <div align="center">
  40.   <table cellpadding="0" cellspacing="0" border="1" width="95%">
  41.     <tr>
  42.       <td>用户</td>
  43.       <td>文章标题</td>
  44.       <td>用户部门</td>
  45.       <td>发布时间</td>
  46.       <td>文章类型</td>
  47.     </tr>
  48.     <%
  49.     DBConn dbc = new DBConn();
  50.     String bmsql = "";
  51.     while(show.next()){
  52.       bmsql = "";
  53.       %>
  54.       <tr>
  55.         <td><%=show.getString("users") %></td>
  56.         <td><a href=showarticle.jsp?id=<%=show.getString("id")%>  ><%=show.getString("title") %></a> </td>
  57.         <td><%
  58.         bmsql ="select deparname from deparment where id = '"+show.getString("depar")+"'";
  59.           String[][] bm = dbc.getArray(bmsql);
  60.           out.print(bm[0][0]);
  61.           %></td>
  62.         <td><%=show.getString("date") %></td>
  63.         <td><%if(show.getString("type").equals("0")){
  64.           out.print("共享文章");
  65.         }else if(show.getString("type").equals("1")){
  66.           out.print("部门内文章");
  67.         }else if(show.getString("type").equals("2")){
  68.           out.print("多部门编辑文章");
  69.         } %></td>
  70.       </tr>
  71.       <%
  72.     }
  73.     out.println("</table>");
  74.     out.println("<div>"+fen.controlPage("depArticleView.jsp","pageID",8)+"</div>");
  75.     %>
  76. </div>
  77. <a href="" target="_blank"></a>
  78. <%
  79. show.close();
  80. sql.closeDB();
  81.   }else if(pp.equals("all")){//全局权限
  82.   out.print("你有全局权限,可以在全局文章查看中获得更加详细文章列表<br />");
  83. Connection conn=sql.getSQL2005conn("dbconfig.xml");
  84. if(request.getParameter("pageID")==null){
  85. }else{
  86.   fen.setpages(request.getParameter("pageID"));
  87. }
  88. String select = fen.getPageinfsql(12,"article","id","desc",where);
  89. //out.print(select);
  90. ResultSet show = sql.getStatement(select);
  91. %>
  92. <div align="center">
  93.   <table cellpadding="0" cellspacing="0" border="1" width="80%">
  94.     <tr>
  95.       <td>用户</td>
  96.       <td>文章标题</td>
  97.       <td>用户部门</td>
  98.       <td>发布时间</td>
  99.       <td>文章类型</td>
  100.     </tr>
  101.     <%
  102.     DBConn dbc = new DBConn();
  103.     String bmsql = "";
  104.     while(show.next()){ bmsql = "";
  105.       %>
  106.       <tr>
  107.         <td><%=show.getString("users") %></td>
  108.         <td><a href=showarticle.jsp?id=<%=show.getString("id")%> ><%=show.getString("title") %></a> </td>
  109.         <td><%
  110.         bmsql ="select deparname from deparment where id = '"+show.getString("depar")+"'";
  111.           String[][] bm = dbc.getArray(bmsql);
  112.           out.print(bm[0][0]);
  113.   %></td>
  114.         <td><%=show.getString("date") %></td>
  115.         <td><%if(show.getString("type").equals("0")){
  116.           out.print("共享文章");
  117.         }else if(show.getString("type").equals("1")){
  118.           out.print("部门内文章");
  119.         }else if(show.getString("type").equals("2")){
  120.           out.print("多部门编辑文章");
  121.         } %></td>
  122.       </tr>
  123.       <%
  124.     }
  125.     out.println("</table>");
  126.     out.println("<div>"+fen.controlPage("depArticleView.jsp","pageID",8)+"</div>");
  127.     %>
  128. </div>
  129. <a href="" target="_blank"></a>
  130. <%
  131. show.close();
  132. sql.closeDB();
  133.   } else if(pp.equals("com")){//普通权限
  134.     out.print("你没有权限查看这个页面!");
  135.   }
  136. }else{
  137.   response.sendRedirect("userlogin.jsp");
  138.   }
  139. }catch(Exception e){
  140.   e.printStackTrace();
  141. } %>
  142. </body>
  143. </html>