<% ' Comersus Shopping Cart ' Comersus Open Technologies ' United States ' Software License can be found at License.txt ' http://www.comersus.com ' Details: list active root categories %> <% ' Comersus Sophisticated Cart ' Comersus Open Technologies ' USA - 2006 ' http://www.comersus.com ' Details: main initial settings (other settings can be found in database) %> <% dim pDatabaseConnectionString, pSupportErrorEmailFrom, pSupportErrorSMTP, pSupportErrorEmailComponent, pSupportErrorShowDetails, pTrapDbErrors, pIdStore ' storeFront Version (don't change this constant) private const pStoreFrontVersion = "7.095" ' Options: Windows or unix/linux private const pServerOS = "windows" ' database (access, sqlserver, mysql) private const pDataBase = "access" ' input string filterin type (1-3 being 1 hard, 3 light) pFilteringLevel = 1 ' id # if you have several stores connected to the same database pIdStore = 1 ' Alternate connection strings (change only for SQl Server, mySQL or if you get errors with Access) ' SQL Server local or remote IP in SERVER= ' pDatabaseConnectionString = "Driver={SQL Server};UID=comersus;password=123456;DATABASE=comersus6;SERVER=127.0.0.1" ' mySQL Server 2.5 ' pDatabaseConnectionString = "Driver={mySQL};Server=localhost;database=comersus;Uid=Root;Pwd=" ' mySQL Server 3.51 local ' pDatabaseConnectionString = "Driver={MySQL ODBC 3.51 Driver};Server=localhost;database=comersus;user=root;password=;OPTION=3" ' DSN connection, you must define the DSN first in your server ' pDatabaseConnectionString = "DSN=comersus" ' DSN less connection pDatabaseConnectionString = "Driver={Microsoft Access Driver (*.mdb)};DBQ=" &server.MapPath("/comersus7F/database/comersus.mdb")&";" ' Email Settings for Support Error script (if there's a DB error, this data cannot be retrieved from the DB) pSupportErrorEmailFrom = "you@yourDomain.com" pSupportErrorSMTP = "smtp.yourDomain.com" pSupportErrorEmailComponent = "Jmail" ' options are Jmail, ServerObjectsASPMail1, ServerObjectsASPMail2, PersitsASPMail, CDONTS and BambooSMTP pSupportErrorShowDetails = -1 ' error debug level, trap common DB errors pTrapDbErrors=0 %> <% ' Comersus Sophisticated Cart ' Comersus Open Technologies ' USA - 2006 ' http://www.comersus.com ' Details: Get one setting key %> <% function getSettingKey(pSettingKey) dim rstempGetSetting mySQL="SELECT settingValue FROM settings WHERE settingKey='" &pSettingKey& "' AND idStore=" &pIdStore call getFromDatabase(mySQL, rstempGetSetting, "getSettingKey") if not rstempGetSetting.eof then getSettingKey=rstempGetSetting("settingValue") else getSettingKey="" end if end function %> <% ' Comersus Sophisticated Cart ' Comersus Open Technologies ' USA - 2006 ' http://www.comersus.com ' Details: functions to open and close db connection %> <% '-------------------------------------------------------------------- ' Microsoft ADO ' ' (c) 1996 Microsoft Corporation. All Rights Reserved. ' ' ' ' ADO constants include file for VBScript ' '-------------------------------------------------------------------- '---- CursorTypeEnum Values ---- Const adOpenForwardOnly = 0 Const adOpenKeyset = 1 Const adOpenDynamic = 2 Const adOpenStatic = 3 '---- CursorOptionEnum Values ---- Const adHoldRecords = &H00000100 Const adMovePrevious = &H00000200 Const adAddNew = &H01000400 Const adDelete = &H01000800 Const adUpdate = &H01008000 Const adBookmark = &H00002000 Const adApproxPosition = &H00004000 Const adUpdateBatch = &H00010000 Const adResync = &H00020000 Const adNotify = &H00040000 '---- LockTypeEnum Values ---- Const adLockReadOnly = 1 Const adLockPessimistic = 2 Const adLockOptimistic = 3 Const adLockBatchOptimistic = 4 '---- ExecuteOptionEnum Values ---- Const adRunAsync = &H00000010 '---- ObjectStateEnum Values ---- Const adStateClosed = &H00000000 Const adStateOpen = &H00000001 Const adStateConnecting = &H00000002 Const adStateExecuting = &H00000004 '---- CursorLocationEnum Values ---- Const adUseServer = 2 Const adUseClient = 3 '---- DataTypeEnum Values ---- Const adEmpty = 0 Const adTinyInt = 16 Const adSmallInt = 2 Const adInteger = 3 Const adBigInt = 20 Const adUnsignedTinyInt = 17 Const adUnsignedSmallInt = 18 Const adUnsignedInt = 19 Const adUnsignedBigInt = 21 Const adSingle = 4 Const adDouble = 5 Const adCurrency = 6 Const adDecimal = 14 Const adNumeric = 131 Const adBoolean = 11 Const adError = 10 Const adUserDefined = 132 Const adVariant = 12 Const adIDispatch = 9 Const adIUnknown = 13 Const adGUID = 72 Const adDate = 7 Const adDBDate = 133 Const adDBTime = 134 Const adDBTimeStamp = 135 Const adBSTR = 8 Const adChar = 129 Const adVarChar = 200 Const adLongVarChar = 201 Const adWChar = 130 Const adVarWChar = 202 Const adLongVarWChar = 203 Const adBinary = 128 Const adVarBinary = 204 Const adLongVarBinary = 205 '---- FieldAttributeEnum Values ---- Const adFldMayDefer = &H00000002 Const adFldUpdatable = &H00000004 Const adFldUnknownUpdatable = &H00000008 Const adFldFixed = &H00000010 Const adFldIsNullable = &H00000020 Const adFldMayBeNull = &H00000040 Const adFldLong = &H00000080 Const adFldRowID = &H00000100 Const adFldRowVersion = &H00000200 Const adFldCacheDeferred = &H00001000 '---- EditModeEnum Values ---- Const adEditNone = &H0000 Const adEditInProgress = &H0001 Const adEditAdd = &H0002 Const adEditDelete = &H0004 '---- RecordStatusEnum Values ---- Const adRecOK = &H0000000 Const adRecNew = &H0000001 Const adRecModified = &H0000002 Const adRecDeleted = &H0000004 Const adRecUnmodified = &H0000008 Const adRecInvalid = &H0000010 Const adRecMultipleChanges = &H0000040 Const adRecPendingChanges = &H0000080 Const adRecCanceled = &H0000100 Const adRecCantRelease = &H0000400 Const adRecConcurrencyViolation = &H0000800 Const adRecIntegrityViolation = &H0001000 Const adRecMaxChangesExceeded = &H0002000 Const adRecObjectOpen = &H0004000 Const adRecOutOfMemory = &H0008000 Const adRecPermissionDenied = &H0010000 Const adRecSchemaViolation = &H0020000 Const adRecDBDeleted = &H0040000 '---- GetRowsOptionEnum Values ---- Const adGetRowsRest = -1 '---- PositionEnum Values ---- Const adPosUnknown = -1 Const adPosBOF = -2 Const adPosEOF = -3 '---- enum Values ---- Const adBookmarkCurrent = 0 Const adBookmarkFirst = 1 Const adBookmarkLast = 2 '---- MarshalOptionsEnum Values ---- Const adMarshalAll = 0 Const adMarshalModifiedOnly = 1 '---- AffectEnum Values ---- Const adAffectCurrent = 1 Const adAffectGroup = 2 Const adAffectAll = 3 '---- FilterGroupEnum Values ---- Const adFilterNone = 0 Const adFilterPendingRecords = 1 Const adFilterAffectedRecords = 2 Const adFilterFetchedRecords = 3 Const adFilterPredicate = 4 '---- SearchDirection Values ---- Const adSearchForward = 1 Const adSearchBackward = -1 '---- ConnectPromptEnum Values ---- Const adPromptAlways = 1 Const adPromptComplete = 2 Const adPromptCompleteRequired = 3 Const adPromptNever = 4 '---- ConnectModeEnum Values ---- Const adModeUnknown = 0 Const adModeRead = 1 Const adModeWrite = 2 Const adModeReadWrite = 3 Const adModeShareDenyRead = 4 Const adModeShareDenyWrite = 8 Const adModeShareExclusive = &Hc Const adModeShareDenyNone = &H10 '---- IsolationLevelEnum Values ---- Const adXactUnspecified = &Hffffffff Const adXactChaos = &H00000010 Const adXactReadUncommitted = &H00000100 Const adXactBrowse = &H00000100 Const adXactCursorStability = &H00001000 Const adXactReadCommitted = &H00001000 Const adXactRepeatableRead = &H00010000 Const adXactSerializable = &H00100000 Const adXactIsolated = &H00100000 '---- XactAttributeEnum Values ---- Const adXactCommitRetaining = &H00020000 Const adXactAbortRetaining = &H00040000 '---- PropertyAttributesEnum Values ---- Const adPropNotSupported = &H0000 Const adPropRequired = &H0001 Const adPropOptional = &H0002 Const adPropRead = &H0200 Const adPropWrite = &H0400 '---- ErrorValueEnum Values ---- Const adErrInvalidArgument = &Hbb9 Const adErrNoCurrentRecord = &Hbcd Const adErrIllegalOperation = &Hc93 Const adErrInTransaction = &Hcae Const adErrFeatureNotAvailable = &Hcb3 Const adErrItemNotFound = &Hcc1 Const adErrObjectInCollection = &Hd27 Const adErrObjectNotSet = &Hd5c Const adErrDataConversion = &Hd5d Const adErrObjectClosed = &He78 Const adErrObjectOpen = &He79 Const adErrProviderNotFound = &He7a Const adErrBoundToCommand = &He7b Const adErrInvalidParamInfo = &He7c Const adErrInvalidConnection = &He7d Const adErrStillExecuting = &He7f Const adErrStillConnecting = &He81 '---- ParameterAttributesEnum Values ---- Const adParamSigned = &H0010 Const adParamNullable = &H0040 Const adParamLong = &H0080 '---- ParameterDirectionEnum Values ---- Const adParamUnknown = &H0000 Const adParamInput = &H0001 Const adParamOutput = &H0002 Const adParamInputOutput = &H0003 Const adParamReturnValue = &H0004 '---- CommandTypeEnum Values ---- Const adCmdUnknown = &H0008 Const adCmdText = &H0001 Const adCmdTable = &H0002 Const adCmdStoredProc = &H0004 '---- SchemaEnum Values ---- Const adSchemaProviderSpecific = -1 Const adSchemaAsserts = 0 Const adSchemaCatalogs = 1 Const adSchemaCharacterSets = 2 Const adSchemaCollations = 3 Const adSchemaColumns = 4 Const adSchemaCheckConstraints = 5 Const adSchemaConstraintColumnUsage = 6 Const adSchemaConstraintTableUsage = 7 Const adSchemaKeyColumnUsage = 8 Const adSchemaReferentialContraints = 9 Const adSchemaTableConstraints = 10 Const adSchemaColumnsDomainUsage = 11 Const adSchemaIndexes = 12 Const adSchemaColumnPrivileges = 13 Const adSchemaTablePrivileges = 14 Const adSchemaUsagePrivileges = 15 Const adSchemaProcedures = 16 Const adSchemaSchemata = 17 Const adSchemaSQLLanguages = 18 Const adSchemaStatistics = 19 Const adSchemaTables = 20 Const adSchemaTranslations = 21 Const adSchemaProviderTypes = 22 Const adSchemaViews = 23 Const adSchemaViewColumnUsage = 24 Const adSchemaViewTableUsage = 25 Const adSchemaProcedureParameters = 26 Const adSchemaForeignKeys = 27 Const adSchemaPrimaryKeys = 28 Const adSchemaProcedureColumns = 29 %> <% sub openDb() if varType(connTemp)=0 or varType(connTemp)=1 then ' create the connection set connTemp = server.createObject("adodb.connection") connTemp.Open pDatabaseConnectionString if err.number <> 0 then response.redirect "comersus_supportError.asp?error="&Server.Urlencode("Error while opening DB read:"&Err.Description& "

