|
Server : Apache/2.4.62 System : FreeBSD fbsdweb2.web.rcn.net 14.1-RELEASE FreeBSD 14.1-RELEASE releng/14.1-n267679-10e31f0946d8 GENERIC amd64 User : www ( 80) PHP Version : 8.3.8 Disable Function : NONE Directory : /domains/antiqueweb1/ |
Upload File : |
' Copyright (c) 2000 ComCity. All Rights Reserved
' SalesCart 2.0
'
' File: global.asa
' Version: 2.0
' ASP file that controls application and session-wide variables
'
' DO NOT CHANGE- UNLESS YOU REALLY KNOW WHAT YOU'RE DOING!
'
<SCRIPT LANGUAGE=VBScript RUNAT=Server>
Sub Application_OnStart
'==FrontPage Generated - startspan==
Dim FrontPage_UrlVars(1)
'--Project Data Connection
Application("SalesCart1_ConnectionString") = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=URL=fpdb/shop.mdb"
FrontPage_UrlVars(0) = "SalesCart1_ConnectionString"
Application("SalesCart1_ConnectionTimeout") = 15
Application("SalesCart1_CommandTimeout") = 30
Application("SalesCart1_CursorLocation") = 3
Application("SalesCart1_RuntimeUserName") =""
Application("SalesCart1_RuntimePassword") =""
'--
Application("FrontPage_UrlVars") = FrontPage_UrlVars
'==FrontPage Generated - endspan==
End Sub
Sub FrontPage_StartSession
On Error Resume Next
if Len(Application("FrontPage_VRoot")) > 0 then Exit Sub
' discover the VRoot for the current page;
' walk back up VPath until we find global.asa
Vroot = Request.ServerVariables("PATH_INFO")
strG1 = "global.asa"
strG1 = "Global.asa"
iCount = 0
do while Len(Vroot) > 1
idx = InStrRev(Vroot, "/")
if idx > 0 then
Vroot = Left(Vroot, idx)
else
' error; assume root web
Vroot = "/"
end if
if FrontPage_FileExists(Server.MapPath(Vroot & strG1)) then exit do
if FrontPage_FileExists(Server.MapPath(Vroot & strG2)) then exit do
if Right(Vroot, 1) = "/" then Vroot = Left(Vroot, Len(Vroot) - 1)
iCount = iCount + 1
if iCount > 100 then
' error; assume root web
Vroot = "/"
exit do
end if
loop
' map all URL= attributes in _ConnectionString variables
Application.Lock
if Len(Application("FrontPage_VRoot")) = 0 then
Application("FrontPage_VRoot") = Vroot
UrlVarArray = Application("FrontPage_UrlVars")
for i = 0 To UBound(UrlVarArray)
if Len(UrlVarArray(i)) > 0 then FrontPage_MapUrl (UrlVarArray(i))
next
end if
Application.Unlock
End Sub
Function FrontPage_FileExists(fspath)
On Error Resume Next
FrontPage_FileExists = False
Set fs = CreateObject("Scripting.FileSystemObject")
Err.Clear
Set istream = fs.OpenTextFile(fspath)
if Err.Number = 0 then
FrontPage_FileExists = True
istream.Close
end if
Set istream = Nothing
Set fs = Nothing
End Function
Sub FrontPage_MapUrl(AppVarName)
' convert URL attribute in conn string to absolute file location
strval = Application(AppVarName)
strKey = "URL="
idxStart = InStr(strval, strKey)
if idxStart = 0 then Exit Sub
strBefore = Left(strval, idxStart - 1)
idxStart = idxStart + Len(strKey)
idxEnd = InStr(idxStart, strval, ";")
if idxEnd = 0 then
strAfter = ""
strURL = Mid(strval, idxStart)
else
strAfter = ";" & Mid(strval, idxEnd + 1)
strURL = Mid(strval, idxStart, idxEnd - idxStart)
end if
strOut = strBefore & Server.MapPath(Application("FrontPage_VRoot") & strURL) & strAfter
Application(AppVarName) = strOut
End Sub
Sub Application_OnEnd
End Sub
Sub Session_OnStart
FrontPage_StartSession '==FrontPage Generated==
SC_StartSession '==SalesCart Generated==
End Sub
Sub SC_StartSession()
On Error Resume Next
' Do session specific initialization
Session("orderid") = 0
Session("mallid") = 0
' Set your email address here
Session("myemail") = "[email protected]"
' Set your default text that shows on top of emails here
' Absolute path required
Session("mytext") = Server.MapPath(Application("FrontPage_VRoot")) & "\cgi-bin\email.txt"
' This is where you set the email subject for emailed receipts
Session("receiptsubject") = "SalesCart Order Receipt - MARKETANTIQUE"
' This is where you set the email subject for confirmations sent to merchants
Session("confsubject") = "SalesCart Order to-be-processed - Merch Conf MARKETANTIQUE"
' Set your DSN or Database usernames and passwords here
Session("ConnectionString") = Application("SalesCart1_ConnectionString") & "; UID=" & Application("SalesCart1_RuntimeUserName") & "; PWD=" & Application("SalesCart1_RuntimePassword") & ";"
' Set your whole order discounting here as a % of 100 (ie 10%)
' Set TotalDiscount to 0 for NO discount
Session("TotalDiscount") = 1
' Set the amount to start applying the whole order discount
' Use the same units (ie > $100 dollars) that you would use
Session("StartDiscount") = 1000000
End Sub
Sub Session_OnEnd
End Sub
</SCRIPT>