%
if not gfCH_IsEmpty(lcase(Application("EnvironmentType"))) and lcase(Application("EnvironmentType")) <> "production" then
if lcase(request.cookies("ent")) <> "y" then
response.redirect Application("ProductSiteURL")
end if
end if
%><%if gfCH_SiteSupportsFeature("LensEmereOverride") then%>
<%else%>
<%end if%>
SofLens Contact Lenses | Buy SofLens Contacts Online
<%
dim lngOrderID2, gb_rs
dim gb_strSQL : gb_strSQL = ""
if gfCH_ShopperIsValid(mscsShopperID) then
gb_strSQL = "SELECT " & _
" order_id " & _
"FROM OrderHeader WITH (NOLOCK) " & _
"WHERE " & _
" ISNULL(order_type, 'contact') = 'contact' AND " & _
" site_name = " & gfCleanSQLStr(Application("DatabaseSiteName")) & " AND " & _
" shopper_id = " & gfCleanSQLStr(mscsShopperID) & _
"ORDER BY date_entered DESC "
set gb_rs = gfCH_GetRS(gb_strSQL)
if not gfCH_IsEmptyRS(gb_rs) then
lngOrderID2 = gb_rs("order_id")
end if
end if %>
<%gfMobile_DoMobileRedirect%>
<%gfCH_CheckFreeGiftReferral%>
<%
dim gb_strBodyClass : gb_strBodyClass = ""
%>
<%
if gfCH_IsEmpty(Request.Cookies("XOrderStatus")) then
gfCH_SetHasOrder
end if
%>
<%
if lcase(Application("EnvironmentType")) <> "production" then %>
Environment: <%=Application("EnvironmentType")%>
shopperID: <%=request.cookies("mscssid")%> ASP File: <%=request.ServerVariables("SCRIPT_NAME")%>
<%end if
%>
<%
if not gfCH_IsEmpty(Request.Querystring("rel")) then
gb_strSQL = "SELECT " & _
" coupon_id " & _
"FROM Coupon WITH (NOLOCK) " & _
"WHERE " & _
" coupon_code = " & gfCH_CleanSQLStr(Request.Querystring("rel"))
set gb_rs = gfCH_GetRS(gb_strSQL)
if not gfCH_IsEmptyRS(gb_rs) then
Response.Cookies("coup") = Request.Querystring("rel")
end if
end if
%>
<%
dim strBannerPFID : strBannerPFID = ""
if not gfCH_IsEmpty(Request.Cookies("ShopperActivity")) then
if gfCH_IsEmpty(Request.Cookies("ShopperActivityInterval")) then
Response.Cookies("ShopperActivityInterval") = 30
end if
if DateAdd("n", Request.Cookies("ShopperActivityInterval") / 3 , Request.Cookies("ShopperActivity")) < Now then
gb_strSQL = ""
gb_strSQL = "UPDATE TrackActiveShoppers SET " & _
" last_updated = " & gfCH_CleanSQL(Now) & " " & _
"WHERE " & _
" shopper_id = " & gfCH_CleanSQL(Request.Cookies("mscssid")) & " AND " & _
" mail_sent = 0 "
gfCH_ExecSQL(gb_strSQL)
Response.Cookies("ShopperActivity") = Now
end if
end if%>
<% gfCH_writeCSRSessionStatusHeader %>