Skip to content

Instantly share code, notes, and snippets.

@abirnbaum
Last active December 19, 2015 03:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save abirnbaum/5887762 to your computer and use it in GitHub Desktop.
Save abirnbaum/5887762 to your computer and use it in GitHub Desktop.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<CFOUTPUT>
<!--- Check to see if Phone 2 even exists --->
<cfif #Form.Phone2# NEQ '' />
<cfset Phone2 = #Form.Phone2# />
<cfelse>
<cfset Phone2 = '' />
</cfif>
<cfset systemID ='614' />
<!--- TeleScrip SystemID--->
<cfset PlanInfoID = '10970' />
<!--- $19.95 Plan --->
<!---don't forget stateID --->
<cfquery name="BillState" datasource="#Application.Settings.DSN#">
SELECT StateID
FROM wbx.State
WHERE wbx.State.Code = #form.BillState#
</cfquery>
<cfset StateID = #BillState#>
<cfset MemberstatusId = '3' />
<cfset Frequency = '1' />
<cfset EnrollmentFlag = 'Y' />
<!- ARE THESE NECESSARY? --->
<CFQUERY Name="InsertMemberInfo" result="memberResult"
datasource="#Application.Settings.DSN#">
INSERT INTO wbx.Members
(SystemID, FirstName, LastName, Address1, City, StateID, Zip,
Email, Phone1, Phone2, MemberStatusID, Frequency, Created, EnrollmentFlag)
VALUES
(<cfqueryparam value="#systemID# cfsqltype="cf_sql_integer" />,
<cfqueryparam value="#form.FirstName#" cfsqltype="cf_sql_varchar" />
<cfqueryparam value="#form.LastName#" cfsqltype="cf_sql_varchar" />
<cfqueryparam value="#form.ShipAddress#" cfsqltype="cf_sql_varchar" />
<cfqueryparam value="#form.ShipCity#" cfsqltype="cf_sql_varchar" />
<cfqueryparam value="#form.ShipZip#" cfsqltype="cf_sql_integer" />,
<cfqueryparam value="#form.email#" cfsqltype="cf_sql_varchar" />
<cfqueryparam value="#form.Phone1#" cfsqltype="cf_sql_integer" />,
<cfqueryparam value="#Phone2#" cfsqltype="cf_sql_integer" />,
<cfqueryparam value="#MemberStatusID#" cfsqltype="cf_sql_varchar" />
<cfqueryparam value="#Frequency#" cfsqltype="cf_sql_integer" />,
<cfqueryparam value="#EnrollmentFlag#" cfsqltype="cf_sql_varchar" />,)
</CFQUERY>
<cfif form.BillMethod IS 1>
<cfset BillingTypeID = '1'>
<cfelse>
<cfset BillingTypeID = '2'>
</cfif>
<cfset Created = Now()>
<cfset DeletedFlag= 'N'>
<CFQUERY Name="InsertBillingInfo"
datasource="#Application.Settings.DSN#">
INSERT INTO wbx.MemberBillingInfo
(MemberID, BillingTypeID,
<cfif BillMethod EQ '1'>
CardName, CardNumber, CardCode, CardExpire,
<cfelse>
BankName, BankAcctName, BankAcctNumber, BankAcctRouting, BankAcctType,
</cfif>
Created, DeletedFlag)
VALUES
(<cfif BillingTypeID EQ 1>
(<cfqueryparam value="#memberResult.IDENTITYCOL#" cfsqltype="cf_sql_integer" />,
<cfqueryparam value ="1" cfsqltype="cf_sql_integer" />,
<cfqueryparam value="#form.CardName#" cfsqltype="cf_sql_varchar" />
<cfqueryparam value="#form.CardNumber#" cfsqltype="cf_sql_integer" />,
<cfqueryparam value="#form.CardCode#" cfsqltype="cf_sql_integer" />,
<cfqueryparam value="#form.CardExpire#" cfsqltype="cf_sql_integer" />)
<cfelseif BillingTypeID EQ 2>
(<cfqueryparam value="#memberResult.IDENTITYCOL#" cfsqltype="cf_sql_integer" />,
<cfqueryparam value ="1" cfsqltype="cf_sql_integer" />,
<cfqueryparam value="#form.BankName#" cfsqltype="cf_sql_varchar" />,
<cfqueryparam value="#form.BankAcctName#" cfsqltype="cf_sql_varchar" />,
<cfqueryparam value="#form.BankAcctNumber#" cfsqltype="cf_sql_integer" />,
<cfqueryparam value="#form.BankAcctRouting#" cfsqltype="cf_sql_integer" />,
<cfqueryparam value="#form.BankAcctType#" cfsqltype="cf_sql_varchar" />)
</cfif>
<cfqueryparam value="#Created#" cfsqltype="cf_sql_varchar" />)
<cfqueryparam value="#DeletedFlag#" cfsqltype="cf_sql_varchar" />)
</cfquery>
</CFOUTPUT>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment