<% Call start_oconn() %> <% Dim sku : sku = Trim(Request.QueryString("sku")) Dim catid : catid = Trim(Request.QueryString("catid")) Dim subid : subid = Trim(Request.QueryString("subid")) Dim seaid : seaid = Trim(Request.QueryString("seaid")) %> <% Dim cnt, sku2, ipp, cp cnt = 1 If Trim(Request.QueryString("cnt")) <> "" Then cnt = Trim(Request.QueryString("cnt")) ipp = Trim(Request.QueryString("ipp")) cp = 1 If Trim(Request.QueryString("cp")) <> "" Then cp = Trim(Request.QueryString("cp")) cat_path = Trim(Request.QueryString("cat_path")) rs = Session("RS") If Not IsArray(rs) then Response.Redirect "../index.htm?alert" If int(cp) > int(cnt) Then cp = 1 %> <% SQL = "SELECT * FROM [products] WHERE pid = "& sku Set rsDetail = oConn.Execute(SQL) If rsDetail.EOF Then Response.Redirect Request.ServerVariables("HTTP_REFERER") &"?"& Request.ServerVariables("QUERY_STRING") Call sku_stats(rsDetail("sku")) %> <%= site_name %> :: <%= rsDetail("name") %> "> ">
<%= rsDetail("name") %>
.jpg" border="0" />
<% If Trim(rsDetail("size")) <> "" Then %> <% End If %>
Available Sizes: <%= rsDetail("size") %>
<% If Trim(rsDetail("image_logo")) <> "" Then %> " />
<% End If %> <% If Trim(rsDetail("color")) <> "" Then %> Colors
<%= Trim(rsDetail("color")) %> <% Else Call show_colors() End If %>
<click image to enlarge>
<% If regid = "NA" Then %>Style #<%= Show_SKU(rsDetail("sku"), rsDetail("seasonID")) %>
<% End If %> <% If Trim(rsDetail("retail")) > 0 Then %> <% If regid = "ZA" Then %>Price: R<%= FormatNumber(rsDetail("retail"),2) %><% End If %> <% If regid = "EU" Then %>Price: <%= FormatCurrency(rsDetail("retail"),2) %><% End If %> <% End If %>
<%= Replace(rsDetail("description"), vbNewLine, "
") %>
<% If Not IsNull(rsDetail("description2")) Then %><%= Replace(rsDetail("description2"), vbNewLine, "
") %><% End If %>

<% Call show_banners(rsDetail("sku"), seaid, rsDetail("seasonid")) %>
.jpg" \>
<%= show_category_image(seaid, catid, subid, sku) %>
<% rsDetail.Close() Set rsDetail = Nothing Call end_oconn() %> <% Sub sku_stats(sku) Dim SQL,rs SQL = "SELECT * FROM [stats_sku] WHERE sku = '" & sku &"' AND Month([date]) = "& DatePart("M", Date) &" AND Year([date]) = "& DatePart("YYYY", Date) Set rs = oConn.Execute (SQL) If rs.EOF Then SQL = "INSERT INTO [stats_sku](sku) VALUES('" & sku &"')" oConn.Execute (SQL) Else SQL = "UPDATE [stats_sku] SET count = (count + 1) WHERE sku = '" & sku &"' AND Month([date]) = "& DatePart("M", Date) &" AND Year([date]) = "& DatePart("YYYY", Date) oConn.Execute (SQL) End If rs.Close() Set rs = Nothing End Sub %> <% Sub show_banners(sku, seaid, season_letter) If season_letter <> "" Then sku = Right(sku, Len(sku)-1) Dim SQL : SQL = "SELECT tbl.*, x.image, x.url FROM [banners] tbl " SQL = SQL &"LEFT OUTER JOIN [season_banners] x ON x.banner_id = tbl.banner_id AND x.seaid = "& seaid &" " SQL = SQL &"WHERE tbl.skulist LIKE ('%"& sku &"%') AND tbl.active = 'Y' " SQL = SQL &"ORDER BY tbl.[position]" Dim rs : Set rs = oConn.Execute(SQL) If Not rs.EOF Then %> <% Dim i : i=-1 While Not rs.EOF If Trim(rs("image")) <> "" Then i=i+1 If i mod 4 = 0 Then %><% End If %> <% If i mod 4 = 3 Then %><% End If %> <% Call banner_view_stats( rs("banner_id") ) End If rs.moveNext : Wend rs.Close() : Set rs = Nothing If i mod 4 <> 3 Then Response.Write "" %>
 Authorized Online Retailers carrying this product:
&sku=<%= sku %>&banner_id=<%= rs("banner_id") %>&carries_item=1" target="_blank" title="<%= rs("title") %>" >" width="100" height="25" border="0" />
<% End If Set rs = Nothing SQL = "SELECT tbl.*, x.image, x.url FROM [banners] tbl " SQL = SQL &"LEFT OUTER JOIN [season_banners] x ON x.banner_id = tbl.banner_id AND x.seaid = "& seaid &" " SQL = SQL &"WHERE tbl.skulist NOT LIKE ('%"& sku &"%') AND tbl.active = 'Y' " SQL = SQL &"ORDER BY tbl.[position]" Set rs = oConn.Execute(SQL) If Not rs.EOF Then %> <% i=-1 While Not rs.EOF If Trim(rs("image")) <> "" Then i=i+1 If i mod 4 = 0 Then %><% End If %> <% If i mod 4 = 3 Then %><% End If %> <% Call banner_view_stats( rs("banner_id") ) End If rs.moveNext : Wend rs.Close() : Set rs = Nothing If i mod 4 <> 3 Then Response.Write "" %>
 Authorized Online Retailers:
&sku=<%= sku %>&banner_id=<%= rs("banner_id") %>" target="_blank" title="<%= rs("title") %>" >" width="100" height="25" border="0" />
<% End If End Sub Sub show_colors() Dim SQL : SQL = "SELECT DISTINCT sku, filename, [view], color FROM [product_colors] WHERE sku = '"& rsDetail("sku") &"' ORDER BY filename DESC" Dim rs : Set rs = oConn.Execute(SQL) If Not rs.EOF Then %> <% While Not rs.EOF %> <% If color_match <> rs("color") Then %><% End If %> <% color_match = rs("color") rs.moveNext If Not rs.EOF Then If color_match <> rs("color") And color_match <> "" Then %><% End If Else Response.Write "" End If Wend %>
Colors
<%= rs("color") %> '; document.form.hidden.value='xlg_prod.asp?path=img_products|img_colors&id=<%= rs("filename") %>'" >.gif" border="0" hspace="10" alt="<%= rs("view") %>"/>
<% End If rs.Close() Set rs = Nothing End Sub Function Show_SKU(sku, season) If season <> "" Then Show_SKU = Right(sku, Len(sku)-1) End Function Sub banner_view_stats(banner_id) Dim SQL : SQL = "SELECT * FROM [banner_stats] WHERE banner_id = "& banner_id &" AND MONTH([date]) = "& DatePart("M", Date) &" AND YEAR([date]) = "& DatePart("YYYY", Date) Dim rs : Set rs = oConn.Execute(SQL) If Not rs.EOF Then SQL = "UPDATE [banner_stats] SET [views] = ([views] + 1) WHERE banner_id = "& banner_id &" AND MONTH([date]) = "& DatePart("M", Date) &" AND YEAR([date]) = "& DatePart("YYYY", Date) Else SQL = "INSERT INTO [banner_stats](banner_id, views) VALUES("& banner_id &",1)" End If oConn.Execute(SQL) rs.Close() Set rs = Nothing End Sub %>