<%@ Language=VBScript %> <% option explicit %> company haircutters
<% dim productType, productNo, productCount, productCode, productPrice, productDescription, productName, productAmount, productImage, productLogo, noOne, x, productNameAlt dim cnPath, connStr, aQuery, dbName, connObj, rsObj 'assign vars to querystrings productCount=1 productCode="" productPrice=0.0 productDescription="" productAmount=0 productImage="" productLogo="" noOne=1 productType=Request.QueryString("productType") productNo=Request.QueryString("productNo") if productType="ghd" then session("productNoGhd")=CStr(productNo) end if if productType="tigi-bedhead" then session("productNoTigi")=CStr(productNo) end if 'get product typesset path to database on error resume next dbName="blackcatDB/products.mdb" on error resume next aQuery="SELECT * FROM equipmentType ORDER BY types" 'open and connect to database on error resume next cnPath = "DBQ=" + Server.mapPath(dbName) on error resume next connStr = "DRIVER={Microsoft Access Driver (*.mdb)}; " + cnPath on error resume next Set connObj = Server.CreateObject("ADODB.Connection") on error resume next connObj.Open(connStr) on error resume next Set rsObj = Server.CreateObject("ADODB.Recordset") 'get record set on error resume next rsObj.Open aQuery, connObj,3,3 on error resume next if rsObj.recordcount>0 then on error resume next rsObj.MoveFirst 'if querystring empty if productType="" or productNo="" then on error resume next productType=rsObj("types") productNo=1 end if on error resume next do while not rsObj.EOF %> <% on error resume next if rsObj("types") = productType then %> <%=rsObj("types")%>       <% on error resume next else %> &productNo=<%=noOne%>><%=rsObj("types")%>       <% on error resume next end if %> <% on error resume next rsObj.MoveNext %> <% on error resume next loop %> &productType=<%=productType%>&productNo=<%=productNo%>>view cart        &productNo=<%=productNo%>>checkout
<% end if 'close connection on error resume next rsObj.close on error resume next Set rsObj=Nothing on error resume next connObj.close on error resume next Set connObj=Nothing %> <% 'get product to be displayed 'get product types set path to database on error resume next dbName="blackcatDB/products.mdb" on error resume next aQuery="SELECT * FROM equipment WHERE types='" & productType & "' ORDER BY name" 'open and connect to database on error resume next cnPath = "DBQ=" + Server.mapPath(dbName) on error resume next connStr = "DRIVER={Microsoft Access Driver (*.mdb)}; " + cnPath on error resume next Set connObj = Server.CreateObject("ADODB.Connection") on error resume next connObj.Open(connStr) on error resume next Set rsObj = Server.CreateObject("ADODB.Recordset") 'get record set on error resume next rsObj.Open aQuery, connObj,3,3 on error resume next if rsObj.recordcount>0 then on error resume next rsObj.MoveLast on error resume next productAmount=rsObj.RecordCount on error resume next rsObj.MoveFirst on error resume next do while not rsObj.EOF if CStr(productCount)=CStr(productNo) then on error resume next productCode=rsObj("productID") on error resume next productPrice=rsObj("price") on error resume next productDescription=rsObj("description") on error resume next productName=rsObj("name") on error resume next productNameAlt=rsObj("nameAlt") on error resume next productImage=rsObj("imageID") on error resume next productLogo=rsObj("logo") end if on error resume next rsObj.MoveNext on error resume next productCount=productCount+1 on error resume next loop end if 'close connection on error resume next rsObj.close on error resume next Set rsObj=Nothing on error resume next connObj.close on error resume next Set connObj=Nothing %>

height=50>

height=100>   <%=productNameAlt%>

<%=productDescription%>


  Price £<%=productPrice%>    To add to your cart  
     

<% if CInt(productNo) > 1 then %> &productNo=<%=productNo-1%>>PREV <% else %> PREV <% end if %> <% if CInt(productNo) < CInt(productAmount) then %> &productNo=<%=productNo+1%>> NEXT <% else %> NEXT <% end if %>       <%=productNo%> of <%=productAmount%> <%=productType%> items  
a. 68 Bloomfield Avenue, Belfast      t. 028 90459641