<%@ Language=VBScript%> <% 'Page/form name:3.5_adm_infolibrary.asp 'Purpose: Admin Library Information 'Date Modified:16/07/2001 'Author:Anupama Tuli %> <% dim strPub,strTitle,strSub if len(trim(Request.Form("title")))=0 then strTitle=Request("title") else strTitle=Request.Form("title") end if if len(trim(Request.Form("publisher")))=0 then strPub=Request("publisher") else strPub=Request.Form("publisher") end if if len(trim(Request.Form("subject")))=0 then strSub=Request("subject") else strSub=Request.Form("subject") end if strTitle=WorkingOnSpecialCharacters_IN_Keywords(strTitle) 'Response.Write "strtitle1 " & strtitle strPub=WorkingOnSpecialCharacters_IN_Keywords(strPub) strSub=WorkingOnSpecialCharacters_IN_Keywords(strSub) if strTitle<>"" then strSearchCriterion= "for '" & strTitle &"'" else strSearchCriterion="" end if if strSub<>"" then if strSearchCriterion="" then strSearchCriterion=" for '"& strSub &"'" else strSearchCriterion=strSearchCriterion & ", '" & strSub &"'" end if else strSearchCriterion=strSearchCriterion end if if strPub<>"" then if strSearchCriterion="" then strSearchCriterion=" for '"&strPub&"'" else strSearchCriterion=strSearchCriterion & ", '" & strPub &"'" end if else strSearchCriterion=strSearchCriterion end if ' CODE ENTERED FOR FREE TEXT SEARCH dim intKeyWordTitle intKeyWordTitle = 0 intKeyWordTitle = DoubleQuotes_Processing(strTitle) 'Response.Write "intkw" & intKeyWordTitle if (intKeyWordTitle = 2 ) Or (intKeyWordTitle = 3 ) then arrCrt = split(strTitle," ",-1,1) end if dim strkeywordTitle strkeywordTitle = "" if strTitle <>"" then if (intKeyWordTitle = 2 ) Or (intKeyWordTitle = 3 ) then if Isarray(arrCrt) then dim I dim strWord strWord = "" for I = 0 to ubound(arrCrt) strWord = trim(arrCrt(i)) if strWord <> "" then strkeywordTitle = strkeywordTitle & """" & strWord & "*""" & " OR " end if next end if strkeywordTitle = trim(strkeywordTitle) 'Removing the unwanted OR word from the last . strkeywordTitle = trim(left(strkeywordTitle,len(strkeywordTitle) - 2)) elseif intKeyWordTitle = 1 then 'For single Word strkeywordTitle = strTitle strkeywordTitle = trim(strkeywordTitle) end if end if dim intKeyWordSub intKeyWordSub = 0 intKeyWordSub = DoubleQuotes_Processing(strSub) 'Response.Write "intkw" & intKeyWordSub if (intKeyWordSub = 2 ) Or (intKeyWordSub = 3 ) then arrCrt = split(strSub," ",-1,1) end if dim strkeywordSub strkeywordSub = "" if strSub <>"" then if (intKeyWordSub = 2 ) Or (intKeyWordSub = 3 ) then if Isarray(arrCrt) then I=0 strWord = "" for I = 0 to ubound(arrCrt) strWord = trim(arrCrt(i)) if strWord <> "" then strkeywordSub = strkeywordSub & """" & strWord & "*""" & " OR " end if next end if strkeywordSub = trim(strkeywordSub) 'Removing the unwanted OR word from the last . strkeywordSub = trim(left(strkeywordSub,len(strkeywordSub) - 2)) elseif intKeyWordSub = 1 then 'For single Word strkeywordSub = strSub strkeywordSub = trim(strkeywordSub) end if end if dim intKeyWordPub intKeyWordPub = 0 intKeyWordPub = DoubleQuotes_Processing(strPub) 'Response.Write "intkw" & intKeyWordPub if (intKeyWordPub = 2 ) Or (intKeyWordPub = 3 ) then arrCrt = split(strPub," ",-1,1) end if dim strkeywordPub strkeywordPub = "" if strPub <>"" then if (intKeyWordPub = 2 ) Or (intKeyWordPub = 3 ) then if Isarray(arrCrt) then I=0 strWord = "" for I = 0 to ubound(arrCrt) strWord = trim(arrCrt(i)) if strWord <> "" then strkeywordPub = strkeywordPub & """" & strWord & "*""" & " OR " end if next end if strkeywordPub = trim(strkeywordPub) 'Removing the unwanted OR word from the last . strkeywordPub = trim(left(strkeywordPub,len(strkeywordPub) - 2)) elseif intKeyWordPub = 1 then 'For single Word strkeywordPub = strPub strkeywordPub = trim(strkeywordPub) end if end if ' CODE FOR FREE TEXT SEARCH ENDS HERE 'Response.End %> <% dim strpagecode strpagecode= "3LIBR11" %> <%if Request.QueryString("item")="Book / Publication" then i=6 end if if Request.QueryString("item")="Market Research" or Request.QueryString("item")="Market Survey" then i=5 end if if Request.QueryString("item")="ITPO Report" or Request.QueryString("item")="Periodical" then i=5 end if if Request.QueryString("item")="CD ROM" then i=5 end if if Request.QueryString("item")="Fair Catalogue" then i=4 end if if Request.QueryString("item")="Foreign Product Catalogue" then i=4 end if %> ITPO Library - <%=application("title")%>
Home > Library Items > Library Search
<%if not (Request.queryString ("item")="Foreign Product Catalogue") then%> <%else%> <%end if%> <%if Request.QueryString ("item")="Periodical" or Request.QueryString ("item")="Book / Publication" or Request.QueryString ("item")="CD ROM" then %> <%end if%> <%if not (Request.querystring ("item")="Fair Catalogue" or Request.querystring ("item")="Market Research" or Request.querystring ("item")="Market Survey") then%> <%else%> <%end if%>
ITPO Library - <%=Request.QueryString("item")%>
Welcome to ITPO Library. Search <%=request.querystring("item")%>s of your choice. To View all the <%=request.querystring("item")%>s available click on the Search Button.
Name of <%=Request.QueryString("item")%>
Name of Company
">
Subject
">
Publisher
Name of the Organiser
">
<%if request("flag")<>"Y" then%> <%end if%>
<%if trim(request("flag"))="Y" then%> <% Dim maxpages Dim maxrecs,iCurrentPage if Request.QueryString ("page")="" then iCurrentPage =1 else iCurrentPage =Request.QueryString ("page") end if set rs=server.CreateObject ("adodb.recordset") if strkeywordPub <>"" and strkeywordSub <>"" and strkeywordTitle<>"" then sql= "select AccessionNo,classificationno,name,volume,publishername, "&_ " year from librarymaster where librarytype='"&Request.QueryString ("code")&"' "&_ " and contains(publishername,'"& strkeywordPub &"') and contains(name,'"& strkeywordTitle &"') and "&_ " contains(subject,'"& strkeywordSub &"') order by accessionno" elseif strkeywordPub <>"" and strkeywordSub <>"" and strkeywordTitle="" then sql= "select AccessionNo,classificationno,name,volume,publishername, "&_ " year from librarymaster where librarytype='"&Request.QueryString ("code")&"' "&_ " and contains(publishername,'"& strkeywordPub &"') and"&_ " contains(subject,'"& strkeywordSub &"') order by accessionno" elseif strkeywordPub <>"" and strkeywordSub ="" and strkeywordTitle <> "" then sql= "select AccessionNo,classificationno,name,volume,publishername, "&_ " year from librarymaster where librarytype='"&Request.QueryString ("code")&"' "&_ " and contains(publishername,'"& strkeywordPub &"') and contains(name,'"& strkeywordTitle &"') "&_ " order by accessionno" elseif strkeywordPub ="" and strkeywordSub <>"" and strkeywordTitle <>"" then sql= "select AccessionNo,classificationno,name,volume,publishername, "&_ " year from librarymaster where librarytype='"&Request.QueryString ("code")&"' "&_ " and contains(name,'"& strkeywordTitle &"') and "&_ " contains(subject,'"& strkeywordSub &"') order by accessionno" elseif strkeywordPub <>"" and strkeywordSub ="" and strkeywordTitle="" then sql= "select AccessionNo,classificationno,name,volume,publishername, "&_ " year from librarymaster where librarytype='"&Request.QueryString ("code")&"' "&_ " and contains(publishername,'"& strkeywordPub &"') "&_ " order by accessionno" elseif strkeywordPub ="" and strkeywordSub <>"" and strkeywordTitle="" then sql= "select AccessionNo,classificationno,name,volume,publishername, "&_ " year from librarymaster where librarytype='"&Request.QueryString ("code")&"' "&_ " and contains(subject,'"& strkeywordSub &"') order by accessionno" elseif strkeywordPub ="" and strkeywordSub ="" and strkeywordTitle <> "" then sql= "select AccessionNo,classificationno,name,volume,publishername, "&_ " year from librarymaster where librarytype='"&Request.QueryString ("code")&"' "&_ " and contains(name,'"& strkeywordTitle &"') "&_ " order by accessionno" elseif strkeywordPub ="" and strkeywordSub ="" and strkeywordTitle="" then sql= "select AccessionNo,classificationno,name,volume,publishername, "&_ " year from librarymaster where librarytype='"&Request.QueryString ("code")&"' "&_ " order by accessionno" end if 'Response.Write "sql is :"& sql 'sql="select AccessionNo,classificationno,name,volume,publishername,year from librarymaster where librarytype='"&Request.QueryString ("code")&"' and publishername like '%"& strPub &"%' and name like '%"& strTitle &"%' and subject like '%"& strSub &"%' order by accessionno" 'Response.Write sql 'Error Handling in the Search : especially of Ignored Words. dim EncodedSectionName EncodedSectionName = "Search for ITPO Library" On error resume next rs.Open sql,objConn,adOpenStatic, adLockOptimistic ' if cint(Err.number)=-2147217900 then Response.Redirect "/inc/commoninc/error.asp?section=" & EncodedSectionName & "&errorno=M11" Response.End elseif Err.number<>0 then 'Response.Write "
" & "error " & Err.number & "
" & Err.description Response.Redirect "/inc/commoninc/error.asp?section=" & EncodedSectionName & "&errorno=M11" Response.End end if ' on error goto 0 '---------Error Handling Ends----------' 'rs.Open sql,objConn,adOpenStatic, adLockOptimistic if rs.EOF= false then rs.MoveFirst set rspag=objConn.execute("select parametervalue from parameter where parametercode='PAG'") rs.PageSize =Application("numrecords") rs.CacheSize =Application("numrecords") set rspag=nothing rs.AbsolutePage = Cint(iCurrentPage) maxpages = Cint(rs.PageCount) maxrecs = Cint(rs.PageSize) dim rcount rcount=rs.RecordCount dim StartRecNo dim EndRecNo StartRecNo = 0 EndRecNo = 0 ReturnRecNumbers iCurrentPage, StartRecNo, EndRecNo, rCount end if%> <% if (rs.eof or rs.bof) then %>
<%if rcount>0 then%> <%else%> <%end if%> <%if not Request.QueryString ("item")="Foreign Product Catalogue" then%> <%else%> <%end if%> <%if Request.QueryString("item")="Book / Publication" then%> <%end if%> <%if Request.QueryString("item")="Book / Publication" or Request.QueryString("item")="ITPO Report" or Request.QueryString("item")="Periodical" or Request.QueryString("item")="CD ROM" or Request.QueryString("item")="Foreign Product Catalogue" then%> <%end if%> <%if Request.QueryString("item")="Fair Catalogue" then%> <%end if%> <%if Request.QueryString("item")="Market Survey" or Request.QueryString("item")="Market Research" then%> <%end if%> <%if Request.QueryString("item")="Book / Publication" or Request.QueryString("item")="ITPO Report" or Request.QueryString("item")="CD ROM" or Request.QueryString("item")="Market Survey" or Request.QueryString("item")="Market Research" then%> <%end if%>
<%=StartRecNo%> to <%=EndRecNo%> of <%=rCount%> Records 0 Matching Records
Search Results <%=strSearchCriterion%>
Accession No.
Classification No.
Name of <%=Request.QueryString ("item")%>
Name of Company
Volume
Publisher Name
Name of the Organiser
Conducted By
Year
valign="top" class="gybgcolor">
No <%=Request.QueryString("item")%> found
<% else if rs.EOF = false then Dim maxpagerecs maxpagerecs=0 %>
<%if rcount>0 then%> <%else%> <%end if%> <%if not Request.QueryString ("item")="Foreign Product Catalogue" then%> <%else%> <%end if%> <%if Request.QueryString("item")="Book / Publication" then%> <%end if%> <%if Request.QueryString("item")="Book / Publication" or Request.QueryString("item")="ITPO Report" or Request.QueryString("item")="Periodical" or Request.QueryString("item")="CD ROM" or Request.QueryString("item")="Foreign Product Catalogue" then%> <%end if%> <%if Request.QueryString("item")="Fair Catalogue" then%> <%end if%> <%if Request.QueryString("item")="Market Survey" or Request.QueryString("item")="Market Research" then%> <%end if%> <%if Request.QueryString("item")="Book / Publication" or Request.QueryString("item")="ITPO Report" or Request.QueryString("item")="CD ROM" or Request.QueryString("item")="Market Survey" or Request.QueryString("item")="Market Research" then%> <%end if%> <% do while not rs.EOF and (cint(maxpagerecs) < cint(maxrecs)) %> <%if Request.QueryString("item")="Book / Publication" then%> <%end if%> <%if not (Request.QueryString("item")="Book / Publication" or Request.QueryString("item")="ITPO Report" or Request.QueryString("item")="Periodical" or Request.QueryString("item")="CD ROM" or Request.QueryString("item")="Market Survey" or Request.QueryString("item")="Market Research" or Request.QueryString("item")="Foreign Product Catalogue" or Request.QueryString("item")="Fair Catalogue" ) then%> <%else%> <%end if%> <%if not (Request.QueryString("item")="Book / Publication" or Request.QueryString("item")="ITPO Report" or Request.QueryString("item")="CD ROM" or Request.QueryString("item")="Market Survey" or Request.QueryString("item")="Market Research" ) then%> <%else%> <%end if%> <% maxpagerecs=cint(maxpagerecs) + 1 rs.MoveNext loop %>
<%=StartRecNo%> to <%=EndRecNo%> of <%=rCount%> Records 0 Records
Search Results <%=strSearchCriterion%>
Accession No.
Classification No
Name of <%=Request.QueryString ("item")%>
Name of Company
Volume
Publisher Name
Name of the Organiser
Conducted By
Year
<%=trim(rs("accessionno"))%> 
<%=trim(rs("classificationno"))%> 
<%=trim(rs("volume"))%> 
<%=trim(rs("publishername"))%> 
<%yr=trim(rs("year")) if yr=0 then yr="" end if %> <%=yr%> 
<% dim strlnk if cint(maxpages) > 1 then if cint(iCurrentPage) >1 then 'Response.write "" & "<<Prev" & "" & "  "%> &code=<%=server.URLEncode(Request.QueryString("code"))%>&flag=<%=Request("flag")%>&title=<%=server.URLEncode(Request("title"))%>&subject=<%=server.URLEncode(Request("subject"))%>&publisher=<%=server.URLEncode(Request("publisher"))%>">«Prev   <%'& "'>" & "<<Prev" & "" & "  %> <%end if Dim Counter if iCurrentPage > 10 then if iCurrentPage mod 10 = 0 then Counter=(iCurrentPage - 10) +1 else Counter=(iCurrentPage - (iCurrentPage mod 10)) +1 end if else Counter =1 end if For cnt = 1 to 10 if counter <= maxpages then 'For counter = 1 to cint(maxpages) if counter <> CInt(iCurrentPage) Then %> &code=<%=server.URLEncode(Request.QueryString("code"))%>&flag=<%=Request("flag")%>&title=<%=server.URLEncode(Request("title"))%>&subject=<%=server.URLEncode(Request("subject"))%>&publisher=<%=server.URLEncode(Request("publisher"))%>"><%=counter%> <%Else%> <%=counter%>   <%End if counter=counter+1 else exit for end if Next if cint(iCurrentPage) < cint(maxpages) then 'Response.write "" & "Next>>" & "" & "  "%> &code=<%=server.URLEncode(Request.QueryString("code"))%>&flag=<%=Request("flag")%>&title=<%=server.URLEncode(Request("title"))%>&subject=<%=server.URLEncode(Request("subject"))%>&publisher=<%=server.URLEncode(Request("publisher"))%>">Next»   <%end if %><%end if end if rs.Close set rs=nothing%>
<%end if%>
<%end if%> "> ">
 
<% 'this procedure returns Start and End Record no. of the 'selected page. sub ReturnRecNumbers(lintPageNo, lStartRecNo, lEndRecNo, tot_recs) lEndRecNo = lintPageNo * Application("numrecords") lStartRecNo = (lEndRecNo - Application("numrecords")) + 1 if lEndRecNo >= tot_recs then lEndRecNo = tot_recs end if end sub %>
<% function WorkingOnSpecialCharacters_IN_Keywords(lstrKeyWord) lstrKeyWord = trim(lstrKeyWord) lstrKeyWord = replace(lstrKeyWord,"'","",1,-1,1) lstrKeyWord = replace(lstrKeyWord,","," ",1,-1,1) lstrKeyWord = replace(lstrKeyWord,";"," ",1,-1,1) lstrKeyWord = replace(lstrKeyWord,"+"," ",1,-1,1) lstrKeyWord = trim(lstrKeyWord) 'Removal of Single double Quote when it is the only value in the 'keyword dim intPosOfDoubleQuote intPosOfDoubleQuote = instr(1,lstrKeyWord,"" & chr(34) & "",0) 'if ((len(lstrKeyWord) <=1) and (intPosOfDoubleQuote > 0 )) then ' lstrKeyWord = "" 'end if intPosOfDoubleQuote = instr(1,lstrKeyWord,"'",0) if ((len(lstrKeyWord) <=1) and (intPosOfDoubleQuote > 0 )) then lstrKeyWord = "" end if intPosOfDoubleQuote = instr(1,lstrKeyWord,",",0) if ((len(lstrKeyWord) <=1) and (intPosOfDoubleQuote > 0 )) then lstrKeyWord = "" end if intPosOfDoubleQuote = instr(1,lstrKeyWord,";",0) if ((len(lstrKeyWord) <=1) and (intPosOfDoubleQuote > 0 )) then lstrKeyWord = "" end if 'Remove error when user puts "" in the keywords field. 'lstrKeyWord = trim(lstrKeyWord) 'if len(lstrKeyWord) = 2 then ' dim intPos1 ' dim intPos2 ' intPos1 = instr(1,lstrKeyWord,"" & chr(34) & "",0) ' ' if intPos1 > 0 and intPos1 = 1 then ' intPos2 = instr((intPos1+1),lstrKeyWord,"" & chr(34) & "",0) ' if intPos2 > 0 and intPos2 = 2 then ' lstrKeyWord = "" ' end if ' end if 'end if 'Remove error when user puts " " (a space character within double quotes) in the keywords field ie ignored words 'within double quotes. 'lstrKeyWord = trim(lstrKeyWord) 'if len(lstrKeyWord) = 3 then ' 'if instr(1,lstrKeyWord," ",0) > 0 then lstrKeyWord = "" 'end if WorkingOnSpecialCharacters_IN_Keywords = lstrKeyWord end function %> <% 'This function removes in between double 'quotes from the string having double quotes. 'eg. "ajay" "singh" will be returned as "ajay singh". 'even if there is a single quote like "ajay singh, it 'will be returned as "ajay singh". 'So three cases will be entertained in this function '1) "ajay" "singh" will be returned as "ajay singh". '2) "ajay singh, it will be returned as "ajay singh". '3) ajay "singh" it will be returned as ajay singh to be ORed. function DoubleQuotes_Processing(strKeyWords) 'Checking for the presence of first double quote. dim intPos1 dim intPos2 dim NumberToBEPassed intPos1 = 0 intPos2 = 0 NumberToBEPassed = -1 strKeyWords = trim(strKeyWords) intPos1 = instr(1,strKeyWords,"" & chr(34) & "",0) if intPos1 > 0 and intPos1 = 1 then 'ie the first Character is a Double quote ..eg "ajay singh " 'strKeyWords = trim(replace(strKeyWords,"" & chr(34) & "","",1,-1,0)) 'Putting an * after exact phrase removes the error for 'Ignored words in the Free text Search eg "as" will throw error 'but "as*" will not 'strKeyWords = chr(34) & strKeyWords & "*" & chr(34) 'strKeyWord = strKeyWords NumberToBEPassed = 1 'DoubleQuotes_Processing = 1 'Return value elseif intPos1 > 1 then 'ie the Double quote character is in betwwen ..eg ajay "singh " strKeyWords = trim(replace(strKeyWords,"" & chr(34) & "","",1,-1,0)) strKeyWord = strKeyWords NumberToBEPassed = 2 'DoubleQuotes_Processing = 2 'Return value elseif intPos1 = 0 then 'Double quote Not found strKeyWord = trim(strKeyWords) NumberToBEPassed = 3 'DoubleQuotes_Processing = 3 'Return value end if 'Remove error when user puts ""a or ""b in the keywords field ie ignored words 'within double quotes. DoubleQuotes_Processing = NumberToBEPassed end function %>