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

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. <%@ include file="../inc/inc.jsp"%>
  5. <jsp:useBean id="fchar" scope="page" class="cn.js.fan.util.StrUtil"/>
  6. <jsp:useBean id="privilege" scope="page" class="com.redmoon.oa.pvg.Privilege"/>
  7. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  8. <html>
  9. <head>
  10. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  11. <%@ include file="../inc/nocache.jsp"%>
  12. <title>镇江GIS黄页系统</title>
  13. <link href="../common.css" rel="stylesheet" type="text/css">
  14. <script language="JavaScript" type="text/JavaScript">
  15. <!--
  16. function MM_preloadImages() { //v3.0
  17.   var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
  18.     var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
  19.     if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
  20. }
  21. //-->
  22. </script>
  23. <script language=javascript>
  24. <!--
  25. function openWin(url,width,height)
  26. {
  27.   var newwin=window.open(url,"_blank","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,top=50,left=120,width="+width+",height="+height);
  28. }
  29. //-->
  30. </script>
  31. </head>
  32. <body background="" leftmargin="0" topmargin="5" marginwidth="0" marginheight="0">
  33. <table width="494" border="0" align="center" cellpadding="0" cellspacing="0">
  34.   <tr> 
  35.     <td height="23" valign="bottom" background="../images/tab-b5-top.gif">     <span class="right-title">文 
  36.       件 管 理</span></td>
  37.   </tr>
  38.   <tr> 
  39.     <td valign="top" background="../images/tab-b-back.gif">
  40.         <%
  41. String priv="admin";
  42. if (!privilege.isUserPrivValid(request,priv))
  43. {
  44. out.println(cn.js.fan.web.SkinUtil.makeErrMsg(request, cn.js.fan.web.SkinUtil.LoadString(request, "pvg_invalid")));
  45. return;
  46. }
  47. PageQuery pagebean = new PageQuery("ttoa");
  48. String sql;
  49. String myname = privilege.getUser(request);
  50. String department_id = privilege.getDepartmentID(request);
  51. sql = "select d.id,d.filename,d.title,d.extname,d.opengroup,d.uploaddate,d.username,t.name as typename from document as d,doc_type as t where d.typeid=t.id order by mydate";
  52. int pagesize = 10;
  53. pagebean.setPageSize(pagesize);
  54. String Query = fchar.getNullString(request.getParameter("Query"));
  55. if (!Query.equals(""))
  56. sql = Query;
  57. ResultSet rs=pagebean.myQuery(sql,request) ; 
  58. pagebean.PageLegend(response);
  59. int curpage,totalpages;
  60. curpage = pagebean.getCurrentPages();
  61. totalpages = pagebean.getTotalPages();
  62. if (totalpages==0)
  63. {
  64. curpage = 1;
  65. totalpages = 1;
  66. }
  67. int i = 0;
  68. String id="",filename="";
  69. String title = "",typename = "",extname="",username="",uploaddate="";
  70. int templete = 0;
  71. try
  72. {
  73.   if (rs!=null )
  74.   {
  75.     if (pagebean.getTotalPages()>0)
  76. {
  77. %>
  78.       <br>
  79.       <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
  80.         <tr> 
  81.           <td width="47"><img src="../images/title1-l.gif" width="47" height="25"></td>
  82.           <td valign="top" background="../images/title1-back.gif"><div align="center" class="title1">找到符合条件的记录 
  83.               <b><%=pagebean.getTotal() %></b> 条 每页显示 <b><%=pagebean.getPageSize() %></b> 
  84.               条 页次 <b><%=curpage %>/<%=totalpages %></b></div></td>
  85.           <td width="47"><img src="../images/title1-r.gif" width="47" height="25"></td>
  86.         </tr>
  87.       </table> 
  88.       <br>
  89.       <table width="98%" border="0" align="center" cellpadding="2" cellspacing="0">
  90.         <tr align="center" bgcolor="#C4DAFF"> 
  91.           <td width="26%" class="stable"> 
  92.             <div align="center">标题</div></td>
  93.           <td width="15%" class="stable">类型</td>
  94.           <td width="11%" class="stable"> 上报人</td>
  95.           <td width="14%" class="stable">上报日期</td>
  96.           <td width="14%" class="stable">删除</td>
  97.         </tr>
  98.       </table>
  99.       <%
  100. do
  101. {
  102. i++;
  103. id = rs.getString("id");
  104. title = rs.getString("title");
  105. username = rs.getString("username");
  106. uploaddate = rs.getString("uploaddate").substring(0,19);
  107. typename = rs.getString("typename");
  108. extname = rs.getString("extname");
  109. filename = rs.getString("filename");
  110. %>
  111.       <table width="98%" border="0" align="center" cellpadding="2" cellspacing="0">
  112.         <tr> 
  113.           <td width="26%" class="stable"><%=title%></td>
  114.           <td width="15%" align="center" class="stable"><%=typename%></td>
  115.           <td width="11%" align="center" class="stable"><%=username%></td>
  116.           <td width="14%" align="center" class="stable"><%=uploaddate%></td>
  117.           <td width="14%" align="center" class="stable"><a href="doc_del.jsp?document_id=<%=id%>">删除</a></td>
  118.         </tr>
  119.       </table>
  120.       <%
  121. }
  122. while(i<pagesize && rs.next());
  123. }
  124. else
  125. out.println(fchar.p_center("暂无文件!"));
  126.   }
  127.   else
  128. out.println(fchar.p_center("暂无文件!"));
  129.   
  130. }
  131. catch(SQLException e)
  132. {
  133.   out.print("出错: ");
  134.   out.print(e);
  135.   out.print(e.getMessage());
  136. }
  137. if (rs!=null)
  138. {
  139. rs.close();
  140. rs = null;
  141. }
  142. pagebean.clear();
  143. %>
  144.       <br>
  145.       <table width="80%" border="0" cellspacing="1" cellpadding="3" align="center" class="9black">
  146.         <tr> 
  147.           <td height="23"> <div align="right"> 
  148.               <%
  149.   String querystr = "";
  150.   %>
  151.               <%if(!pagebean.getFirstPage().equals("none")) {%>
  152.               <a href="doc_m.jsp?<%=pagebean.getFirstPage()+querystr%>"><img src="../images/first.gif" width="41" height="12" border="0"></a> 
  153.               <% }
  154.     if(!pagebean.getPrevPage().equals("none")){
  155.      %>
  156.               &nbsp;<a href="doc_m.jsp?<%=pagebean.getPrevPage()+querystr%>"><img src="../images/forward.gif" width="47" height="12" border="0"></a> 
  157.               <% } 
  158.     
  159.   if(!pagebean.getNextPage().equals("none")){%>
  160.               &nbsp;<a href="doc_m.jsp?<%=pagebean.getNextPage()+querystr%>"><img src="../images/next.gif" width="47" height="12" border="0"></a> 
  161.               <% }
  162.                   if(!pagebean.getLastPage().equals("none")){   %>
  163.               &nbsp;<a href="doc_m.jsp?<%=pagebean.getLastPage()+querystr%>"><img src="../images/last.gif" width="41" height="12" border="0"></a> 
  164.               <% }%>
  165.               &nbsp;</div></td>
  166.         </tr>
  167.       </table></td>
  168.   </tr>
  169.   <tr> 
  170.     <td height="9"><img src="../images/tab-b-bot.gif" width="494" height="9"></td>
  171.   </tr>
  172. </table>
  173. </body>
  174. </html>