myArticleView.jsp~26~
上传用户: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. <a href="myArticleView.jsp">个人文章查看  </a>&nbsp;
  15. <a href="depArticleView.jsp">部门文章查看  </a>&nbsp;
  16. <a href="allArticleView.jsp">全局文章查看 </a>&nbsp;
  17. &nbsp;&nbsp;<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 = " users = '"+un+"' ";
  29. Connection conn=sql.getSQL2005conn("dbconfig.xml");
  30. if(request.getParameter("pageID")==null){
  31. }else{
  32.   fen.setpages(request.getParameter("pageID"));
  33. }
  34. String select = fen.getPageinfsql(12,"article","id","desc",where);
  35. //out.print(select);
  36. ResultSet show = sql.getStatement(select);
  37. %>
  38. <div align="center">
  39.   <table cellpadding="0" cellspacing="0" border="1" width="95%">
  40.     <tr>
  41.       <td>用户</td>
  42.       <td>文章标题</td>
  43.       <td>用户部门</td>
  44.       <td>发布时间</td>
  45.       <td>文章类型</td>
  46.     </tr>
  47.     <%
  48.     DBConn dbc = new DBConn();
  49.     String bmsql = "";
  50.     while(show.next()){
  51.       bmsql = "";
  52.       %>
  53.       <tr>
  54.         <td><%=show.getString("users") %></td>
  55.         <td><a href=showarticle.jsp?id=<%=show.getString("id")%> ><%=show.getString("title") %></a> </td>
  56.         <td><%
  57.           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("myArticleView.jsp","pageID",8)+"</div>");
  74.     %>
  75. </div>
  76. <a href="" target="_blank"></a>
  77. </body>
  78. </html>
  79. <%
  80. show.close();
  81. sql.closeDB();
  82. }else{
  83.   response.sendRedirect("userlogin.jsp");
  84.   }
  85. }catch(Exception e){
  86.   e.printStackTrace();
  87. } %>