<%@ page language="java" %> <%@ page import="com.dispDateTime.*" %> <%@ page import="java.io.*"%> <%@ page import="java.sql.*"%> <%@ page import="com.iotasoft.connection.*"%> <%@ page import="java.util.*"%> <%@ page import="javax.servlet.*"%> <%@ page import="javax.servlet.http.*"%> :|:|:|: Rashtriya Swayamsevak Sangh :|:|:|:
<% //----- Get Current Date, GMT Time and IST Time ---- DateTimeDispBean newsDateTime = new DateTimeDispBean(); String newDate = newsDateTime.displayDate(); String newISTTime = newsDateTime.displayISTTime(); String newGMTTime = newsDateTime.displayGMTTime(); %> <%@ include file="../GeneralFiles/mainHeader.inc" %> <% String tDocTitle = "Search Results"; //**** for connection ******* DbConnectionBroker myBroker = null; try {myBroker = new DbConnectionBroker();} catch (IOException e5) { } Connection rsscon = null; int thisConnection; rsscon = myBroker.getConnection(); thisConnection = myBroker.idOfConnection(rsscon); //**************************** String noofrec=request.getParameter("noofrec"); int tnoofrec=0; if(noofrec!=null) { if(!noofrec.equals("")) { tnoofrec=Integer.parseInt(noofrec); } } String txt_Search=request.getParameter("txt_search"); String nSearchId=""; String tDocType=""; String tDocSubType=""; String nDetailId=""; String tKeyword=""; String IsActivated=""; String tCat =""; String tSubCat=""; String tSubSubCat=""; String nSearchcnt=""; String nHitcnt=""; String temp=""; int i=0; int j=0; int totsearch=0; String table=""; String strid=""; String doc=""; String ndetailid=""; String title=""; PreparedStatement st=null; ResultSet rs=null; String bcolor="#FF9933"; String str3="Create TEMPORARY table TempSearch(tDocType varchar(60),url varchar(240),nDetailId int,tTitle varchar(240))"; PreparedStatement stForecast3 = rsscon.prepareStatement(str3); stForecast3.executeQuery(); out.println(""); PreparedStatement st1 = rsscon.prepareStatement("select * from SearchM where IsActivated='YES' and tKeyword like '%"+txt_Search+"%' group by tDocType,nDetailId order by tDocType "); ResultSet rs1 = st1.executeQuery(); while (rs1.next()) { i++; tDocType=rs1.getString("tDocType"); tDocSubType=rs1.getString("tDocSubType"); nDetailId=rs1.getString("nDetailId"); tKeyword=rs1.getString("tKeyword"); IsActivated=rs1.getString("IsActivated"); tCat =rs1.getString("tCat"); tSubCat=rs1.getString("tSubCat"); tSubSubCat=rs1.getString("tSubSubCat"); if (i==1) { temp=tDocType; } if (tDocType.equals(temp)) { j++; if (j==1) { strid=nDetailId; } else { strid=strid+","+nDetailId; } } else { if (temp.equals("News")) { out.println(""); st = rsscon.prepareStatement("insert into TempSearch Select 'News Section' tDocType, '../../News/NewsDetail.jsp?nNID=' url ,nDetailId,tTitle from NewsDetailM where nDetailId in("+strid+")"); rs = st.executeQuery(); } else if (temp.equals("Articles")) { out.println(""); st = rsscon.prepareStatement("insert into TempSearch Select 'Columns Section' tDocType, '#' url,nDetailId,tTitle from ArticleDetailM where nDetailId in("+strid+")"); rs = st.executeQuery(); } else if (temp.equals("Quote")) { out.println(""); st = rsscon.prepareStatement("insert into TempSearch Select 'Quote Section' tDocType, '#' url,nDetailId,tQuote from QuoteDetailM where nDetailId in("+strid+")"); rs = st.executeQuery(); } else if (temp.equals("Publication")) { out.println(""); st = rsscon.prepareStatement("insert into TempSearch Select 'Publication/BookStore Online Section' tDocType, '#' url,nDetailId,tTitle from PubDetailM where nDetailId in("+strid+")"); rs = st.executeQuery(); } else if (temp.equals("OnlinePoll")) { out.println(""); st = rsscon.prepareStatement("insert into TempSearch Select 'OnlinePoll Section' tDocType, '#' url,nDetailId,tQuestion from OnlinePollM where nDetailId in("+strid+")"); rs = st.executeQuery(); } else if (temp.equals("Downloads")) { out.println(""); st = rsscon.prepareStatement("insert into TempSearch Select 'Download Section' tDocType, '#' url,nDetailId,tTitle from DownloadM where nDetailId in("+strid+")"); rs = st.executeQuery(); } else if (temp.equals("Schedules")) { out.println(""); st = rsscon.prepareStatement("insert into TempSearch Select 'Schedules Section' tDocType, '#' url,nDetailId,tSubject from SchedulesM where nDetailId in("+strid+")"); rs = st.executeQuery(); } else if (temp.equals("Campaigns")) { out.println(""); st = rsscon.prepareStatement("insert into TempSearch Select 'Campaigns Section' tDocType, '../../RSS_Campaigns/CampaignsDtl.jsp?nCampInfoId=' url,nDetailId,tTitle from CampInfoDetailM where nDetailId in("+strid+")"); rs = st.executeQuery(); } else if(temp.equals("Gallery")) { out.println(""); st = rsscon.prepareStatement("insert into TempSearch Select 'Video/Photo Gallery Section' tDocType, '#' url,nDetailId,tTitle from GalleryM where nDetailId in("+strid+")"); rs = st.executeQuery(); } j=0; strid=""; temp=tDocType; rs1.previous(); } }//while end //**************** if (temp!=null) { if (temp.equals("News")) { out.println(""); st = rsscon.prepareStatement("insert into TempSearch Select 'News Section' tDocType, '../../News/NewsDetail.jsp?nNID=' url,nDetailId,tTitle from NewsDetailM where nDetailId in("+strid+")"); rs = st.executeQuery(); } else if (temp.equals("Articles")) { st = rsscon.prepareStatement("insert into TempSearch Select 'Columns Section' tDocType, '#' url,nDetailId,tTitle from ArticleDetailM where nDetailId in("+strid+")"); rs = st.executeQuery(); } else if (temp.equals("Quote")) { st = rsscon.prepareStatement("insert into TempSearch Select 'Quote Section' tDocType, '#' url,nDetailId,tQuote from QuoteDetailM where nDetailId in("+strid+")"); rs = st.executeQuery(); } else if (temp.equals("Publication")) { st = rsscon.prepareStatement("insert into TempSearch Select 'Publication/BookStore Online Section' tDocType, '#' url,nDetailId,tTitle from PubDetailM where nDetailId in("+strid+")"); rs = st.executeQuery(); } else if (temp.equals("OnlinePoll")) { out.println(""); st = rsscon.prepareStatement("insert into TempSearch Select 'OnlinePoll Section' tDocType, '#' url,nDetailId,tQuestion from OnlinePollM where nDetailId in("+strid+")"); rs = st.executeQuery(); } else if (temp.equals("Downloads")) { out.println(""); st = rsscon.prepareStatement("insert into TempSearch Select 'Download Section' tDocType, '#' url,nDetailId,tTitle from DownloadM where nDetailId in("+strid+")"); rs = st.executeQuery(); } else if (temp.equals("Schedules")) { st = rsscon.prepareStatement("insert into TempSearch Select 'Schedules Section' tDocType, '#' url,nDetailId,tSubject from SchedulesM where nDetailId in("+strid+")"); rs = st.executeQuery(); } else if (temp.equals("Campaigns")) { st = rsscon.prepareStatement("insert into TempSearch Select 'Campaigns Section' tDocType, '../../RSS_Campaigns/CampaignsDtl.jsp?nCampInfoId=' url,nDetailId,tTitle from CampInfoDetailM where nDetailId in("+strid+")"); rs = st.executeQuery(); } else if(temp.equals("Gallery")) { st = rsscon.prepareStatement("insert into TempSearch Select 'Video/Photo Gallery Section' tDocType, '#' url,nDetailId,tTitle from GalleryM where nDetailId in("+strid+")"); rs = st.executeQuery(); } } //******* no of records***** int ccnt=0; PreparedStatement st_totsearch = rsscon.prepareStatement("select count(*) cnt from TempSearch"); ResultSet rs_totsearch = st_totsearch.executeQuery(); while (rs_totsearch.next()) { totsearch=rs_totsearch.getInt(1); ccnt=totsearch; } //*************************** PreparedStatement sttemp = rsscon.prepareStatement("select * from TempSearch group by tDocType,nDetailId order by tDocType limit "+tnoofrec*10+",10"); ResultSet rstemp = sttemp.executeQuery(); %> <%@ include file="../GeneralFiles/DocTitle.inc" %>
Site Navigation

Search Results



  Total No. of Search for <%=txt_Search%> : <%=totsearch%>

<% int cnt=0; String dtl=""; while (rstemp.next()) { cnt++; doc=rstemp.getString(1); dtl=rstemp.getString(2); ndetailid=rstemp.getString(3); title=rstemp.getString(4); if(cnt==1) { %> <% } %> <% } %>
  Page : <% //*****Paging ******** try{ double tt2=0; float tt=ccnt; //ccnt - total no of database records tt2=tt/10; for(int il=0;il <%=il2%> , <% } else { %> <%=il2%>, <%} } }catch(Exception e) { System.out.println("Exception "+e); } %>
 
 * <%=title%> in <%=doc%>
 

<% String dropstr1="drop table TempSearch"; PreparedStatement stdrop1 = rsscon.prepareStatement(dropstr1); stdrop1.executeQuery(); myBroker.freeConnection(rsscon); %> <%@ include file="../GeneralFiles/mainFooter.inc" %>