Common solutions

1. Check that you haven't change default database path and name
2. Check that your web server has Access 97 or 2000 ODBC installed
3. Check that you have read, modify and delete permissions over database folder and database file
4. Open your database with Access program and select Repair Database option
5. Select other connection method like other connection string or DSN") end if end if end sub sub getFromDatabase(mySQL, rsTemp, scriptName) call openDb() set rsTemp = server.createObject("adodb.recordset") ' set locktype rsTemp.lockType = adLockReadOnly ' set the cursor rsTemp.cursorType = adOpenForwardOnly rsTemp.open mySQL, connTemp if err.number <> 0 then response.redirect "comersus_supportError.asp?error="&Server.Urlencode("Error in " &scriptName& ", error: "&Err.Description& " - Err.Number:"&Err.number&" - SQL:"&mySQL) end if end sub sub getFromDatabasePerPage(mySQL, rsTemp, scriptName) call openDb() set rsTemp = server.createObject("adodb.recordset") rsTemp.cursorLocation = adUseClient rsTemp.cacheSize = pNumPerPage rsTemp.open mySQL, connTemp if err.number <> 0 then response.redirect "comersus_supportError.asp?error="&Server.Urlencode("Error in " &scriptName& ", error: "&Err.Description& " - Err.Number:"&Err.number&" - SQL:"&mySQL) end if end sub sub getFromDatabaseSeek(mySQL, rsTemp, scriptName) call openDb() set rsTemp = server.createObject("adodb.recordset") rsTemp.cursorType = 3 rsTemp.lockType = 3 rsTemp.Open mySQL, connTemp if err.number <> 0 then response.redirect "comersus_supportError.asp?error="&Server.Urlencode("Error in " &scriptName& ", error: "&Err.Description& " - Err.Number:"&Err.number&" - SQL:"&mySQL) end if end sub sub updateDatabase(mySQL, rsTemp, scriptName) call openDb() set rsTemp=connTemp.execute(mySQL) if err.number <> 0 then response.redirect "comersus_supportError.asp?error="&Server.Urlencode("Update Error in " &scriptName& ", error: "&Err.Description& " - Err.Number:"&Err.number&" - SQL:"&mySQL) end if end sub function closeDB() on error resume next rsTemp.close set rsTemp = nothing connTemp.close set connTemp = nothing end function %> <% ' Comersus Sophisticated Cart ' Comersus Open Technologies ' USA - 2006 ' http://www.comersus.com ' Details: get screen message from database %> <% function getMsg(pIdScreenMessage, pMem) ' check if the product is inside the cart mySQL="SELECT screenMessage FROM screenMessages WHERE idScreenMessage=" &pIdScreenMessage& " AND idStore=" &pIdStore call getFromDatabase(mySQL, rstempMsg, "screenMessages") if not rstempMsg.eof then getMsg=rstempMsg("screenMessage") else getMsg="" end if end function %> <% ' Comersus Sophisticated Cart ' Comersus Open Technologies ' USA - 2005 ' http://www.comersus.com ' Details: misc currency functions %> <% function money(number) dim pos, indexPoint, moneyLarge, decPart, g if isNull(number) then money="0.00" else if pMoneyDontRound="-1" then money = number else money = round(number,2) end if if pDecimalSign="," then ' replace . by , money = replace(money,".",",") else ' replace , by . money = replace(money,",",".") end if if pMoneyDontRound="-1" then Pos=inStr(money,pDecimalSign) if Pos<>0 then money=mid(money,1,Pos+2) end if end if ' locate dec division indexPoint = instr(money, pDecimalSign) ' for integer, add .00 if indexPoint=0 then money = Cstr(money)+pDecimalSign+"00" end if ' calculate if 0 or 00 moneyLarge = len(money) decPart = right(money,moneyLarge-indexPoint) ' add to original numbers for g=0 to (1- (moneyLarge-indexPoint)) money = Cstr(money)+"0" next ' money=separatorMil(money) end if ' not empty end function ' use this function to display numbers like 125,000,000 function SeparatorMil(number) ' locate pDecimalSign position pDecimalSignExist = instr(number, pDecimalSign) - 1 if pDecimalSignExist <= 0 then pDecimalSignExist = len(number) end if ' add separatorMil to integers pCountNumbers = 0 if pDecimalSignExist > 3 then for indexPoint = pDecimalSignExist to 1 step -1 pNumber = mid(number,indexPoint,1) if pNumber <> pDecimalSign then pCountNumbers = pCountNumbers + 1 pSeparatorMil = pNumber & pSeparatorMil end if if pCountNumbers = 3 and (indexPoint > 1) then pSeparatorMil = "," & pSeparatorMil pCountNumbers = 0 end if pNumber = "" next ' add decimals pSeparatorMil = pSeparatorMil & mid(number, pDecimalSignExist+1, Len(number)) SeparatorMil = pSeparatorMil else SeparatorMil = number end if end function %> <% ' Comersus Sophisticated Cart ' Comersus Open Technologies ' USA - 2006 ' http://www.comersus.com ' Details: string functions %> <% function getLoginField(input,stringLength) ' to filter login fields dim regEx Set regEx = New RegExp getLoginField = left(trim(input),stringLength) regEx.Pattern = "([^-_A-Za-z0-9@.])" regEx.IgnoreCase = True regEx.Global = True getLoginField = regEx.Replace(getLoginField, "") Set regEx = nothing end function function getScreenMessage(input,stringLength) ' to filter screenMessage dim regEx Set regEx = New RegExp getScreenMessage = left(trim(input),stringLength) regEx.Pattern = "([^-_A-Za-z0-9@., ])" regEx.IgnoreCase = True regEx.Global = True getScreenMessage = regEx.Replace(getScreenMessage, "") Set regEx = nothing end function function getUserInput(input, stringLength) dim newString, regEx Set regEx = New RegExp ' only specified length newString = left(trim(input),stringLength) if pFilteringLevel=1 then regEx.Pattern = "([^A-Za-z0-9@=:/*|' _-]+.%)" regEx.IgnoreCase = True regEx.Global = True newString = regEx.Replace(newString, "") Set regEx = nothing newString = replace(newString,"--","") newString = replace(newString,";","") newString = replace(newString,"'","'") newString = replace(newString," <%if pTitle<>"" then%> <%=pCompany%> :: <%=pTitle%> <%else%> <%=pCompany%> :: OnLine Store <%end if%> <%if pMetaDescription="" then%> <%else%> <%end if%> <%if pSearchKeywords="" or isNull(pSearchKeywords) then%> <%else%> <%end if%>
 
Bay Lobsters Lobsters and Seafood
Home About Us Products Ordering Info Recipes Contact Us Log In
Home Contact Ordering Info
24 hour fresh seafood
 
 Product Search
  


 Lucky Bucks

<%=getMsg(12,"Categories")%>

<% pColumnCounter=1 do while not rstemp.eof pIdCategory =rstemp("idCategory") pCategoryDesc =rstemp("categoryDesc") pImageCategory =rstemp("imageCategory") %> <%if pColumnCounter=1 then%> <%end if%> <%if pColumnCounter=3 then%> <%end if%> <% pColumnCounter = pColumnCounter+1 if pColumnCounter=4 then pColumnCounter=1 end if rstemp.movenext loop ' adjust table if pColumnCounter=2 then response.write "" end if if pColumnCounter=3 then response.write "" end if %>
<%if pImageCategory<>"" then%> <%=pCategoryDesc%>
<%end if%> <%=pCategoryDesc%>

  
 
<% pPayPalExpressCheckout = getSettingKey("pPayPalExpressCheckout") pGoogleCheckoutLevel1 = getSettingKey("pGoogleCheckoutLevel1") %>
  <%if pIdCustomer=0 then%>
<%if pStoreFrontDemoMode="-1" then%>   <%else%>   <%end if%>

 
<%else%> Welcome back <%=session("customerName")%>

   Your Account
   Logout
<%end if%>
 
 
  <% ' Comersus Shopping Cart ' Comersus Open Technologies ' United States ' Software License can be found at License.txt ' http://www.comersus.com ' Details: get root categories %> <% pShowCategories = getSettingKey("pShowCategories") if pShowCategories="-1" then %> <% pIdCategoryStart=getCategoryStart(pIdStore) dim pCountCategories pCountCategories=0 ' get categories mySQL="SELECT idCategory, categoryDesc FROM categories WHERE idParentCategory=" &pIdCategoryStart& " AND active=-1 AND idCategory<>1 ORDER BY categoryDesc" call getFromDatabase (mySql, rsTempRoot, "getRootCategories") do while not rsTempRoot.eof and pCountCategories<8%> <% pCountCategories=pCountCategories+1 rsTempRoot.movenext loop %> <% end if%>
 
 
 
 
 
 
<%if pShowSearchBox="-1" then%> <%end if%>
 
 
 
 
 
 
 
 
 
  Get your Free Shopping Cart
 
Homeabout usproductsordering inforecipescontact usRegister 
 testimonialsprivacy policy <%'if pAuctions="-1" then%> <%'end if%> <%'if pNewsLetter="-1" then%> <%'end if%>
<%'if pAllowNewCustomer="-1" then%> <%'end if%> <%'if pSuppliersList="-1" then%> <%'end if%> <%'if pRssFeedServer="-1" then%> <%'end if%> <%'if pAffiliatesStoreFront="-1" then%> <%'end if%> <%'if pRssFeedServer="-1" then%> <%'end if%>
Copyright © 2008 BayLobsters. All rights reserved.
 
<%call closeDb()%>