View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Error? Ecart Store Summary...

Thread began 1/13/2010 10:53 am by Art | Last modified 1/14/2010 1:25 pm by Art | 918 views | 6 replies

Art

jpg.gif

<%' WA eCart Store Cart Summary in Db
if ((Request.ServerVariables("Request_Method") = "POST") AND (inStr(Unescape(cStr(Request.ServerVariables("HTTP_REFERER"))),Unescape(Request.ServerVariables("SERVER_NAME")&Request.ServerVariables("SCRIPT_NAME"))) > 0)) then
WA_connection = MM_connShnta_STRING
WA_table = "dbo.atblCCN"
WA_redirectURL = ""
WA_indexField = "InvoiceID"
WA_fieldNamesStr = "Type|CCN|CSC|Amount|aYear|aMonth|CustID|CreditOrCall|CallBackPhone"
WA_fieldValuesStr = "" & cStr(cStr(Request.Form("CCType"))) & "" & "|" & "" & cStr(cStr(Request.Form("CCNumber"))) & "" & "|" & "" & cStr(cStr(Request.Form("CSC"))) & "" & "|" & WA_eCDB_ConvertNumber("" & cStr(WA_eCart_GrandTotal(shnta_eCart)) & "") & "|" & "" & cStr(cStr(Request.Form("CCYear"))) & "" & "|" & "" & cStr(cStr(Request.Form("CCMonth"))) & "" & "|" & WA_eCDB_ConvertNumber("" & cStr( Session("ssSessionID") ) & "") & "|" & WA_eCDB_ConvertNumber("" & cStr(cStr(Request.Form("payType"))) & "") & "|" & "" & cStr(cStr(Request.Form("CallBackNumber"))) & ""
WA_columnTypesStr = "',none,''|',none,''|',none,''|none,none,NULL|',none,''|',none,''|none,none,NULL|none,none,NULL|',none,''"
WA_sessionName = "ssStoreInvoice"
indexFieldIndex = -1
WA_fieldValues = Split(WA_fieldValuesStr,"|")
WA_fieldNames = Split(WA_fieldNamesStr,"|")
WA_columns = Split(WA_columnTypesStr,"|")
set WA_editCmd = Server.CreateObject("ADODB.Command")
updateFieldValue = ""
WA_editCmd.ActiveConnection = WA_connection
if (WA_redirectURL <> "" AND Request.QueryString <> "" AND Request.QueryString.Count > 0) then
if (inStr(WA_redirectURL,"?") > 0) then
WA_redirectURL = WA_redirectURL & "&"
else
WA_redirectURL = WA_redirectURL & "?"
end if
WA_redirectURL = WA_redirectURL & Request.QueryString
end if
for i = 0 to Ubound(WA_fieldNames)
if (WA_indexField = WA_fieldNames(i)) then
indexFieldIndex = i
exit for
end if
next
if (indexFieldIndex >= 0) then updateFieldValue = WA_fieldValues(indexFieldIndex)
if (updateFieldValue = "") then updateFieldValue = cStr(Session(WA_sessionName))
updateColType = "none,none,NULL"
if (indexFieldIndex >= 0) then
updateColType = WA_columns(indexFieldIndex)
end if
if (updateFieldValue <> "" AND updateFieldValue <> "undefined") then
valueForWhere = WA_generateInsertParams(Array(WA_indexField), Array(updateColType), Array(updateFieldValue), -1)
sqlstr = "select " & WA_indexField & " from " & WA_table & " where " & WA_indexField & " = " & valueForWhere(2) & " order by " & WA_indexField & " DESC"
set WA_eCartRecordset = Server.CreateObject("ADODB.Recordset")
WA_eCartRecordset.ActiveConnection = WA_connection
WA_eCartRecordset.Source = sqlstr
WA_eCartRecordset.CursorType = 0
WA_eCartRecordset.CursorLocation = 2
WA_eCartRecordset.LockType = 1
WA_eCartRecordset.Open()
if (NOT WA_eCartRecordset.EOF) then
updateFieldValue = cStr(WA_eCartRecordset.Fields.Item(WA_indexField).Value)
else
updateFieldValue = ""
end if
WA_eCartRecordset.Close()
end if
if (updateFieldValue <> "" AND updateFieldValue <> "undefined") then
updateParamsObj = WA_generateInsertParams(WA_fieldNames, WA_columns, WA_fieldValues, indexFieldIndex)
valueForWhere = WA_generateInsertParams(Array(WA_indexField), Array(updateColType), Array(updateFieldValue), -1)
WA_editCmd.CommandText = "update " & WA_table & " SET " & updateParamsObj(3) & " where " & WA_indexField & " = " & valueForWhere(2)
WA_editCmd.Execute()
WA_editCmd.ActiveConnection.Close()
else
updateFieldValue = ""
insertParamsObj = WA_generateInsertParams(WA_fieldNames, WA_columns, WA_fieldValues, -1)
WA_editCmd.CommandText = "insert into " & WA_table & " (" & insertParamsObj(1) & ") values (" & insertParamsObj(2) & ")"
WA_editCmd.Execute()
WA_editCmd.ActiveConnection.Close()
end if
if (indexFieldIndex < 0) then
if (updateFieldValue = "") then
obj = WA_generateWhereClause(WA_fieldNames, WA_columns, WA_fieldValues, indexFieldIndex)
sqlstr = "select " & WA_indexField & " from " & WA_table & " where " & obj & " order by " & WA_indexField & " DESC"
set WA_eCartRecordset = Server.CreateObject("ADODB.Recordset")
WA_eCartRecordset.ActiveConnection = WA_connection
WA_eCartRecordset.Source = sqlstr
WA_eCartRecordset.CursorType = 0
WA_eCartRecordset.CursorLocation = 2
WA_eCartRecordset.LockType = 1
WA_eCartRecordset.Open()
if (NOT WA_eCartRecordset.EOF) then Session(WA_sessionName) = WA_eCartRecordset.Fields.Item(WA_indexField).Value
WA_eCartRecordset.Close()
else
Session(WA_sessionName) = updateFieldValue
end if
else
Session(WA_sessionName) = WA_fieldValues(indexFieldIndex)
end if
if (WA_redirectURL <> "") then
Response.Redirect(WA_redirectURL)
end if
end if
%>

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...