articlelist.jsp~103~
上传用户: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. <h4>全局文章查看</h4>
  13. <a href="myArticleView.jsp">个人文章查看  </a>&nbsp;
  14. <a href="depArticleView.jsp">部门文章查看  </a>&nbsp;
  15. <a href="allArticleView.jsp">全局文章查看 </a>&nbsp;
  16. &nbsp;&nbsp;<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("all")){//全局权限
  29.     String bm = request.getParameter("bm");
  30.     if(bm!=null){
  31.       DBConn dbc = new DBConn();
  32.       String dn = "select id,deparname from deparment where dnmd5 ='"+bm+"'";
  33.       //System.out.print(dn);
  34.       String[][] bmm = dbc.getArray(dn);
  35.       out.print("<font size="5" color="red">"+bmm[0][1]+" 日志列表</font><vr />");
  36.       where = " depar = '"+bmm[0][0]+"' ";
  37.       Connection conn=sql.getSQL2005conn("dbconfig.xml");
  38.       if(request.getParameter("pageID")==null){
  39.       }else{
  40.         fen.setpages(request.getParameter("pageID"));
  41.       }
  42.       String select = fen.getPageinfsql(12,"article","id","desc",where);
  43.       //out.print(select);
  44.       ResultSet show = sql.getStatement(select);
  45.       %>
  46.       <div align="center">
  47.         <table cellpadding="0" cellspacing="0" border="1" width="95%">
  48.           <tr>
  49.             <td>用户</td>
  50.             <td>文章标题</td>
  51.             <td>用户部门</td>
  52.             <td>发布时间</td>
  53.             <td>文章类型</td>
  54.           </tr>
  55.           <%
  56.           while(show.next()){
  57.             String bmsql = "";
  58.             %>
  59.             <tr>
  60.               <td><%=show.getString("users") %></td>
  61.               <td><a href=showarticle.jsp?id=<%=show.getString("id")%>  ><%=show.getString("title") %></a> </td>
  62.               <td><%        bmsql ="select deparname from deparment where id = '"+show.getString("depar")+"'";
  63.           String[][] bm1 = dbc.getArray(bmsql);
  64.           out.print(bm1[0][0]);
  65.  %></td>
  66.               <td><%=show.getString("date") %></td>
  67.               <td><%if(show.getString("type").equals("0")){
  68.           out.print("共享文章");
  69.         }else if(show.getString("type").equals("1")){
  70.           out.print("部门内文章");
  71.         }else if(show.getString("type").equals("2")){
  72.           out.print("多部门编辑文章");
  73.         } %></td>
  74.             </tr>
  75.             <%
  76.           }
  77.           out.println("</table>");
  78.           out.println("<div>"+fen.controlPage("articlelist.jsp","bm="+bm+"&"+"pageID",8)+"</div>");
  79.           %>
  80. </div>
  81. </body>
  82. </html>
  83. <%
  84. show.close();
  85. sql.closeDB();
  86. }
  87. }else if(pp.equals("com")){//普通权限
  88. out.print("你没有权限查看这个页面!");
  89. }else if(pp.equals("dep")){//部门权限
  90. out.print("你没有权限查看这个页面!");
  91. }
  92. }else{
  93.   response.sendRedirect("userlogin.jsp");
  94.   }
  95. }catch(Exception e){
  96.   e.printStackTrace();
  97. } %>