Picture_Index.jsp
上传用户:zdly666
上传日期:2022-08-09
资源大小:6511k
文件大小:2k
源码类别:

WEB源码(ASP,PHP,...)

开发平台:

JavaScript

  1. <%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
  2. <%@ include file="conn.jsp"%>
  3. <%
  4. String Str_SQL="select * from S_fileInfor where column_id  ";
  5. Str_SQL+="in(select column_id from S_fileColumn  ";
  6. Str_SQL+="where column_name like '%图片%')";
  7. ResultSet rs2=stmt.executeQuery(Str_SQL);
  8. rs2.beforeFirst();
  9. int intPageSize; 
  10. int intRowCount; 
  11. int intPageCount; 
  12. int intPage; 
  13. String strPage;
  14. int i;
  15. intPageSize = 15;
  16. strPage = request.getParameter("page");//request.getParameter()  request  是请求,即把需要的参数得到,一般是从上一个页面用户提交的数据中得到  
  17. if(strPage==null){
  18. intPage = 1;
  19. }
  20. else
  21. {
  22. intPage = Integer.parseInt(strPage);
  23. if(intPage<1){ intPage = 1;}
  24. }
  25. rs2.last(); 
  26. intRowCount = rs2.getRow(); 
  27. intPageCount =(intRowCount+intPageSize-1) / intPageSize;
  28. if(intPage>intPageCount) intPage = intPageCount;
  29. if(intPageCount>0){
  30. rs2.absolute((intPage-1) * intPageSize+1); //光标定位到该行
  31. i = 0; 
  32. %>
  33. <table width="72%" border="0" align="center">
  34. <%  
  35. while(i< intPageSize && !rs2.isAfterLast())
  36. {
  37. String FileID=rs2.getString("file_id");
  38. //String ExpertID=rs2.getString("column_expertid");
  39. String FileDate=rs2.getString("file_date");
  40. String Column=rs2.getString("column_id");
  41. String FileTitle=rs2.getString("file_title");
  42. int Row=rs2.getRow();
  43. %>
  44.   <tr>
  45. <td width="2%">&nbsp;</td>
  46. <td width="65%"><%
  47. if(FileTitle!=null&&FileTitle.length()>20)
  48. {
  49. FileTitle=FileTitle.substring(0,20)+"...";
  50. out.print("<li><a href='Picture1.jsp?EditID="+FileID+"&RowID="+Row+"&Column="+Column+"&Type=1'>"+FileTitle+"</a></li>");
  51. }else{
  52. out.print("<li><a href='Picture1.jsp?EditID="+FileID+"&RowID="+Row+"&Column="+Column+"&Type=1'>"+FileTitle+"</a></li>");
  53. }%>
  54. </td>
  55. <td width="33%"><%out.print(FileDate);%></td>
  56.   </tr>
  57. <%
  58. rs2.next(); 
  59.    i++; 
  60.    } 
  61.   }
  62.   
  63. rs2.close();
  64. %>
  65. </table>
  66. <% 
  67. if(intRowCount>14)
  68. { %>
  69. <div align="center">
  70. 当前显示第<span class="style7"> 
  71. <%=intPage%></span> 页&nbsp;&nbsp; 
  72. 共 <%=intPageCount%> 页 &nbsp;&nbsp;&nbsp;&nbsp;
  73. 导航:<a href="Picture1.jsp?page=1" class="font0">首页</a>
  74. <%if(intPage>1){%>
  75. <a href="Picture1.jsp?page=<%=intPage-1%>" class="font0">上一页</a>
  76. <%}else{%>
  77. 上一页
  78. <%
  79. }%>
  80. <%if(intPage<intPageCount){%>
  81. <a href="Picture1.jsp?page=<%=intPage+1%>" class="font0">下一页</a>
  82. <%}else{%>
  83. 下一页
  84. <%
  85. }%>
  86. <a href="Picture1.jsp?page=<%=intPageCount%>" class="font0">尾页</a>
  87. </div>
  88. <% } %>