<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> Seagull Books <% set con=server.CreateObject("ADODB.Connection") 'Application("DSNseagull")="Driver=SQL Server; Database=Seagull08; UID=sa; PWD=lnsel; SERVER=.\sql2k5;" 'Application("DSNseagull")="Driver=SQL Server; Database=Seagull08; UID=sa; PWD=sel123!@#; SERVER=69.64.64.133\SQLEXPRESS;" Application("DSNseagull")="Driver={SQL Server};Server=205.178.152.123;Database=seagull08;Uid=seagullindia;Pwd=Seagullindia2002;" con.Open Application("DSNseagull") ' Option Explicit 'declare variables Dim Currpage, pageLen, lastNumber, PageRem, PageTen Dim connection, recordset, sSQL, sConnString, next10, prev10, P Dim RSPrevPage, RSNextPage, start 'Get the current page the user is on, if it's the first time they 'visit and the variable 'PageNo' is empty, then 'CurrPage' gets set to 1 'Else the current page variable 'CurrPage' is set to the page number requested If IsEmpty(Request.Querystring("cpageno")) then CurrPage = 1 Else CurrPage = Cint(Request.Querystring("cpageno")) End If 'the two functions below return the next 10 and prev 10 page number Function getNext10(num) pageLen = len(num) If pageLen = 1 Then next10 = 10 Else If pageLen>1 Then pageRem = 10 pageTen = right(num, 1) next10 = num + pageRem - pageTen End If End If getNext10 = next10 End Function Function getPrev10(num) pageLen = len(num) If pageLen = 1 then prev10 = 1 Else If pageLen>1 then lastNumber = right(num, 1) prev10 = num - lastNumber - 10 End If End If If prev10 = 0 then prev10 = 1 End If getPrev10 = prev10 End Function Set rsImage=Server.CreateObject("Adodb.Recordset") qryImage="Select top 1 * from tblBackImage Order By newid()" rsImage.Open qryImage,con,3 if rsImage.RecordCount > 0 then ImagePath=rsImage("BackgroundImage") ImagePath=Replace(ImagePath,"\","/") end if %>
   

 


www.seagullindia.com    contact    blog     


Type search text
view cart
Seagull Books London
 
design: megha malhotra. development: lee & nee softwares
<% end if end if %>
<%if Request("cbosearch")="" then%> <%else%>
<% set rsbookstoreindia=server.CreateObject("ADODB.Recordset") rsbookstoreindia.ActiveConnection=con rsbookstoreindia.CursorLocation=3 rsbookstoreindia.CursorType=3 set mycommand=server.CreateObject("ADODB.Command") mycommand.ActiveConnection=con mycommand.CommandText="sp_BooksSeagullHome" mycommand.CommandType= adcmdstoredproc rsbookstoreindia.Open mycommand if rsbookstoreindia.recordcount > 0 then rsbookstoreindia.PageSize = 5 if Request.QueryString("cpageno")<>"" then rsbookstoreindia.AbsolutePage=cint(Request.QueryString("cpageno")) else rsbookstoreindia.AbsolutePage=1 end if Abspage=rsbookstoreindia.AbsolutePage rcount=1 Do While not rsbookstoreindia.EOF and rcount < rsbookstoreindia.PageSize i=0 Do while i < 5 and not rsbookstoreindia.eof bookname=rsbookstoreindia("bookname") isbnPB=rsbookstoreindia("isbn") isbnHB=rsbookstoreindia("isbnpb") author=rsbookstoreindia("author") pubcode=rsbookstoreindia("pubcode") typePB=rsbookstoreindia("Booktype") typeHb=rsbookstoreindia("BooktypePB") pricePB=rsbookstoreindia("listprice") priceDPB=rsbookstoreindia("priceindoll") pricePPB=rsbookstoreindia("priceinpound") priceHB=rsbookstoreindia("listpricePB") priceDHB=rsbookstoreindia("priceindollPB") pricePHB=rsbookstoreindia("priceinpoundPB") availPB=rsbookstoreindia("available") availHB=rsbookstoreindia("availablePB") itemidPB=rsbookstoreindia("itemid") itemidHB=rsbookstoreindia("itemidPB") image=rsbookstoreindia("image") spPrice=rsbookstoreindia("spPrice") spPbPrice=rsbookstoreindia("spPbPrice") %> <% i=i+1 rcount=rcount+1 rsbookstoreindia.Movenext loop loop end if %>
<% set rscomment=server.CreateObject("ADODB.Recordset") sqlcomment="SELECT count(*) as recno FROM BOOKREVIEW WHERE BOOKNAME='"& bookname &"'" rscomment.Open sqlcomment,con if not rscomment.eof then recno=rscomment("recno") end if %> <% if recno<>"0" then %> <% end if %>
<% if itemidPB <> "" then %> <% elseif itemidHB <> "" then %> <%end if %>
<%if Request.QueryString("cpageno")>1 then%> <%end if%>
  &cbosearch=<%=cbovalue%>&txtkeyword=<%=txtvalue%>" target="_self" class="textsmalllink"> Previous <% if rsbookstoreindia.PageCount>1 then for i=1 to rsbookstoreindia.PageCount %> <%=i%>  <% next end if %>   <%if Abspage Next <%end if%>

 

