<%response.buffer=true%> <% colour1=request.cookies("estid")("colour1") colour2=request.cookies("estid")("colour2") colour3=request.cookies("estid")("colour3") sitetitle=request.cookies("estid")("sitetitle") textstd=request.cookies("estid")("textstd") textrollover=request.cookies("estid")("textrollover") custid=request.cookies("estid")("custid") chkcurr=request.cookies("estid")("chkcurr") %> <% 'response.write custid &"----"%> <% 'Control variables For Retreiving Currency Conversion Rates maxcol=1 'Maximum number of columns. Set to one or greater maxrow=50 'Maximum number of rows. Set to one or greater storycharacters=50 'Maximum number of characters in the story text display databasesource = "crimpproductnew" 'Database source tablename = "currdetails" 'Table in database source client data idcol = 0 'Column containing ids data1 = 1 'Database Column 1 data2 = 2 'Database Column 2 'End control variables. Do not alter any code after this. %> <% 'Start table generation Set Conn = Server.CreateObject("ADODB.Connection") Conn.Open databasesource sql="SELECT * FROM " & tablename & " ORDER BY " & tablename & ".ID ASC;" Set RS = Conn.Execute(sql) v=RS.GetRows(1000) RS.close Conn.close %> <% dim shwchkcurr %> <% if chkcurr ="" then shwchkcurr="" currratio = 1 chkcurr ="GBP" End if %> <% if chkcurr = "GBP" then shwchkcurr="" currratio = 1 end if%> <% if chkcurr = "US$" then shwchkcurr="$" currratio = v(data1,row) end if%> <% if chkcurr = "Euro" then shwchkcurr="" currratio = v(data2,row) end if%> <% if request.querystring("parentcatname")<>"" AND request.querystring("prodname")<>"" then %><% =request.querystring("parentcatname") %> / <% =request.querystring("prodname") %><% else %>CK Tools, Electricians Tools, Cable Connectors, Cable Ties and Cable Management<% end if %> from The Crimp Company "" AND request.querystring("prodname")<>"" then %><% =request.querystring("parentcatname") %>, <% =request.querystring("prodname") %>, <% end if %>CK Tools, Electricians Tools, Cable Connectors, Cable Ties, Cable Management, Crimp Terminals, Crimp Tools, Cable Glands, Cable Joints, Earthing Products, Abiko">

