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

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. &nbsp;&nbsp;<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.     out.print("你只有部门权限, 只能查看本部门内的文章列表!");
  31.     where = " depar = '"+udid+"' ";
  32.     Connection conn=sql.getSQL2005conn("dbconfig.xml");
  33.     if(request.getParameter("pageID")==null){
  34.     }else{
  35.       fen.setpages(request.getParameter("pageID"));
  36.     }
  37.     String select = fen.getPageinfsql(12,"article","id","desc",where);
  38.     //out.print(select);
  39.     ResultSet show = sql.getStatement(select);
  40.     %>
  41.     <div align="center">
  42.       <table cellpadding="0" cellspacing="0" border="1" width="95%">
  43.         <tr>
  44.           <td>用户</td>
  45.           <td>文章标题</td>
  46.           <td>用户部门</td>
  47.           <td>发布时间</td>
  48.           <td>文章类型</td>
  49.         </tr>
  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><%       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("allArticleView.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. DBConn dbc = new DBConn();
  83. String udd = "select deparname,dnmd5 from deparment";
  84. String[][] bm = dbc.getArray(udd);
  85. if(bm == null){
  86.   out.print("没有部门!");
  87. }else{
  88.   out.print("请选择要部门:<br /><br />");
  89.   for(int i = 0; i < bm.length; i++){
  90.     %>
  91.     &nbsp;&nbsp;<a href="articlelist.jsp?bm=<%=bm[i][1] %>"><%=bm[i][0] %></a><br /><br />
  92.     <%
  93.     }
  94. }
  95. }else if(pp.equals("com")){//普通权限
  96. out.print("你没有权限查看这个页面!");
  97. }
  98. }else{
  99.   response.sendRedirect("userlogin.jsp");
  100.   }
  101. }catch(Exception e){
  102.   e.printStackTrace();
  103. } %>
  104. </body>
  105. </html>