myArticleView.jsp~20~
上传用户: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. <%
  18. try{
  19.   String ud = (String)session.getAttribute("UD");
  20.   String udid = (String)session.getAttribute("UDID");
  21.   String un = (String)session.getAttribute("UN");
  22.   String uid = (String)session.getAttribute("UID");
  23.   String pp = (String)session.getAttribute("POPE");
  24.   String login = (String)session.getAttribute("LOGIN");
  25.   if(login!=null&&login.equals("OK")){
  26.   String where = " users = '"+un+"' ";
  27. Connection conn=sql.getSQL2005conn("dbconfig.xml");
  28. if(request.getParameter("pageID")==null){
  29. }else{
  30.   fen.setpages(request.getParameter("pageID"));
  31. }
  32. String select = fen.getPageinfsql(12,"article","id","desc",where);
  33. //out.print(select);
  34. ResultSet show = sql.getStatement(select);
  35. %>
  36. <div align="center">
  37.   <table cellpadding="0" cellspacing="0" border="1" width="80%">
  38.     <tr>
  39.       <td>用户</td>
  40.       <td>文章标题</td>
  41.       <td>用户部门</td>
  42.       <td>发布时间</td>
  43.       <td>文章类型</td>
  44.     </tr>
  45.     <%
  46.     DBConn dbc = new DBConn();
  47.     String bmsql = "";
  48.     while(show.next()){
  49.       bmsql = "";
  50.       %>
  51.       <tr>
  52.         <td><%=show.getString("users") %></td>
  53.         <td><a href=showarticle.jsp?id=<%=show.getString("id")%> ><%=show.getString("title") %></a> </td>
  54.         <td><%
  55.           bmsql ="select deparname from deparment where id = '"+show.getString("depar")+"'";
  56.           String[][] bm = dbc.getArray(bmsql);
  57.           out.print(bm[0][0]);
  58.         %></td>
  59.         <td><%=show.getString("date") %></td>
  60.         <td><%if(show.getString("type").equals("0")){
  61.           out.print("共享文章");
  62.         }else if(show.getString("type").equals("1")){
  63.           out.print("部门内文章");
  64.         }else if(show.getString("type").equals("2")){
  65.           out.print("多部门编辑文章");
  66.         } %></td>
  67.       </tr>
  68.       <%
  69.     }
  70.     out.println("</table>");
  71.     out.println("<div>"+fen.controlPage("myArticleView.jsp","pageID",8)+"</div>");
  72.     %>
  73. </div>
  74. <a href="" target="_blank"></a>
  75. </body>
  76. </html>
  77. <%
  78. show.close();
  79. sql.closeDB();
  80. }else{
  81.   response.sendRedirect("userlogin.jsp");
  82.   }
  83. }catch(Exception e){
  84.   e.printStackTrace();
  85. } %>