guestbook_m.jsp
上传用户:jhtang88
上传日期:2014-01-27
资源大小:28528k
文件大小:5k
源码类别:

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html;charset=gb2312"%>
  2. <%@ page import = "java.net.URLEncoder"%>
  3. <%@ page import = "com.redmoon.oa.db.PageQuery"%>
  4. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  5. <HTML><HEAD><TITLE>留言簿管理</TITLE>
  6. <META http-equiv=Content-Type content="text/html; charset=gb2312">
  7. <link rel="stylesheet" href="../common.css" type="text/css">
  8. <META content="MSHTML 6.00.2600.0" name=GENERATOR></HEAD>
  9. <BODY bgColor=#ffffff leftMargin=0 topMargin=3 marginheight="3" marginwidth="0">
  10. <%@ include file="../inc/inc.jsp"%>
  11. <jsp:useBean id="fchar" scope="page" class="cn.js.fan.util.StrUtil"/>
  12. <jsp:useBean id="privilege" scope="page" class="com.redmoon.oa.pvg.Privilege"/>
  13. <jsp:setProperty name="privilege" property="defaulturl" value="../index.jsp"/>
  14. <!--重定向至 :<jsp:getProperty name="privilege" property="defaulturl"   />-->
  15. <table width="494" border="0" align="center" cellpadding="0" cellspacing="0">
  16.   <tr> 
  17.     <td height="23" valign="bottom" background="../images/tab-b5-top.gif">     <span class="right-title">留 
  18.       言 簿 管 理</span></td>
  19.   </tr>
  20.   <tr> 
  21.     <td valign="top" background="../images/tab-b-back.gif">
  22.         <%
  23. String priv="admin";
  24. if (!privilege.isUserPrivValid(request,priv))
  25. {
  26. out.println(cn.js.fan.web.SkinUtil.makeErrMsg(request, cn.js.fan.web.SkinUtil.LoadString(request, "pvg_invalid")));
  27. return;
  28. }
  29. %>
  30.         <BR>
  31.         <%
  32. PageQuery pagebean = new PageQuery("ttoa");
  33. String sql = "select * from guestbook order by lydate desc";
  34. int pagesize = 10;
  35. pagebean.setPageSize(pagesize);
  36. String Query = fchar.getNullString(request.getParameter("Query"));
  37. if (!Query.equals(""))
  38. sql = Query;
  39. ResultSet rs=pagebean.myQuery(sql,request) ; 
  40. pagebean.PageLegend(response);
  41. int curpage,totalpages;
  42. curpage = pagebean.getCurrentPages();
  43. totalpages = pagebean.getTotalPages();
  44. if (totalpages==0)
  45. {
  46. curpage = 1;
  47. totalpages = 1;
  48. }
  49. %>
  50.       <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
  51.         <tr> 
  52.           <td width="47"><img src="../images/title1-l.gif" width="47" height="25"></td>
  53.           <td valign="top" background="../images/title1-back.gif"><div align="center" class="title1">找到符合条件的记录 
  54.               <b><%=pagebean.getTotal() %></b> 条 每页显示 <b><%=pagebean.getPageSize() %></b> 
  55.               条 页次 <b><%=curpage %>/<%=totalpages %></b></div></td>
  56.           <td width="47"><img src="../images/title1-r.gif" width="47" height="25"></td>
  57.         </tr>
  58.       </table>
  59.       <br>
  60.       <%
  61. try
  62. {
  63.   int i = 0;
  64.   if (rs!=null )
  65.   {
  66.     if (pagebean.getTotalPages()>0)
  67. {
  68. do
  69. {
  70.   i++;
  71. %>
  72.       <table width=90% border=0 align="center" cellpadding="2" cellspacing="0" class="p9">
  73.         <tr> 
  74.           <td width="20%" align="left" bgcolor="#C4DAFF" class="stable"> <%=fchar.toHtml(rs.getString("person"))%> </td>
  75.           <td width="41%" align="left" bgcolor="#C4DAFF" class="stable">留言日期:<%=rs.getDate("lydate")%> 
  76.           </td>
  77.           <td width="20%" align="left" bgcolor="#C4DAFF" class="stable"><a href="guestbook_mod.jsp?id=<%=rs.getString("id")%>" class=mainA>修改/回复</a></td>
  78.           <td width="19%" align="left" bgcolor="#C4DAFF" class="stable"> <a href="guestbook_del.jsp?id=<%=rs.getString("id")%>">删除</a></td>
  79.         </tr>
  80.         <tr> 
  81.           <td colspan="4" class="stable"> <br> <%=fchar.toHtml(rs.getString("content"))%><br> <%
  82.   String reply = fchar.getNullString(rs.getString("reply"));
  83.   if (!reply.equals(""))
  84.   {
  85.   %> <font color="#F09F6F">回复:</font><%=fchar.toHtml(rs.getString("reply"))%> <br>
  86.             回复日期:<%=rs.getString("redate").substring(0,19)%> <% } %>
  87.           </td>
  88.         </tr>
  89.       </table>
  90.       <br>
  91.       <%
  92. }
  93. while(i<pagesize && rs.next());
  94. }
  95. else
  96. out.println(fchar.p_center("暂无留言!"));
  97.   }
  98.   else
  99. out.println(fchar.p_center("暂无留言!"));
  100.   
  101. }
  102. catch(SQLException e)
  103. {
  104.   out.print("出错: ");
  105.   out.print(e);
  106.   out.print(e.getMessage());
  107. }
  108. if (rs!=null)
  109. {
  110. rs.close();
  111. rs = null;
  112. }
  113. pagebean.clear();
  114. %>
  115.       <table width="98%" border="0" cellspacing="1" cellpadding="3" align="center" class="9black">
  116.         <tr> 
  117.           <td height="23"> <div align="right"> 
  118.               <%
  119.   String querystr;
  120.       querystr = "";  
  121.   %>
  122.               <%if(!pagebean.getFirstPage().equals("none")) {%>
  123.               <a href="guestbook_m.jsp?<%=pagebean.getFirstPage()+querystr%>"><img src="../images/first.gif" width="41" height="12" border="0"></a> 
  124.               <% }
  125.     if(!pagebean.getPrevPage().equals("none")){
  126.      %>
  127.               &nbsp;<a href="guestbook_m.jsp?<%=pagebean.getPrevPage()+querystr%>"><img src="../images/forward.gif" width="47" height="12" border="0"></a> 
  128.               <% } 
  129.     
  130.   if(!pagebean.getNextPage().equals("none")){%>
  131.               &nbsp;<a href="guestbook_m.jsp?<%=pagebean.getNextPage()+querystr%>"><img src="../images/next.gif" width="47" height="12" border="0"></a> 
  132.               <% }
  133.                   if(!pagebean.getLastPage().equals("none")){   %>
  134.               &nbsp;<a href="guestbook_m.jsp?<%=pagebean.getLastPage()+querystr%>"><img src="../images/last.gif" width="41" height="12" border="0"></a> 
  135.               <% }%>
  136.               &nbsp;</div></td>
  137.         </tr>
  138.       </table></td>
  139.   </tr>
  140.   <tr> 
  141.     <td height="9"><img src="../images/tab-b-bot.gif" width="494" height="9"></td>
  142.   </tr>
  143. </table>
  144. <br>
  145. </BODY></HTML>