<% if request.querystring ("subtool")="" then %> <% if request.querystring ("page")="1" then %> <% 'Control variables maxcol=1 'Maximum number of columns. Set to one or greater maxrow=99999 'Maximum number of rows. Set to one or greater storycharacters=50 'Maximum number of characters in the story text display databasesource = "crimpproductnew" 'Database source tablename = "prodcat" 'Table in database source client data idcol = 0 'Column containing ids data1 = 1 'Database Column 1 data2 = 2 'Database Column 2 data3 = 3 'Database Column 3 data4 = 4 'Database Column 4 data5 = 5 'Database Column 5 data6 = 6 'Database Column 6 data7 = 7 'Database Column 7 data8 = 8 'Database Column 9 data9 = 9 'Database Column 9 data10 = 10 'Database Column 10 data11 = 11 'Database Column 11 data12 = 12 'Database Column 12 'End control variables. Do not alter any code after this. %> <% 'Start table generation Set Conn = Server.CreateObject("ADODB.Connection") Conn.Open databasesource sql="SELECT * FROM " & tablename & " WHERE ID = " & request.querystring("ID") & " ORDER BY " & tablename & ".id ASC;" Set RS = Conn.Execute(sql) %>
<% if not RS.EOF then v=RS.GetRows(1000) trackrow=1 trackcol=1 For row = 0 to UBound(v,2) 'iterate through the rows in the variant array if trackcol = 1 then response.write "" %> <% if trackcol=maxcol then response.write "" trackcol=trackcol+1 if trackcol > maxcol then trackcol = 1 trackrow = trackrow + 1 if trackrow > maxrow then exit for end if Next else%> <% End if RS.close Conn.close %>
<%=v(data1,row)%>
<%replacetext v(data2,row), chr(13), "", "
", formatted_text3a, 1 replacetext formatted_text3a, "", "", "
  • ", formatted_text3b, 2 replacetext formatted_text3b, "m3", "", "m3", formatted_text3c, 2%> <%=formatted_text3c%><%formatted_text3a="" formatted_text3b="" formatted_text3c=""%>

    ..
    <% end if %> <% end if %>
    " & vbCrLf Next 'I Response.Write vbTab & "" & vbCrLf ' Increment the number of records we've shown iRecordsShown = iRecordsShown + 1 ' Can't forget to move to the next record! objPagingRS.MoveNext Loop ' All done - close table Response.Write "" & vbCrLf End If ' Close DB objects and free variables objPagingRS.Close Set objPagingRS = Nothing objPagingConn.Close Set objPagingConn = Nothing 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ' Show "previous" and "next" page links which pass the page to view ' and any parameters needed to rebuild the query. You could just as ' easily use a form but you'll need to change the lines that read ' the info back in at the top of the script. %> <% if iPageCount >"1" then %>
    <% ' BEGIN USER CONSTANTS Dim CONN_STRING Dim CONN_USER Dim CONN_PASS ' I'm using a DSN-less connection. ' To use a DSN, the format is shown on the next line: CONN_STRING = "DSN=crimpproductnew;" ' This DB is unsecured, o/w you'd need to specify something here CONN_USER = "" CONN_PASS = "" ' BEGIN RUNTIME CODE ' Declare our vars Dim iPageSize 'How big our pages are Dim iPageCount 'The number of pages we get back Dim iPageCurrent 'The page we want to show Dim strOrderBy 'A fake parameter used to illustrate passing them Dim strSQL 'SQL command to execute Dim objPagingConn 'The ADODB connection object Dim objPagingRS 'The ADODB recordset object Dim iRecordsShown 'Loop controller for displaying just iPageSize records Dim I 'Standard looping var ' Get parameters iPageSize = 10 ' You could easily allow users to change this ' Retrieve page to show or default to 1 If Request.QueryString("page") = "" Then iPageCurrent = 1 Else iPageCurrent = CInt(Request.QueryString("page")) End If If Request.QueryString("order") = "" Then strOrderBy = "srt" Else strOrderBy = Request.QueryString("order") End If ' Build our SQL String using the parameters we just got. 'strSQL = "SELECT * FROM products ORDER BY " & strOrderBy & ";" 'strSQL = "SELECT * FROM products WHERE special = 'Yes' ORDER BY " & strOrderBy & ";" 'strSQL = "SELECT * FROM products WHERE manu = " & request.querystring("manu") & " ORDER BY " & strOrderBy & ";" 'strSQL = "SELECT * FROM products WHERE prodcategory = " & request.querystring("prodcat") & " ORDER BY " & strOrderBy & ";" 'strSQL = "SELECT * FROM products WHERE online='yes' and prodcategory = " & request.querystring("prodcat") & " AND parentcat = " & request.querystring("parentcat") & " ORDER BY " & strOrderBy & ";" strSQL = "SELECT * FROM products WHERE online='yes' and parentcat = " & request.querystring("parentcat") & " AND prodcategory = " & request.querystring("prodcategory") & " ORDER BY " & strOrderBy & ";" ' Now we finally get to the DB work... ' Create and open our connection set objPagingConn=server.createobject("adodb.connection") objPagingConn.Open "crimpproductnew" set objPagingRS=server.CreateObject("adodb.recordset") objPagingRS.CursorLocation=3 'clientside objPagingRS.CursorType=3 'staticrecordset objPagingRS.PageSize=ipagesize objPagingRS.Open strSQL, objPagingConn ' Get the count of the pages using the given page size iPageCount = objPagingRS.PageCount iRC = objPagingRS.RecordCount ' If the request page falls outside the acceptable range, ' give them the closest match (1 or max) If iPageCurrent > iPageCount Then iPageCurrent = iPageCount If iPageCurrent < 1 Then iPageCurrent = 1 ' Check page count to prevent bombing when zero results are returned! If iPageCount = 0 Then Response.Write "Currently we do not have any products in this category" Else ' Move to the selected page objPagingRS.AbsolutePage = iPageCurrent ' Start output with a page x of n line %>

      <% if iPageCount >"1" then %> Further pages:
    <%end if %>   <%If iPageCurrent > 1 Then %> &parentcat=<% =request.querystring("parentcat") %>&parentcatname=<% =request.querystring("parentcatname") %>&prodname=<% =request.querystring("prodname") %>&page=<%= iPageCurrent - 1 %>&order=<%= Server.URLEncode(strOrderBy) %>&subsort=<% =request.querystring("subsort")%>&id=<% =request.querystring("prodcategory") %>"> <% End If ' You can also show page numbers: For I = 1 To iPageCount If I = iPageCurrent Then %> <% if iPageCount >"1" then %> <%= I %> <% end if %> <% Else %> &parentcat=<% =request.querystring("parentcat") %>&parentcatname=<% =request.querystring("parentcatname") %>&prodname=<% =request.querystring("prodname") %>&page=<%= I %>&order=<%= Server.URLEncode(strOrderBy) %>&subsort=<% =request.querystring("subsort")%>&id=<% =request.querystring("prodcategory") %>"> <%= I %> <% End If Next 'I If iPageCurrent < iPageCount Then %> &parentcat=<% =request.querystring("parentcat") %>&parentcatname=<% =request.querystring("parentcatname") %>&prodname=<% =request.querystring("prodname") %>&page=<%= iPageCurrent + 1 %>&order=<%= Server.URLEncode(strOrderBy) %>&subsort=<% =request.querystring("subsort")%>&id=<% =request.querystring("idshow")%>">
    <% End If ' END RUNTIME CODE %>

    &parentcatname=<% =parentcatname %>&prodcategory=<% =Request.querystring("prodcategory") %>"><% =Request.querystring("parentcatname") %> / <% =Request.querystring("prodname") %>
    <% ' Spacing Response.Write vbCrLf 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx %> <% 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ' Loop through our records and ouput 1 row per record iRecordsShown = 0 Do While iRecordsShown < iPageSize And Not objPagingRS.EOF Response.Write vbTab & "" & vbCrLf For I = 0 To objPagingRS.Fields.Count - 142 %>
    <%if objPagingRS("lrgimage")="noimage.jpg" then %>&width=108"><% End if %> <%if objPagingRS("lrgimage")<>"noimage.jpg" then %> ">&width=108" alt="Click Here For An Enlarged View And More Details"><% End if %>
    <%if objPagingRS("special")="yes" then %>"><% End if %>
    <%if objPagingRS("lrgimage")<>"noimage.jpg" then %> "><% End if %>

    <% =objPagingRS("prodname")%>

    <% =objPagingRS("prodref")%>

    <%replacetext objPagingRS("description"), chr(13), "", "
    ", formatted_text3a, 1 replacetext formatted_text3a, "", "", "", formatted_text3b, 2 replacetext formatted_text3b, "m3", "", "m3", formatted_text3c, 2%> <%=formatted_text3c%> <%formatted_text3a="" formatted_text3b="" formatted_text3c=""%>
    <%if objPagingRS("attrib1")<>"" then %> <% else %> <% End if %>
    <% Dim showprodpricea %> <% Dim showprodpriceb %> <% Dim showprodpricec %> <% Dim showprodpriced %> <% Dim showprodpricee %> <% Dim showprodpricef %> <% Dim showprodpriceg %> <% Dim showprodpriceh %> <% Dim showprodpricei %> <% Dim showprodpricej %> <% showprodpricea = objPagingRS("prodpricea") %> <% showprodpriceb = objPagingRS("prodpriceb") %> <% showprodpricec = objPagingRS("prodpricec") %> <% showprodpriced = objPagingRS("prodpriced") %> <% showprodpricee = objPagingRS("prodpricee") %> <% showprodpricef = objPagingRS("prodpricef") %> <% showprodpriceg = objPagingRS("prodpriceg") %> <% showprodpriceh = objPagingRS("prodpriceh") %> <% showprodpricei = objPagingRS("prodpricei") %> <% showprodpricej = objPagingRS("prodpricej") %> <% Dim showexchangepricea %> <% Dim showexchangepriceb %> <% Dim showexchangepricec %> <% Dim showexchangepriced %> <% Dim showexchangepricee %> <% Dim showexchangepricef %> <% Dim showexchangepriceg %> <% Dim showexchangepriceh %> <% Dim showexchangepricei %> <% Dim showexchangepricej %> <% showexchangepricea = showprodpricea * currratio %> <% showexchangepriceb = showprodpriceb * currratio %> <% showexchangepricec = showprodpricec * currratio %> <% showexchangepriced = showprodpriced * currratio %> <% showexchangepricee = showprodpricee * currratio %> <% showexchangepricef = showprodpricef * currratio %> <% showexchangepriceg = showprodpriceg * currratio %> <% showexchangepriceh = showprodpriceh * currratio %> <% showexchangepricei = showprodpricei * currratio %> <% showexchangepricej = showprodpricej * currratio %> <%if objPagingRS("prodpriceb")="0" then %> <% if objPagingRS("prodnamea")<>"" then%> <% =objPagingRS("prodnamea")%> <% end if %> <%=shwchkcurr%> <% if chkcurr<>"GBP" then %> <% Response.Write FormatNumber(showexchangepricea, 2)%> <% end if %> <% if chkcurr="GBP" then %> <% Response.Write FormatNumber(showexchangepricea, 2)%> <% end if %> <% End if %> <%if objPagingRS("prodpriceb")<>"0" then %> <% if chkcurr<>"GBP" then %> <% End if %> <% if chkcurr="GBP" then %> <% End if %> <% End if %>
    <% if objPagingRS("descriptionlong")<>"" then %> ">

    <% end if %>

    <% if objPagingRS("crosssell1")<>"Select" then %> "> "> "> "> "> <% end if %> <% if objPagingRS("crosssell1")="Select" then %> <% end if %> "> <%if objPagingRS("prodpriceb")="0" then %> <% if chkcurr="GBP" then %> <% End if %> <% if chkcurr="" then %> <% End if %> <% if chkcurr="US$" then %> <% End if %> <% if chkcurr="Euro" then %> <% End if %> <% End if %> <%if objPagingRS("prodpriceb")="0" then %> "> <% End if %> "> "> "> "> "> "> ">
    <% 'Response.Write vbTab & vbTab & "
    " 'Response.Write objPagingRS.Fields(I) 'Response.Write "HS
    &parentcatname=<% =parentcatname %>&prodcategory=<% =Request.querystring("prodcategory") %>"><% =Request.querystring("parentcatname") %> / <% =Request.querystring("prodname") %> - Page <%= iPageCurrent %> of <%= iPageCount %>
    <% end if %>

      <% if iPageCount >"1" then %> Further pages:
    <%end if %>   <%If iPageCurrent > 1 Then %> &parentcat=<% =request.querystring("parentcat") %>&parentcatname=<% =request.querystring("parentcatname") %>&prodname=<% =request.querystring("prodname") %>&page=<%= iPageCurrent - 1 %>&order=<%= Server.URLEncode(strOrderBy) %>&subsort=<% =request.querystring("subsort")%>&id=<% =request.querystring("prodcategory") %>"> <% End If ' You can also show page numbers: For I = 1 To iPageCount If I = iPageCurrent Then %> <% if iPageCount >"1" then %> <%= I %> <% end if %> <% Else %> &parentcat=<% =request.querystring("parentcat") %>&parentcatname=<% =request.querystring("parentcatname") %>&prodname=<% =request.querystring("prodname") %>&page=<%= I %>&order=<%= Server.URLEncode(strOrderBy) %>&subsort=<% =request.querystring("subsort")%>&id=<% =request.querystring("prodcategory") %>"> <%= I %> <% End If Next 'I If iPageCurrent < iPageCount Then %> &parentcat=<% =request.querystring("parentcat") %>&parentcatname=<% =request.querystring("parentcatname") %>&prodname=<% =request.querystring("prodname") %>&page=<%= iPageCurrent + 1 %>&order=<%= Server.URLEncode(strOrderBy) %>&subsort=<% =request.querystring("subsort")%>&id=<% =request.querystring("idshow")%>">
    <% End If ' END RUNTIME CODE %>

    <% 'SHOP PRODUCT END %>
    All order are carried out according to standard terms and conditions, click here for details
     For details on our privacy policy please click here

    <%'BEGIN sub-routine to replace text in a string sub replacetext (textstringsource, searchfor, replacewithstart, replacewithend, textstringnew, replacemode) 'Replace text in a string 'Replacemode1 replaces front and rear and at the very end 'Replacemode2 replaces only rear and does not add to the very end of the text string 'Replacemode2 can be used to replace ' with '' for example laststringpos=1 nextstringpos=2 do while instr(laststringpos,textstringsource,searchfor) <> 0 nextstringpos=instr(laststringpos,textstringsource,searchfor) if replacemode=1 then textstringnew=textstringnew & replacewithstart & mid(textstringsource,laststringpos,nextstringpos-laststringpos) & replacewithend end if if replacemode=2 then textstringnew=textstringnew & mid(textstringsource,laststringpos,nextstringpos-laststringpos) & replacewithend end if laststringpos=nextstringpos+len(searchfor) loop if laststringpos <= len(textstringsource) then if replacemode=1 then textstringnew=textstringnew & replacewithstart & mid(textstringsource,laststringpos) & replacewithend end if if replacemode=2 then textstringnew=textstringnew & mid(textstringsource,laststringpos) end if end if searchfor="" replacewithstart="" replacewithend="" end sub 'END sub-routine to replace text in a string%>