<%@ page contentType="text/html; charset=utf-8" import="java.sql.*,java.util.*,jerehnet.jsp.database.*,jerehnet.jsp.util.*,java.text.SimpleDateFormat" language="java" isELIgnored="false" %> <% PoolManager pool = new PoolManager(); if (pool == null) { pool = new PoolManager(); } Connection conn = null; Pagination pagination = new Pagination(); //设置每页显示条数 int pageCount = 16; pageCount = Integer.parseInt(Common.getFormatInt(request.getParameter("pageCount"))); if(pageCount==0){ pageCount = 16; } pagination.setCountOfPage(pageCount); DataManager db = new DataManager(); try { conn = pool.getConnection(); String offset = Common.getFormatInt(request.getParameter("offset")); String keywords=Common.getFormatPara((String)request.getParameter("keywords")); String newsDate=Common.getFormatPara((String)request.getParameter("date")); String flag1=Common.getFormatPara((String)request.getParameter("flag")); if(keywords.equals("")||keywords.indexOf("关键词检索")>=0||keywords.equals("请输入关键字")||keywords.equals("输入关键词")||keywords.equals("站内检索")){ if(!"".equals(newsDate)){ keywords = newsDate; }else{keywords="";} } String chan="";ResultSet chanRs=null;String folderName="";String fileName=""; String condition = " AND website_no = '20150623163145344' and channel_node not in(select no from jrcms_website_channel where website_no='20150623163145344' and parent_no='20141201130936424' ) "; condition += " AND is_show = 1 "; if(!"".equals(newsDate)){ condition += " and DATEPART(yyyy,add_date) = '"+newsDate+"'"; } if(!"0".equals(flag1)&&!"".equals(flag1)){ condition += " AND flag = "+flag1+" "; } condition += " AND ( name LIKE '%"+keywords+"%' "; condition += " OR content LIKE '%"+keywords+"%' "; condition += ")"; String countSql = " SELECT COUNT(*) as counts FROM jrcms_search WHERE 1=1 and channel_node !='20140414154857477'"; String infoSql = " SELECT * FROM jrcms_search WHERE 1=1 and channel_node !='20140414154857477' "; countSql += condition; infoSql += condition; infoSql += "ORDER BY (SELECT CASE flag WHEN 1 THEN 2 WHEN 2 THEN 1 WHEN 3 THEN 3 WHEN 4 THEN 4 END)"; ResultSet rs = db.executeQuery(conn,countSql); ResultSet infoRs = pagination.getQueryResult(infoSql, request, conn); Integer allCounts = 0; if(null!=rs&&rs.next()){ allCounts = rs.getInt("counts"); } int showPages = 10;//底部页数显示个数 String name ="";String content="";String type="";int count=1; String types="";String flag="";String link="";String specialNo="";String channelNode="";Map folderPathMap = new HashMap();String linkOther="";String pathName=""; Integer myid = 0;String webFolder = ""; String folderSql = " SELECT no,folder_path,file_name FROM jrcms_website_channel WHERE 1=1 AND website_no = '20150623163145344' "; ResultSet folderRs = db.executeQuery(conn,folderSql); while(null!=folderRs&&folderRs.next()){ folderPathMap.put(folderRs.getString("no"),folderRs.getString("folder_path")); } //out.print(countSql); %> 全站搜索_奥特

您当前的位置: 首页 > 全站搜索

全站搜索

检索结果: <%=allCounts%>条符合条件的信息
    <% if(null!=infoRs&&infoRs.next()){ infoRs.beforeFirst(); while(null!=infoRs&&infoRs.next()){ link = infoRs.getString("file_name")==null?"":infoRs.getString("file_name"); myid = infoRs.getInt("id"); linkOther = infoRs.getString("link_other")==null?"":infoRs.getString("link_other"); folderPathMap.put(infoRs.getString("no"),infoRs.getString("folder_path")); name = infoRs.getString("name")==null?"":infoRs.getString("name"); content = infoRs.getString("content")==null?"":infoRs.getString("content"); name = name.replaceAll("\\&[a-zA-Z]{1,10};", "").replaceAll("<[^>]*>", "").replaceAll("[(/>)<]", "").replaceAll(" ",""); content = content.replaceAll("\\&[a-zA-Z]{1,10};", "").replaceAll("<[^>]*>", "").replaceAll("[(/>)<]", "").replaceAll(" ",""); if(name.length()>75){ name = name.substring(0,75)+"..."; } if(content.length()>150){ content = content.substring(0,150)+"..."; } flag = infoRs.getString("flag")==null?"":infoRs.getString("flag"); specialNo = infoRs.getString("special_no")==null?"":infoRs.getString("special_no"); channelNode = infoRs.getString("channel_node")==null?"":infoRs.getString("channel_node"); pathName = (String)folderPathMap.get(channelNode); if(!"".equals(linkOther)){ link = linkOther; }else{ if(flag.equals("1")){ chan="select * from jrcms_website_channel where website_no='20150623163145344' and no='"+channelNode+"'"; chanRs = db.executeQuery(conn,chan); if(chanRs.next()&&chanRs!=null){ folderName = chanRs.getString("folder_path"); fileName=chanRs.getString("file_name"); fileName = fileName.replace(".jsp","_text.htm"); } link = "/product/"+folderName+"/" + myid+"_for_"+ fileName; }else if(flag.equals("2")){ chan="select * from jrcms_website_channel where website_no='20150623163145344' and no='"+channelNode+"'"; chanRs = db.executeQuery(conn,chan); if(chanRs.next()&&chanRs!=null){ folderName = chanRs.getString("folder_path"); fileName=chanRs.getString("file_name"); fileName = fileName.replace(".jsp","_text.htm"); } link = "/product/"+folderName+"/" + myid+"_for_"+ fileName; //link ="/" + pathName + "/" + link; }else if(flag.equals("3")){ link ="/" + pathName + "/" + "zhaopingangwei.jsp"; }else if(flag.equals("4")){ if(pathName.equals("/")||"".equals(pathName)){ link = "/"; }else{ if(!link.equals("index.htm")){ link = "/product/" + pathName + "/" + link; }else{ link = "/" + pathName + "/" + link; } } }else if(flag.equals("5")){ chan="select * from jrcms_website_channel where website_no='20150623163145344' and no='"+channelNode+"'"; chanRs = db.executeQuery(conn,chan); if(chanRs.next()&&chanRs!=null){ folderName = chanRs.getString("folder_path"); fileName=chanRs.getString("file_name"); fileName = fileName.replace(".jsp","_text.htm"); } link = "/"+folderName+"/" + myid+"_for_"+ fileName; } } if(flag.equals("1")){ types="新闻"; }else if(flag.equals("2")){ types="产品"; }else if(flag.equals("3")){ types="招聘"; }else if(flag.equals("4")){ types="栏目"; }else if(flag.equals("5")){ types="案例"; } %>
  • <%=types%> <%=name%>
  • <%count++;}}else{%>
  • 未找到符合条件的信息,建议换个关键词搜索!
  • <%}%>
<%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); } %>