<% cbovalue=Request("cbosearch") txtvalue=Request("txtkeyword") flg=0 set rsrate=server.CreateObject("ADODB.Recordset") sql="select * from tblrate" rsrate.Open sql,con,1,3 dollinrs=rsrate("dollinRs") poundinrs=rsrate("poundinRS") rsrate.Close set rsrate=nothing set rsbook=server.CreateObject("ADODB.Recordset") rsbook.ActiveConnection=con rsbook.CursorLocation=3 rsbook.CursorType=3 '''''*** bookstore table is being used. set mycommand=server.CreateObject("ADODB.Command") mycommand.ActiveConnection=con mycommand.CommandText="retbooksforcategorySeagullBooks" mycommand.CommandType= adcmdstoredproc set prm1=mycommand.CreateParameter("category",adLongVarChar,adParamInput,15,cbovalue) set prm2=mycommand.CreateParameter("txtvalue",adVarChar,adParamInput,80,txtvalue) mycommand.Parameters.Append prm1 mycommand.Parameters.Append prm2 rsbook.Open mycommand next10 = getNext10(CurrPage) prev10 = getPrev10(CurrPage) %>
" else Response.Write rsbook.RecordCount & " Records Found. " %>
<% if rsbook.recordcount > 0 then rsbook.PageSize = 5 if Request.QueryString("cpageno")<>"" then rsbook.AbsolutePage=cint(Request.QueryString("cpageno")) else rsbook.AbsolutePage=1 end if Abspage=rsbook.AbsolutePage rcount=1 Do While not rsbook.EOF and rcount < rsbook.PageSize i=0 Do while i < 5 and not rsbook.eof bookname=rsbook("bookname") isbnPB=rsbook("isbn") isbnHB=rsbook("isbnpb") author=rsbook("author") pubcode=rsbook("pubcode") typePB=rsbook("Booktype") typeHb=rsbook("BooktypePB") pricePB=rsbook("listprice") priceDPB=rsbook("priceindoll") pricePPB=rsbook("priceinpound") priceHB=rsbook("listpricePB") priceDHB=rsbook("priceindollPB") pricePHB=rsbook("priceinpoundPB") availPB=rsbook("available") availHB=rsbook("availablePB") itemidPB=rsbook("itemid") itemidHB=rsbook("itemidPB") image=rsbook("image") spPrice=rsbook("spPrice") spPbPrice=rsbook("spPbPrice") %> <% i=i+1 rcount=rcount+1 rsbook.Movenext loop loop end if %>
<% set rscomment=server.CreateObject("ADODB.Recordset") sqlcomment="SELECT count(*) as recno FROM BOOKREVIEW WHERE BOOKNAME='"& Replace(bookname,"'","") &"'" rscomment.Open sqlcomment,con if not rscomment.eof then recno=rscomment("recno") end if %> <% if recno<>"0" then %> <% end if %>
<% if itemidPB <> "" then %> <% elseif itemidHB <> "" then %> <%end if %>
<% RSPrevPage = CurrPage -1 RSNextPage = CurrPage + 1 If Next10 > rsbook.PageCount Then Next10 = rsbook.PageCount End If 'the variable start determines where to start the page number navigation ' i.e. 1, 10, 20, 30 and so on. If prev10 = 1 AND next10 - 1 < 10 Then start = 1 Else start = Next10 - 10 If right(start, 1) > 0 Then start = replace(start, right(start, 1), "0") start = start + 10 End If End If 'This checks to make sure that there is more than one page of results If rsbook.PageCount > 1 Then 'Work out whether to show the Previous 10 '<<' 'If currpage > 1 Then ' response.write("<< ") ' End If 'Work out whether to show the Previous link '<' If NOT RSPrevPage = 0 then response.write("prev   ") End If 'Loop through the page number navigation using P as our loopcounter variable For P = start to Next10 If NOT P = CurrPage then response.write("" & P & " ") Else 'Don't hyperlink the current page number response.write(" " & P & " ") End If Next 'this does the same as the "previous" link, but for the "next" link If NOT RSNextPage > rsbook.PageCount Then response.write("  next ") End If 'Work out whether to show the Next 10 '>>' 'If NOT Next10 = rsbook.PageCount Then ' response.write(" >>") ' End If End If %>