<% Response.Buffer = true Dim x, storeinfo, storename, StoreLogo, SQLLogin, SQLPassword, StoreID, DefaultConnectionsString, strSqlCat, init_catID, strSql_Categories, strCat, strSql_Products, isSearch, Image, cnnSafeshopStoreDB, ScriptName ScriptName = Request.ServerVariables("SCRIPT_NAME") '################Store Configuration details go here! ########### StoreID = Application("StoreID") storename = Application("StoreName") StoreLogo = Application("storelogo") ' The overriding application Images an stylesheet URLs (appart from the logo and product images that are derived from a database . If Application("ORAppImgSrc") = "" Then Application("ORAppImgSrc") = "http://safeshop.mweb.co.za/genesis/images/" If Application("ORAppStyle") = "" Then Application("ORAppStyle") = "http://safeshop.mweb.co.za/genesis/stylesheet-matrix.css" Application("StoreRef") = StoreID If Application("DefaultConnectionsString") = "" Then Application("DefaultConnectionsString") = StoreLogin(StoreID) Set cnnSafeshopStoreDB = Server.CreateObject("adodb.connection") If Application("DefaultConnectionsString") = "" Then Response.Write "Error: Data connection failed!." Response.Redirect "f" Else Application("DefaultConnectionsString") = StoreLogin(storeid) cnnSafeshopStoreDB.Open Application("DefaultConnectionsString") Session("storename") = "Welcome to The " & Application("StoreName") & " Store" storeinfo = Request("storeinfo") End If %> <%= Session("storename") %> <% ' use custom style specified in the global.asa otherwise use the external stylesheet file 'If Application("BannerBGColour") <> "" Or Application("TitleBarBGColour") <> "" Or Application("TitleBarFontColour") <> "" Then Call RenderStyle 'Call ValidateSearch %>
">" height="76" border="0" alt="<%= Application("storename")%>">
" onMouseover="on('trolley','images/trolley-on.gif')" onMouseout="off('trolley','images/trolley-off.gif')">Click to see items added to your trolley
Click to get help for this website
"> "> ">
"> " valign="middle" align="left">Click for Welcome page; font-family: arial; font-weight: bold ; background-color:<%=Application("dgray")%>">Welcome ">
"> " valign="middle">; font-family: arial; font-weight: bold">  Product Search ">
"> " valign="middle" align="center">
  
">
"> "> ">

<% Dim rsCat set cnnSafeshopStoreDB = server.CreateObject("ADODB.connection") cnnSafeshopStoreDB.connectionstring = StoreLogin(StoreID) cnnSafeshopStoreDB.open ' Response.Write cnnSafeshopStoreDB strSqlCat = "select CategoryID,CategoryDescription from Category where categorydisplay = '1' or categorydisplay = 1 order by categoryranking, categorydescription" Set rsCat = cnnSafeshopStoreDB.Execute(strSqlCat) If Not rsCat.BOF Or Not rsCat.EOF Then init_catID = rsCat("CategoryID") Do While Not rsCat.EOF If rsCat("CategoryID") <> 0 Then %> <%End If rsCat.Movenext Loop rsCat.Close Set rsCat = Nothing %>
"> " valign="middle">  ; font-family: arial; font-weight: bold">Browse Products ">
"> " valign="middle" onMouseover="changeto('<%=Application("lgray")%>')" onMouseout="changeback('<%=Application("dgray")%>')">&CategoryDescription=<%=Server.URLEncode(rsCat("CategoryDescription"))%>" style="text-decoration: none; font-size: 12px; color: <%=Application("linkcol")%>; font-family: arial; font-weight: bold;">
<%=rsCat("CategoryDescription")%>
">
"> ">
"> ">
"> " valign="middle">  ">
"> "> ">
">   ; font-family: arial; font-weight: bold;"> <% Dim rsHeading, CategoryID CategoryID = Request("CategoryID") If CategoryID = "" Then CategoryID = init_catID If Request("CategoryID") > 0 Then strSql_Categories = "select * from Category where CategoryID=" & CategoryID Set rsHeading = cnnSafeshopStoreDB.Execute(strSql_Categories) strCat = rsHeading("CategoryDescription") rsHeading.Close Set rsHeading = Nothing Else strCat = Session("storename") End If %> <%If storeinfo = "" And Request("strSearch") = "" Then Response.Write (strCat) Else Select Case LCase(storeinfo) Case "shipping" storeinfo = "Shipping Info" Case "help" storeinfo = "Help" Case "security" storeinfo = "Your Security" Case "contactus" storeinfo = "Contact Us" Case "aboutus" storeinfo = "About Us" Case "returnpolicy" storeinfo = "Return Policy" Case "privacystatement" storeinfo = "Privacy Statement" Case "welcome" storeinfo = Session("storename") End Select Response.Write (storeinfo) End If If Request("strSearch") <> "" Then Response.Write "Search Results for """ & Request("strSearch") & """" Else Response.Write (" ") End If %>
<% Dim rsProducts, vw_ProductInfo ' A SQL view of product information to display vw_ProductInfo = "SELECT dbo.ProductMaster.ProductID AS UniqueID, dbo.Category.CategoryID AS Category1ID, dbo.ProductMaster.Name, dbo.ProductPrice.Price, dbo.GenesisInfo.Description, dbo.GenesisInfo.GraphicURL, dbo.ProductPrice.ExpiryDate FROM dbo.ProductMaster INNER JOIN dbo.ProductCategory ON dbo.ProductMaster.ProductID = dbo.ProductCategory.ProductID INNER JOIN dbo.Category ON dbo.ProductCategory.CategoryID = dbo.Category.CategoryID INNER JOIN dbo.ProductPrice ON dbo.ProductMaster.ProductID = dbo.ProductPrice.ProductID INNER JOIN dbo.GenesisInfo ON dbo.ProductMaster.ProductID = dbo.GenesisInfo.ProductID WHERE (dbo.ProductPrice.[Default] = 'YES') AND (dbo.GenesisInfo.DescriptionType = 'Short') AND (dbo.ProductPrice.Display = 'YES')" If Request.Form.Count = 0 Then ' list product infomation by CategoryID ' strSql_Products = vw_ProductInfo & " AND (Category.CategoryID = " & CategoryID & ")" strSql_Products = vw_ProductInfo & " AND (Category.CategoryID = " & CategoryID & ") order by dbo.ProductMaster.productid" Else ' list product infomation by search criteria SQLsrch = "SELECT DISTINCT " SQLsrch = SQLsrch & " dbo.ProductMaster.ProductID AS UniqueID " SQLsrch = SQLsrch & "FROM dbo.ProductMaster INNER JOIN" SQLsrch = SQLsrch & " dbo.ProductCategory ON " SQLsrch = SQLsrch & " dbo.ProductMaster.ProductID = dbo.ProductCategory.ProductID INNER JOIN" SQLsrch = SQLsrch & " dbo.ProductPrice ON " SQLsrch = SQLsrch & " dbo.ProductMaster.ProductID = dbo.ProductPrice.ProductID INNER JOIN dbo.GenesisInfo ON " SQLsrch = SQLsrch & " dbo.ProductMaster.ProductID = dbo.GenesisInfo.ProductID " SQLsrch = SQLsrch & "WHERE (dbo.ProductMaster.Name LIKE '%" & Request("strSearch") & "%%' ESCAPE '/') OR " SQLsrch = SQLsrch & " (dbo.GenesisInfo.Description LIKE '%" & Request("strSearch") & "%%' ESCAPE '/')" vw_ProductInfo = "" vw_ProductInfo = vw_ProductInfo & "SELECT dbo.ProductMaster.ProductID AS UniqueID, dbo.ProductPrice.ExpiryDate," vw_ProductInfo = vw_ProductInfo & " dbo.ProductMaster.Name, dbo.ProductPrice.Price, " vw_ProductInfo = vw_ProductInfo & " dbo.GenesisInfo.Description, " vw_ProductInfo = vw_ProductInfo & " dbo.GenesisInfo.GraphicURL " vw_ProductInfo = vw_ProductInfo & "FROM dbo.ProductMaster INNER JOIN" vw_ProductInfo = vw_ProductInfo & " dbo.ProductPrice ON " vw_ProductInfo = vw_ProductInfo & " dbo.ProductMaster.ProductID = dbo.ProductPrice.ProductID " vw_ProductInfo = vw_ProductInfo & " INNER JOIN" vw_ProductInfo = vw_ProductInfo & " dbo.GenesisInfo ON " vw_ProductInfo = vw_ProductInfo & " dbo.ProductMaster.ProductID = dbo.GenesisInfo.ProductID " vw_ProductInfo = vw_ProductInfo & "WHERE dbo.ProductMaster.ProductID IN ("&SQLsrch&") AND " ' vw_ProductInfo = vw_ProductInfo & " (dbo.ProductPrice.ExpiryDate > GETDATE()) AND " vw_ProductInfo = vw_ProductInfo & " (dbo.GenesisInfo.DescriptionType = 'Short') AND ProductPrice.Display = 'YES'" strSql_Products = vw_ProductInfo isSearch = True End If If Request("ProductID") <> "" Then ' list Products requested by ProductID vw_ProductInfo = "" vw_ProductInfo = vw_ProductInfo & "SELECT dbo.ProductMaster.ProductID AS UniqueID, " vw_ProductInfo = vw_ProductInfo & " dbo.ProductMaster.Name, dbo.ProductPrice.Price, " vw_ProductInfo = vw_ProductInfo & " dbo.GenesisInfo.Description, " vw_ProductInfo = vw_ProductInfo & " dbo.GenesisInfo.GraphicURL " vw_ProductInfo = vw_ProductInfo & "FROM dbo.ProductMaster INNER JOIN" vw_ProductInfo = vw_ProductInfo & " dbo.ProductPrice ON " vw_ProductInfo = vw_ProductInfo & " dbo.ProductMaster.ProductID = dbo.ProductPrice.ProductID " vw_ProductInfo = vw_ProductInfo & " INNER JOIN" vw_ProductInfo = vw_ProductInfo & " dbo.GenesisInfo ON " vw_ProductInfo = vw_ProductInfo & " dbo.ProductMaster.ProductID = dbo.GenesisInfo.ProductID " vw_ProductInfo = vw_ProductInfo & "WHERE dbo.ProductMaster.ProductID LIKE ('" & Request("ProductID") & "') AND " ' vw_ProductInfo = vw_ProductInfo & " (dbo.ProductPrice.ExpiryDate > GETDATE()) AND " vw_ProductInfo = vw_ProductInfo & " (dbo.GenesisInfo.DescriptionType = 'Short') AND ProductPrice.Display = 'YES'" 'strSql_Products = vw_ProductInfo & " AND (ProductMaster.ProductID = '" & Request("ProductID") & "')" strSql_Products = vw_ProductInfo Else ' Response.Write strSQL_Products ' *** Debug *** If storeinfo = "" And Request("CategoryID") = "" And Not isSearch Then Call RenderStoreInfo("welcome") End If If Request("CategoryID") > 0 Or Request("strSearch") <> "" Or Request("ProductID") <> "" Then Set rsproducts = server.CreateObject("ADODB.recordset") rsProducts.open strSql_Products, cnnSafeshopStoreDB, 3 ,1 end if %> <% If Request("CategoryID") > 0 Or Request("strSearch") <> "" Or Request("ProductID") <> "" Then If rsProducts.BOF Or rsProducts.EOF Then Response.Write "

No records were found.

" End If Do While Not rsProducts.EOF Image = rsProducts("GraphicUrl") If Image = "" Then Image = "" & Application("ORAppImgSrc") & "nopic.gif" End If ' Determine if offer expires and check date ----------------------------------------- val = FindAttributeValue(rsProducts("UniqueID"), "OfferExpires") ' Response.Write val display = true if ucase(val) = "Y" then if cdate(rsproducts("ExpiryDate")) < cdate(DATE()) then display = false end if end if if display = true then '------------------------------------------------------------------------------------ %>
<%= rsProducts(" >

   
; font-family: arial; font-weight: bold"><%= rsProducts("name") %>

<%= rsProducts("Description")%>


 
; font-family: arial; font-weight: bold"><%=replace(cstr(formatcurrency(rsProducts("Price"),2)),"$", "R ") %>
"> Click to dd this item to your trolley.There is no obligation to buy and you can remove it from your trolley at any time.
<% end if rsProducts.Movenext Loop rsProducts.Close Set rsProducts = Nothing End If %> <% If Request("storeinfo") = "" And Request("CategoryID") = "" And Not isSearch And Request("ProductID") = "" Then Response.Redirect (ScriptName & "?storeinfo=welcome") Else Call RenderStoreInfo(Request("storeinfo")) End If %>
Powered & protected by M-Web Safeshop

(Japanese Help)

"> ; font-family: arial; font-weight: bold; background-color: <%=application("dgray")%>">   Currency Converter
">
" style="text-decoration: none; font-size: 10px; color: <%=Application("linkcol")%>; font-family: arial; font-weight: bold; background-color: <%=application("lgray")%>; padding-left:3px;">
; font-family: arial; font-weight: bold; background-color: <%=application("lgray")%>">Click here for the Currency Converter.
">
"> ; font-family: arial; font-weight: bold; background-color: <%=application("dgray")%>">   About Us
">
" style="text-decoration: none; font-size: 10px; color: <%=Application("linkcol")%>; font-family: arial; font-weight: bold; background-color: <%=application("lgray")%>; padding-left:3px;">
; font-family: arial; font-weight: bold; background-color: <%=application("lgray")%>">Find out more about this store.
">
"> ; font-family: arial; font-weight: bold; background-color: <%=application("dgray")%>">   Contact Us
">
" style="text-decoration: none; font-size: 10px; color: <%=Application("linkcol")%>; font-family: arial; font-weight: bold; background-color: <%=application("lgray")%>; padding-left:3px;">
; font-family: arial; font-weight: bold; background-color: <%=application("lgray")%>">How you can get in touch with us.
">
"> ; font-family: arial; font-weight: bold; background-color: <%=application("dgray")%>">   Privacy
">
" style="text-decoration: none; font-size: 10px; color: <%=Application("linkcol")%>; font-family: arial; font-weight: bold; background-color: <%=application("lgray")%>; padding-left:3px;">
; font-family: arial; font-weight: bold; background-color: <%=application("lgray")%>">All your info and transactions are strictly confidential.
">
"> ; font-family: arial; font-weight: bold; background-color: <%=application("dgray")%>">   Returns Policy
">
" style="text-decoration: none; font-size: 10px; color: <%=Application("linkcol")%>; font-family: arial; font-weight: bold; background-color: <%=application("lgray")%>; padding-left:3px;">
; font-family: arial; font-weight: bold; background-color: <%=application("lgray")%>">What to do if you're not 100% satisfied with your purchase.
">
"> ; font-family: arial; font-weight: bold; background-color: <%=application("dgray")%>">   Security
">
" style="text-decoration: none; font-size: 10px; color: <%=Application("linkcol")%>; font-family: arial; font-weight: bold; background-color: <%=application("lgray")%>; padding-left:3px;">
; font-family: arial; font-weight: bold; background-color: <%=application("lgray")%>">Why shopping with us is safe.
">
"> ; font-family: arial; font-weight: bold; background-color: <%=application("dgray")%>">   Shipping Info
">
" style="text-decoration: none; font-size: 10px; color: <%=Application("linkcol")%>; font-family: arial; font-weight: bold; background-color: <%=application("lgray")%>; padding-left:3px;">
; font-family: arial; font-weight: bold; background-color: <%=application("lgray")%>">Get the details on delivery of goods.
">
VISA and MasterCard accepted
<% 'If IsObject(cnnSafeshopStoreDB) Then Set cnnSafeshopStoreDB = Nothing %> <% Function RenderStoreInfo(storeinfo) Dim rsStoreTexts, strSql, cnnSafeshopStoreDB, Body set cnnSafeshopStoreDB = server.CreateObject("ADODB.connection") cnnSafeshopStoreDB.connectionstring = StoreLogin(StoreID) cnnSafeshopStoreDB.open 'set cnnSafeshopStoreDB = Server.CreateObject("adodb.connection") 'cnnSafeshopStoreDB.Open Application("DefaultConnectionsString") Response.Write ("

") strSql = "Select * From StoreTexts Where TextType = '" & storeinfo & "'" Set rsStoreTexts = cnnSafeshopStoreDB.Execute(strSql) If Request("storeinfo") <> "" Then Body = CStr(rsStoreTexts("body")) ' the body field Response.Write Body rsStoreTexts.Close If IsObject(rsStoreTexts) Then Set rsStoreTexts = Nothing ' Response.Write ("
") End Function Function StoreLogin(StoreID) 'The database connection 'Response.Write "storid : " & storeid ' fff Dim Data_Source, cmdStoreDBLogin, RSStore_numRows, conn, RSStore Data_Source = Application("Data_Source") If Application("Login") = "" Or Application("Password") = "" Then Response.Write "Error: No login or password.
" ' If IsObject(conn) Then Set conn = Nothing Else StoreLogin = "Provider=SQLOLEDB.1;Persist Security Info=True;Initial Catalog=Store_" & StoreID & ";Data Source=" & Data_Source & ";Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;User Id=" & Application("Login") & ";PASSWORD=" & Application("Password") & ";" End If End Function Function FindAttributeValue(ProductID, Attribute) ' Purpose of this function :- ' Each call to this function contains an attribute name. The attributes are linked ' to the product, via the ProductAttribute table and the value of each attribute ' is contained within the AttributeValue table. So, each call, can located the unique ' value associated with the attribute, for a speciafied product. ' Input to function : product id; attribute name ' Output : value (in string format) of the attribute. ' ' Examples : ' 1. FindAttributeValue(Prod1, "Quantity") ---> returns "10" ' 2. FindAttributeValue(Prod2, "VatRate") ---> returns "0.14" ' 3. FindAttributeValue(Prod3, "FulfillmentURL") ---> returns "http://www.test-this.com" FindAttributeValue = "" sqlGetProduct = "SELECT A.Description, AV.Value " &_ "FROM ProductMaster PM, ProductAttribute PA, "&_ "Attribute A, AttributeValue AV " &_ "WHERE PM.ProductID = '" & ProductID & "' " &_ "AND PM.ProductID = PA.ProductID " &_ "AND PA.AttributeID = A.AttributeID " &_ "AND PA.ProductAttributeID = AV.ProductAttributeID" Set RS = cnnSafeshopStoreDB.Execute(sqlGetProduct) Do Until RS.EOF If Trim(Attribute) = Trim(RS("Description")) Then FindAttributeValue = RS("Value") End If RS.MoveNext Loop If FindAttributeValue = "" Then ' HandleError "The following error occurred when trying to locate a value for the " & Attribute & " atrribute. " & strValue, Err.number, Err.description End If End Function If IsObject(cnnSafeshopStoreDB) Then Set cnnSafeshopStoreDB = Nothing %>