<%@page contentType="text/html;charset=utf-8" import="java.sql.*,java.util.*,jerehnet.jsp.database.*,jerehnet.jsp.util.*,java.text.SimpleDateFormat,java.util.regex.Matcher,java.util.regex.Pattern"%> <% PoolManager pool = new PoolManager(); if (pool == null) { pool = new PoolManager(); } Connection conn = null; Pagination pagination = new Pagination(); //设置每页显示条数 int pageCount = 6; //pageCount = Integer.parseInt(Common.getFormatInt(request.getParameter("pageCount"))); if(pageCount==0){ pageCount = 10; } pagination.setCountOfPage(pageCount); DataManager db = new DataManager(); try { conn = pool.getConnection(); String offset = Common.getFormatInt(request.getParameter("offset")); String sdate = Common.getFormatStr(request.getParameter("sdate")); String edate = Common.getFormatStr(request.getParameter("edate")); String keyword = Common.getFormatStr(request.getParameter("keywords")); //搜索条件形成 String searchStr = " where website_no='20150623163145344' and channel_node='20150629183341122' and is_show=1 "; if(!sdate.equals("")&&!edate.equals("")){ searchStr+=" and pub_date between '"+sdate+"' and '"+edate+"'"; } if(!keyword.equals("")){ searchStr+=" and title like '%"+keyword+"%'"; } searchStr += " order by pub_date desc,id desc"; String query = "select * from jrcms_information" + searchStr; ResultSet rs = pagination.getQueryResult(query, request, conn); int showPages = 10;//底部页数显示个数 %> QYDB潜油电泵_产品新闻_奥特

QYDB潜油电泵

新闻检索
日期范围: -
    <% while(rs!=null&&rs.next()){ String title="";String content="";String fullTitle="";String img="";String viewCount=""; String summary=""; String datetime="";String year="";String month="";String day=""; viewCount=Common.getFormatStr(rs.getString("view_count")); img = Common.getFormatStr(rs.getString("img")); fullTitle=Common.getFormatStr(rs.getString("title")); title=Common.getFormatStr(rs.getString("title")); summary=Common.getFormatStr(rs.getString("summary")); content=Common.getFormatStr(rs.getString("content")); year=Common.getFormatDate("yyyy",rs.getDate("pub_date")); month=Common.getFormatDate("MM",rs.getDate("pub_date")); day=Common.getFormatDate("dd",rs.getDate("pub_date")); content=content.replaceAll("<\\s*img\\s+([^>]*)\\s*>",""); content = content.replaceAll(" ",""); content = content.replaceAll("<[^<|^>]+>",""); content = content.replaceAll(" ","").replaceAll(" ",""); if(content.length()>100){ content=content.substring(0,100)+"...";} if(title.length()>30){ title=title.substring(0,30)+"...";} %>
  • 发布时间:<%=year%>年<%=month%>月<%=day%>日
  • <%}%>
<%if(pagination.getTotal()>pageCount){%>
上一页 <%String str = "";String pages[] = pagination.getPages();int nowp = pagination.getCurrenPages();nowp = nowp - nowp % (showPages + 1);for (int i = nowp - 1; i < (nowp + showPages) && i < pages.length; i++) {if (i < 0)i = 0;if (pagination.getCurrenPages() == (i + 1)) {str += "" + (i + 1) + " ";} else {str += " " + (i + 1) + " ";}}str=str.substring(0,str.length()-1);out.print(str); %> 下一页 共<%=pagination.getTotalPages()%>页
<%}%>
<% } catch (Exception e) { e.printStackTrace(); } finally { pool.freeConnection(conn); } %>