allArticleView.jsp~23~
上传用户: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. <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. <a href="editArticleView.jsp">多部门修改文章查看</a>&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("dep")){//部门权限
  29.     out.print("你只有部门权限, 只能查看本部门内的文章列表!");
  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="80%">
  42.         <tr>
  43.           <td>用户</td>
  44.           <td>文章标题</td>
  45.           <td>用户部门</td>
  46.           <td>发布时间</td>
  47.           <td>文章类型</td>
  48.         </tr>
  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><%       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("allArticleView.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. DBConn dbc = new DBConn();
  82. String udd = "select deparname,dnmd5 from deparment";
  83. String[][] bm = dbc.getArray(udd);
  84. if(bm == null){
  85.   out.print("没有部门!");
  86. }else{
  87.   out.print("请选择要部门:<br />");
  88.   for(int i = 0; i < bm.length; i++){
  89.     %>
  90.     <a href="articlelist.jsp?bm=<%=bm[i][1] %>"><%=bm[i][0] %></a><br />
  91.     <%
  92.     }
  93. }
  94. }else if(pp.equals("com")){//普通权限
  95. out.print("你没有权限查看这个页面!");
  96. }
  97. }else{
  98.   response.sendRedirect("userlogin.jsp");
  99.   }
  100. }catch(Exception e){
  101.   e.printStackTrace();
  102. } %>
  103. </body>
  104. </html>