myArticleView.jsp~27~
上传用户: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. <br />
  15. <a href="myArticleView.jsp">个人文章查看  </a>&nbsp;
  16. <a href="depArticleView.jsp">部门文章查看  </a>&nbsp;
  17. <a href="allArticleView.jsp">全局文章查看 </a>&nbsp;
  18. &nbsp;&nbsp;<br />
  19. <br />
  20. <%
  21. try{
  22.   String ud = (String)session.getAttribute("UD");
  23.   String udid = (String)session.getAttribute("UDID");
  24.   String un = (String)session.getAttribute("UN");
  25.   String uid = (String)session.getAttribute("UID");
  26.   String pp = (String)session.getAttribute("POPE");
  27.   String login = (String)session.getAttribute("LOGIN");
  28.   if(login!=null&&login.equals("OK")){
  29.   String where = " users = '"+un+"' ";
  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("myArticleView.jsp","pageID",8)+"</div>");
  75.     %>
  76. </div>
  77. <a href="" target="_blank"></a>
  78. </body>
  79. </html>
  80. <%
  81. show.close();
  82. sql.closeDB();
  83. }else{
  84.   response.sendRedirect("userlogin.jsp");
  85.   }
  86. }catch(Exception e){
  87.   e.printStackTrace();
  88. } %>