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