Link to home
Start Free TrialLog in
Avatar of PaulyWolly
PaulyWolly

asked on

I have 3 forms gathering different pieces of data - I want a generic form processing page...

I have 8 different CFM forms gathering different pieces of data. I want a generic form processing page to accept any of the forms output and process to place in my DB. I have over 100 fields of different data that I want to place in the DB, but I do not want to write a new form processing page for each form I am working with. Can a generic BIG processing form be used to gather just what is sent to it to process?

A I have it now -

Entry form                 Processing form                      
NewIndividualMember.cfm -> processIndividualMember.cfm
NewAssociateMember.cfm ->  processAssociateMember.cfm
NewChefMember.cfm ->       processChefMember.cfm
NewBakerMember.cfm ->      processBakerMember,cfm
...

I have 8 'Entry Forms' , and I do not want to have to create a processing form for each. I want to create a generic form processing script that will process any of the data that is sent to it.

Presently I have set up multiple <cfif len(Form.field1)>field1</cfif> statements to try and only capture what is being sent through the POST but it is not working.

Here is an example:

1.
[ NewAssociateMember.cfm ]
<form action="processAssociateMember.cfm" method="POST">
   <input type="text" name="FirstName" >
   <input type="" name="LastName" >
   <input type="text" name="MiddleInitial">
   <input type="submit>
</form>

[ processAssociateMember.cfm ]
<CFOUTPUT>
<cfquery datasource="#Request.DSN#">
    INSERT INTO Members
            (JoinMethod, MemberNickname, FirstName, LastName, MiddleInitial, Address, Address2, City, State, Zip, Country,

            <!--- Added if passed from form -------------------------->
            <CFIF Len(FORM.AltAddress) NEQ 0>AltAddress,</CFIF>
            <CFIF Len(FORM.AltAddress2) NEQ 0>AltAddress2,</CFIF>
            <CFIF Len(FORM.AltCity) NEQ 0>AltCity,</CFIF>
            <CFIF Len(FORM.MemberLevel) NEQ 0>MemberLevel</CFIF>
            )
            
      VALUES
        (GETDATE(),              
        '#FORM.JoinMethod#',    
        <CFIF Len(FORM.MemberNickName) NEQ 0>'#FORM.MemberNickname#',</CFIF>      
        '#FORM.FirstName#',  
        '#FORM.LastName#',  
        '#FORM.MiddleInitial#',  
        <CFIF Len(FORM.Address) NEQ 0>'#FORM.Address#',</CFIF>        
        <CFIF Len(FORM.Address2) NEQ 0>'#FORM.Address2#',</CFIF>        
        <CFIF Len(FORM.city) NEQ 0>'#FORM.city#', </CFIF>          
        <CFIF Len(FORM.State) NEQ 0>'#FORM.State#',</CFIF>      
        <CFIF Len(left(trim(FORM.Zip),5)) NEQ 0>'#left(trim(FORM.Zip),5)#', </CFIF>            
        <CFIF Len(FORM.Country) NEQ 0>'#FORM.Country#',</CFIF>
        
        <!--- Added if passed from form -------------------------->       
        <CFIF Len(FORM.AltAddress) NEQ 0>'#FORM.AltAddress#',</CFIF>
        <CFIF Len(FORM.AltAddress2) NEQ 0>'#FORM.AltAddress2#',</CFIF>        
        <CFIF Len(FORM.AltCity) NEQ 0>'#FORM.Altcity#', <CFIF>
        <CFIF Len(FORM.MemberLevel) NEQ 0>'#MemberLevel#'</CFIF>
        )
</CFQUERY>
<CFOUTPUT>

[ NewAssociateMemberAddress.cfm ]
<form action="processAssociateMemberAddress.cfm" method="POST">
   <input type="text" name="Address" >
   <input type="" name="Address2" >
   <input type="text" name="City">
   <input type="text" name="State" >
   <input type="" name="Zip" >
   <input type="text" name="Country">  
   <input type="submit>
</form>

[ processAssociateMemberAddress.cfm ]
<CFOUTPUT>
<cfquery datasource="#Request.DSN#">
    INSERT INTO Members
        (JoinMethod, MemberNickname, FirstName, LastName, MiddleInitial, Address, Address2, City, State, Zip, Country,
            <!--- Added if passed from form -------------------------->
            <CFIF Len(FORM.AltAddress) NEQ 0>AltAddress,</CFIF>
            <CFIF Len(FORM.AltAddress2) NEQ 0>AltAddress2,</CFIF>
            <CFIF Len(FORM.AltCity) NEQ 0>AltCity,</CFIF>
            <CFIF Len(FORM.MemberLevel) NEQ 0>MemberLevel</CFIF>
        )
      VALUES
        (GETDATE(),              
        '#FORM.JoinMethod#',    
        <CFIF Len(FORM.MemberNickName) NEQ 0>'#FORM.MemberNickname#',</CFIF>      
        '#FORM.FirstName#',  
        '#FORM.LastName#',  
        '#FORM.MiddleInitial#',  
        <CFIF Len(FORM.Address) NEQ 0>'#FORM.Address#',</CFIF>        
        <CFIF Len(FORM.Address2) NEQ 0>'#FORM.Address2#',</CFIF>        
        <CFIF Len(FORM.city) NEQ 0>'#FORM.city#', </CFIF>          
        <CFIF Len(FORM.State) NEQ 0>'#FORM.State#',</CFIF>      
        <CFIF Len(left(trim(FORM.Zip),5)) NEQ 0>'#left(trim(FORM.Zip),5)#', </CFIF>            
        <CFIF Len(FORM.Country) NEQ 0>'#FORM.Country#',</CFIF>  
        <!--- Added if passed from form -------------------------->       
        <CFIF Len(FORM.AltAddress) NEQ 0>'#FORM.AltAddress#',</CFIF>
        <CFIF Len(FORM.AltAddress2) NEQ 0>'#FORM.AltAddress2#',</CFIF>        
        <CFIF Len(FORM.AltCity) NEQ 0>'#FORM.Altcity#', <CFIF>
        <CFIF Len(FORM.MemberLevel) NEQ 0>'#MemberLevel#'</CFIF>
        )
</CFQUERY>
<CFOUTPUT>

I keep getting this error: "Element JOINMETHOD is undefined in FORM."
If I comment out this line on the processing form, then I get the error for the next entry in the processing form.

This seems to work if I comment out all the fields of info that are NOT on the form that is POSTING the data. I want to create a processing form that will not care what is posted and process the info regardless.

Ideally I would like to have 1 'Entry' form with all the fields in it and have only what is required viewable with CSS, and 1 'Processing' form that would not complain what is being POSTED to it, and process the info into the database and redirect to the detail page for the entry just added.

Any help appreciated.

        

[ NewFriendMember.cfm ]
<!--- Include the security functions. --->
<cfinclude template="/v2/security.cfm">
 
<cfparam name="ErrorInputName" default="" type="string">
<cfparam name="ErrorMessage" default="" type="string">
<!--- Get the SourceCodes from the database --->
<CFSTOREDPROC datasource="#Request.DSN#" procedure="sp_getSourceCodes">
  <CFPROCRESULT name="getSourceCodes">
</CFSTOREDPROC>
<!--- Get the channels by which members can join. --->
<cfquery datasource="#Request.DSN#" name="GetChannel">
SELECT     channelID, Channel
FROM         channel
ORDER BY Channel
</cfquery>
<!--- Get the file groups for the CF_TwoSelectsRelated tag. --->
<CFSTOREDPROC procedure="sp_getIndividualMembershipDuesMatrix" datasource="#Request.DSN#">
  <CFPROCRESULT name="DuesMatrix">
</CFSTOREDPROC>
<!--- Get the list of States for the States dropdown. --->
<cfquery datasource="#Request.DSN#" name="States" cachedwithin="#CreateTimeSpan(1, 0, 0, 0)#">
SELECT   State, StateName
FROM     States
ORDER BY StateName
</cfquery>
<!--- Get the list of Countries for the Country dropdown. --->
<cfquery datasource="#Request.DSN#" name="Countries" cachedwithin="#CreateTimeSpan(1, 0, 0, 0)#">
SELECT   CountryCode, CountryName
FROM     Countries
ORDER BY SortOrder
</cfquery>
<!--- Get the list of Complimnetary Designations --->
<CFQUERY datasource="#Request.DSN#" name="getCompDesignation">
SELECT *
FROM CompMembershipDesignation
ORDER BY CompDesignation
</CFQUERY>
 
<!--- Get the list of Complimnetary Events --->
<CFQUERY datasource="#Request.DSN#" name="getCompEvent">
SELECT *
FROM CompMembershipEvent
ORDER BY CompEvent
</CFQUERY>
 
<cfquery name="getCompMembCatEarned" datasource="#Request.DSN#">
SELECT *
FROM dbo.CompMembershipCategoryEarned
</cfquery>
 
<!--- Get the list of Member Types (Positions & Titles) --->
<cfquery name="getMemberType" datasource="#Request.DSN#">
SELECT *
FROM dbo.MemberTypes
</cfquery>
 
 
<!--- Get the list of Comp Reasons for Associats. --->
<CFQUERY datasource="#Request.DSN#" name="getComps">
SELECT *
FROM ValidCompsAssoc
ORDER BY CompReason
</CFQUERY>
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<TITLE>James Beard Member Database</TITLE>
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<LINK href="../../css/default.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {
	color: #FF0000;
	font-style: italic;
}
.style3 {font-size: 10px}
-->
</style>
<script language="javascript" type="text/javascript" src="Includes/datetimepicker.js">
 
//Date Time Picker script- by TengYong Ng of http://www.rainforestnet.com
//Script featured on JavaScript Kit (http://www.javascriptkit.com)
//For this script, visit http://www.javascriptkit.com 
</script>
<script type="text/javascript">
<!--
function ShowLayer(id, off){
    document.all[id].style.display = "block";
    document.all[off].style.display = "none";
}
function ShowHiddenLayer(id) {
	document.all[id].style.display = "block";
}
function HideLayer(id) {
	document.all[id].style.display = "none";
}
function showMe (it, box) { 
	var vis = (box.checked) ? "block" : "none"; 
	document.getElementById(it).style.display = vis;
} 
//--> 
</script>
</HEAD>
<BODY>
 
<TABLE width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFCC33">
  <TR>
    <TD align="left" valign="bottom"><IMG src="../../images/headerLg.gif" width="640" height="70" vspace="4" /></TD>
    <TD align="right"><IMG src="../../images/pinapple.gif" vspace="4" /></TD>
  </TR>
    <TR>
    <TD height="21" colspan="2" background="../../images/bg_header_shade.gif" bgcolor="#FFFFFF">&nbsp;</TD>
  </TR>
</TABLE>
 
<TABLE width="100%" border="0" cellspacing="0" cellpadding="10">
  <TR>
    <TD><!--- Begin: Content Here --->
<TABLE width="100%" border="0" cellspacing="0" cellpadding="10">
  <TR>
    <TD bgcolor="#FFFFFF"><TABLE border="0" cellspacing="0" cellpadding="0" align="right">
        <TR>
          <TD class="mininav"><cfoutput><A href="/v2/index1.cfm">Main Menu</A> | <A href="index.cfm">Member Locator</A> | <A href="#CurrentPage#?MM_logout=1">Logout</A></cfoutput></TD>
        </TR>
      </TABLE>
      <cfoutput><H3>Friend Member Enrollment Form </H3>
        <!--- If there are any errors display them here --->
        <cfif Len(ErrorMessage) GT 0>
          <UL class="ErrorMessage">
            <cfloop list="#ErrorMessage#" index="Error">
              <LI>#Error#</LI>
            </cfloop>
          </UL>
        </cfif>
        <FORM action="EnrollMember_DBADD.cfm" method="post" name="form" id="form" onSubmit="return require_TermAndDues();">
          <TABLE width="772" cellpadding="3" cellspacing="0"  border="0">
            <TR>
              <TD colspan="4" align="right"><FONT color="##CC0000">* Required Information</FONT> </TD>
            </TR>
            <TR class="NewHeader111">
              <TD colspan="6">Company</TD>
            </TR>
            <TR>
              <TD><strong>Company Name:</strong></TD>
              <TD colspan="5"><label>
              <INPUT class="tableRow" type="Text" name="Company" size="50" maxlength="20" <cfif IsDefined("FORM.Company")>value="#FORM.Company#"</cfif>>
              (Optional)</label></TD>
              </TR>
            <TR>
              <TD colspan="4">&nbsp;</TD>
            </TR>
            <TR class="NewHeader111">
              <TD colspan="6">Personal Information</TD>
            </TR>
            <TR class="tableRow">
              <TD width="98" <cfif ListFindNoCase(ErrorInputName, "FirstNameShip")>class="ErrorMessage"</cfif>><STRONG>First Name:</STRONG></TD>
              <TD colspan="3"><INPUT class="tableRow" type="Text" name="FirstName" size="25" maxlength="20" <cfif IsDefined("FORM.FirstName")>value="#FORM.FirstName#"</cfif>>
                <FONT color="##CC0000">*</FONT></TD>
            </TR>
            <TR class="tableRow">
              <TD <cfif ListFindNoCase(ErrorInputName, "LastNameShip")>class="ErrorMessage"</cfif>><STRONG>Last Name:</STRONG></TD>
              <TD colspan="3"><INPUT class="tableRow" type="Text" name="LastName" size="25" maxlength="25" <cfif IsDefined("FORM.LastName")>value="#FORM.LastName#"</cfif>>
                <FONT color="##CC0000">*</FONT></TD>
            </TR>
            <TR class="tableRow">
              <TD><STRONG>Middle Initial:</STRONG> </TD>
              <TD colspan="3"><INPUT name="MiddleInitial" type="Text" class="tableRow" id="MiddleInitial" size="2" maxlength="5" <cfif IsDefined("FORM.MiddleInitial")>value="#FORM.MiddleInitial#"</cfif>></TD>
            </TR>
            <tr class="tableRow">
              <td><strong>Email Address:</strong></td>
              <td width="186"><input class="tableRow" type="Text" name="EmailAddress" size="30" maxlength="40" <cfif IsDefined("FORM.EmailAddress")>value="#FORM.EmailAddress#"</cfif>></td>
              <td width="89"><div align="right"><strong>Send Emails?</strong></div></td>
              <td width="375" colspan="4"><label>
                <input type="radio" name="emailable" value="yes" id="emailable_0" selected>
                Yes</label>
                  <label>
                  <input type="radio" name="emailable" value="no" id="emailable_1">
                    No</label>
                &nbsp;
                <label>
                  <input type="radio" name="emailable" value="no_partner_only" id="emailable_2">
                  No Partner Only</label></td>
            </tr>
            <TR class="tableRow">
              <TD <cfif ListFindNoCase(ErrorInputName, "LastNameShip")>class="ErrorMessage"</cfif>>&nbsp;</TD>
              <TD colspan="3">&nbsp;</TD>
            </TR>
           <TR class="NewHeader111">
              <TD colspan="6">Contact Information</TD>
            </TR>
            <TR class="tableRow">
              <TD <cfif ListFindNoCase(ErrorInputName, "PhoneNumber")>class="ErrorMessage"</cfif>><STRONG>Home Phone Number:</STRONG></TD>
              <TD colspan="3"><INPUT class="tableRow" name="AreaCode" size="3" maxlength="3" <cfif IsDefined("FORM.AreaCode")>value="#FORM.AreaCode#"</cfif>>
                -
                <INPUT class="tableRow" name="Phone1" size="3" maxlength="3" <cfif IsDefined("FORM.Phone1")>value="#FORM.Phone1#"</cfif>>
                -
                <INPUT class="tableRow" name="Phone2" size="4" maxlength="4" <cfif IsDefined("FORM.Phone2")>value="#FORM.Phone2#"</cfif>></TD>
            </TR>
            <TR class="tableRow">
              <TD <cfif ListFindNoCase(ErrorInputName, "WorkNumber")>class="ErrorMessage"</cfif>><STRONG>Work Phone Number:</STRONG></TD>
              <TD colspan="3"><INPUT class="tableRow" name="WorkAreaCode" size="3" maxlength="3" <cfif IsDefined("FORM.WorkAreaCode")>value="#FORM.WorkAreaCode#"</cfif>>
                -
                <INPUT class="tableRow" name="Work1" size="3" maxlength="3" <cfif IsDefined("FORM.Work1")>value="#FORM.Work1#"</cfif>>
                -
                <INPUT class="tableRow" name="Work2" size="4" maxlength="4" <cfif IsDefined("FORM.Work2")>value="#FORM.Work2#"</cfif>>
                &nbsp;Ext:  
                <INPUT class="tableRow" name="WorkExt" size="4" maxlength="4" <cfif IsDefined("FORM.WorkExt")>value="#FORM.WorkExt#"</cfif>></TD>
            </TR>
            <TR class="tableRow">
              <TD <cfif ListFindNoCase(ErrorInputName, "CellNumber")>class="ErrorMessage"</cfif>><STRONG>Cell Phone Number:</STRONG></TD>
              <TD colspan="3"><INPUT class="tableRow" name="CellAreaCode" size="3" maxlength="3" <cfif IsDefined("FORM.CellAreaCode")>value="#FORM.CellAreaCode#"</cfif>>
                -
                <INPUT class="tableRow" name="Cell1" size="3" maxlength="3" <cfif IsDefined("FORM.Cell1")>value="#FORM.Cell1#"</cfif>>
                -
                <INPUT class="tableRow" name="Cell2" size="4" maxlength="4" <cfif IsDefined("FORM.Cell2")>value="#FORM.Cell2#"</cfif>></TD>
            </TR>
            <TR class="tableRow">
              <TD <cfif ListFindNoCase(ErrorInputName, "FaxNumber")>class="ErrorMessage"</cfif>><STRONG>Fax Number:</STRONG></TD>
              <TD colspan="3"><INPUT class="tableRow" name="FaxAreaCode" size="3" maxlength="3" <cfif IsDefined("FORM.FaxAreaCode")>value="#FORM.FaxAreaCode#"</cfif>>
                -
                <INPUT class="tableRow" name="Fax1" size="3" maxlength="3" <cfif IsDefined("FORM.Fax1")>value="#FORM.Fax1#"</cfif>>
                -
                <INPUT class="tableRow" name="Fax2" size="4" maxlength="4" <cfif IsDefined("FORM.Fax2")>value="#FORM.Fax2#"</cfif>></TD>
            </TR>
            <TR>
              <TD colspan="4">&nbsp;</TD>
            </TR>
            <TR class="NewHeader111">
              <TD colspan="6">Mailing Address Information</TD>
            </TR>
            <TR class="tableRow">
              <TD <cfif ListFindNoCase(ErrorInputName, "Address")>class="ErrorMessage"</cfif>><STRONG>Address:</STRONG></TD>
              <TD colspan="3"><INPUT class="tableRow" type="Text" name="Address" size="30" maxlength="40" <cfif IsDefined("FORM.Address")>value="#FORM.Address#"</cfif>>
                <FONT color="##CC0000">*</FONT></TD>
            </TR>
            <TR class="tableRow">
              <TD>&nbsp;</TD>
              <TD colspan="3"><INPUT class="tableRow" type="Text" name="Address2" size="30" maxlength="40" <cfif IsDefined("FORM.Address2")>value="#FORM.Address2#"</cfif>></TD>
            </TR>
            <TR class="tableRow">
              <TD <cfif ListFindNoCase(ErrorInputName, "City")>class="ErrorMessage"</cfif>><STRONG>City:</STRONG></TD>
              <TD colspan="3"><INPUT class="tableRow" type="Text" name="City" size="30" maxlength="40" <cfif IsDefined("FORM.City")>value="#FORM.City#"</cfif>>
                <FONT color="##CC0000">*</FONT></TD>
            </TR>
            <TR class="tableRow">
              <TD><STRONG>State:</STRONG></TD>
              <TD colspan="3"><SELECT name="State" class="tableRow">
                  <CFLOOP query="States">
                    <OPTION value="#States.State#" <cfif IsDefined("FORM.State") AND FORM.State IS States.State>selected</cfif>>#States.Statename#</OPTION>
                  </CFLOOP>
                </SELECT>
                <FONT color="##CC0000">*</FONT> </TD>
            </TR>
            <TR class="tableRow">
              <TD <cfif ListFindNoCase(ErrorInputName, "Zip")>class="ErrorMessage"</cfif>><STRONG>Zip Code:</STRONG></TD>
              <TD colspan="3"><INPUT class="tableRow" type="Text" name="Zip" size="11" maxlength="10" <cfif IsDefined("FORM.Zip")>value="#FORM.Zip#"</cfif>>
                <FONT color="##CC0000">*</FONT></TD>
            </TR>
            <TR class="tableRow">
              <TD><STRONG>Country:</STRONG></TD>
              <TD colspan="3"><SELECT name="Country" class="tableRow">
                  <CFLOOP query="Countries">
                    <OPTION value="#Countries.CountryCode#" <cfif IsDefined("FORM.Country") AND FORM.Country IS Countries.CountryCode>selected</cfif>>#Countries.CountryName#</OPTION>
                  </CFLOOP>
                </SELECT>
                <FONT color="##CC0000">*</FONT> </TD>
            </TR>
            <TR class="tableRow">
              <TD>&nbsp;</TD>
              <TD colspan="3">&nbsp;</TD>
            </TR>
            <TR class="NewHeader111">
              <TD colspan="6">Alternate Address</TD>
            </TR>
            <TR class="tableRow">
              <TD><STRONG>Address:</STRONG></TD>
              <TD colspan="3"><INPUT class="tableRow" type="Text" name="AltAddress" size="30" maxlength="40" <cfif IsDefined("FORM.AltAddress")>value="#FORM.AltAddress#"</cfif>></TD>
            </TR>
            <TR class="tableRow">
              <TD>&nbsp;</TD>
              <TD colspan="3"><INPUT class="tableRow" type="Text" name="AltAddress2" size="30" maxlength="40" <cfif IsDefined("FORM.AltAddress2")>value="#FORM.AltAddress2#"</cfif>></TD>
            </TR>
            <TR class="tableRow">
              <TD><STRONG>City:</STRONG></TD>
              <TD colspan="3"><INPUT class="tableRow" type="Text" name="AltCity" size="30" maxlength="40" <cfif IsDefined("FORM.AltCity")>value="#FORM.AltCity#"</cfif>></TD>
            </TR>
            <TR class="tableRow">
              <TD><STRONG>State:</STRONG></TD>
              <TD colspan="3"><SELECT name="AltState" class="tableRow">
                  <CFLOOP query="States">
                    <OPTION value="#States.State#" <cfif IsDefined("FORM.AltState") AND FORM.AltState IS States.State>selected</cfif>>#States.Statename#</OPTION>
                  </CFLOOP>
                </SELECT>              </TD>
            </TR>
            <TR class="tableRow">
              <TD><STRONG>Zip Code:</STRONG></TD>
              <TD colspan="3"><INPUT class="tableRow" type="Text" name="AltZip" size="11" maxlength="10" <cfif IsDefined("FORM.AltZip")>value="#FORM.AltZip#"</cfif>></TD>
            </TR>
            <TR class="tableRow">
              <TD><STRONG>Country:</STRONG></TD>
              <TD colspan="3"><SELECT name="AltCountry" class="tableRow">
                  <CFLOOP query="Countries">
                    <OPTION value="#Countries.CountryCode#" <cfif IsDefined("FORM.AltCountry") AND FORM.AltCountry IS Countries.CountryCode>selected</cfif>>#Countries.CountryName#</OPTION>
                  </CFLOOP>
                </SELECT>              </TD>
            </TR>
            <TR>
              <TD>&nbsp;</TD>
            </TR>
            
            
            <!-- ========== Billing Address ========== -->
            <TR class="NewHeader111">
              <TD colspan="6">Billing Address Information<span class="NewHeaderNonBold style3"> (If different from mailing address)</span></TD>
            </TR>
            <TR class="tableRow">
              <TD <cfif ListFindNoCase(ErrorInputName, "Address")>class="ErrorMessage"</cfif>><STRONG>Billing Address:</STRONG></TD>
              <TD colspan="3"><INPUT class="tableRow" type="Text" name="Address" size="30" maxlength="40" <cfif IsDefined("FORM.Address")>value="#FORM.Address#"</cfif>>
                <FONT color="##CC0000">*</FONT></TD>
            </TR>
            <TR class="tableRow">
              <TD>&nbsp;</TD>
              <TD colspan="3"><INPUT class="tableRow" type="Text" name="Address2" size="30" maxlength="40" <cfif IsDefined("FORM.Address2")>value="#FORM.Address2#"</cfif>></TD>
            </TR>
            <TR class="tableRow">
              <TD <cfif ListFindNoCase(ErrorInputName, "City")>class="ErrorMessage"</cfif>><STRONG>Billing City:</STRONG></TD>
              <TD colspan="3"><INPUT class="tableRow" type="Text" name="City" size="30" maxlength="40" <cfif IsDefined("FORM.City")>value="#FORM.City#"</cfif>>
                <FONT color="##CC0000">*</FONT></TD>
            </TR>
            <TR class="tableRow">
              <TD><STRONG>Billing State:</STRONG></TD>
              <TD colspan="3"><SELECT name="State" class="tableRow">
                  <CFLOOP query="States">
                    <OPTION value="#States.State#" <cfif IsDefined("FORM.State") AND FORM.State IS States.State>selected</cfif>>#States.Statename#</OPTION>
                  </CFLOOP>
                </SELECT>
                <FONT color="##CC0000">*</FONT> </TD>
            </TR>
            <TR class="tableRow">
              <TD <cfif ListFindNoCase(ErrorInputName, "Zip")>class="ErrorMessage"</cfif>><STRONG>Billing Zip Code:</STRONG></TD>
              <TD colspan="3"><INPUT class="tableRow" type="Text" name="Zip" size="11" maxlength="10" <cfif IsDefined("FORM.Zip")>value="#FORM.Zip#"</cfif>>
                <FONT color="##CC0000">*</FONT></TD>
            </TR>
            <TR class="tableRow">
              <TD><STRONG>Billing Country:</STRONG></TD>
              <TD colspan="3"><SELECT name="Country" class="tableRow">
                  <CFLOOP query="Countries">
                    <OPTION value="#Countries.CountryCode#" <cfif IsDefined("FORM.Country") AND FORM.Country IS Countries.CountryCode>selected</cfif>>#Countries.CountryName#</OPTION>
                  </CFLOOP>
                </SELECT>
                <FONT color="##CC0000">*</FONT> </TD>
            </TR>
            <TR class="tableRow">
              <TD>&nbsp;</TD>
              <TD colspan="3">&nbsp;</TD>
            </TR>
            
            <!-- =========== Alternate Billing address ============ -->
            <TR class="NewHeader111">
              <TD colspan="6">Alternate Billing Address<span class="NewHeaderNonBold style3"> (If different from above)</span></TD>
            </TR>
            <TR class="tableRow">
              <TD><STRONG>Billing Address:</STRONG></TD>
              <TD colspan="3"><INPUT class="tableRow" type="Text" name="AltAddress" size="30" maxlength="40" <cfif IsDefined("FORM.AltAddress")>value="#FORM.AltAddress#"</cfif>></TD>
            </TR>
            <TR class="tableRow">
              <TD>&nbsp;</TD>
              <TD colspan="3"><INPUT class="tableRow" type="Text" name="AltAddress2" size="30" maxlength="40" <cfif IsDefined("FORM.AltAddress2")>value="#FORM.AltAddress2#"</cfif>></TD>
            </TR>
            <TR class="tableRow">
              <TD><STRONG>Billing City:</STRONG></TD>
              <TD colspan="3"><INPUT class="tableRow" type="Text" name="AltCity" size="30" maxlength="40" <cfif IsDefined("FORM.AltCity")>value="#FORM.AltCity#"</cfif>></TD>
            </TR>
            <TR class="tableRow">
              <TD><STRONG>Billing State:</STRONG></TD>
              <TD colspan="3"><SELECT name="AltState" class="tableRow">
                  <CFLOOP query="States">
                    <OPTION value="#States.State#" <cfif IsDefined("FORM.AltState") AND FORM.AltState IS States.State>selected</cfif>>#States.Statename#</OPTION>
                  </CFLOOP>
                </SELECT>              </TD>
            </TR>
            <TR class="tableRow">
              <TD><STRONG>Billing Zip Code:</STRONG></TD>
              <TD colspan="3"><INPUT class="tableRow" type="Text" name="AltZip" size="11" maxlength="10" <cfif IsDefined("FORM.AltZip")>value="#FORM.AltZip#"</cfif>></TD>
            </TR>
            <TR class="tableRow">
              <TD><STRONG>Billing Country:</STRONG></TD>
              <TD colspan="3"><SELECT name="AltCountry" class="tableRow">
                  <CFLOOP query="Countries">
                    <OPTION value="#Countries.CountryCode#" <cfif IsDefined("FORM.AltCountry") AND FORM.AltCountry IS Countries.CountryCode>selected</cfif>>#Countries.CountryName#</OPTION>
                  </CFLOOP>
                </SELECT>              </TD>
            </TR>
            <TR>
              <TD>&nbsp;</TD>
            </TR>
            <!---<TR class="tableRow">
              <TD>Birthdate</TD>
              <TD><INPUT class="tableRow" type="Text" name="BirthDate" <cfif IsDefined("FORM.Birthdate") AND 
          IsDate(FORM.BirthDate)>value="#DateFormat(FORM.Birthdate, "mm/dd/yy")#"</cfif>>              </TD>--->
          <!---</TABLE>
          <TABLE>--->
            <TR class="NewHeader111">
              <TD colspan="6">Membership Terms / Payment Information </TD>
            </TR>
            <TR class="tableRow">
              <TD><STRONG>Term & Dues:</STRONG></TD>
              <TD colspan="3"><CFMODULE template="custom tags/TwoSelectsRelated.cfm"
						query="DuesMatrix"
						name1="Term"
						name2="Dues"
						display1="Term"
						display2="DollarFormat(Dues)"
						value1="Term"
						value2="Dues"
						autoselectfirst="Yes"
						emptytext1="(Term Length)"
						emptytext2="(Dues)"
						message1="You must choose an option for the Term Length."
						message2="You must choose an option for the Dues."
						formname="form"></TD>
            </TR>
            <TR class="tableRow">
              <TD>&nbsp;</TD>
              <TD colspan="3" <cfif ListFindNoCase(ErrorInputName, "Expiration")>class="ErrorMessage"</cfif>>&nbsp;</TD>
            </TR>
            <TR class="tableRow">
              <TD><STRONG>Join/Start Date:</STRONG> </TD>
              <TD colspan="4"><LABEL>
                <INPUT name="StartDate" type="text" id="StartDate" size="20">
                <EM>              (Use this field if you don't want today to be used as the start date.)</EM> </LABEL></TD>
            </TR>
            <TR class="tableRow">
              <TD><STRONG>Expire Date: </STRONG></TD>
              <TD colspan="3"><INPUT name="ExpireDate" type="text" id="ExpireDate" size="20">
              <EM> (Use this field if you want to set a custom expire date.)</EM> </TD>
            </TR>
            <TR class="tableRow">
              <TD>&nbsp;</TD>
              <TD colspan="3">&nbsp;</TD>
            </TR>
            <tr bgcolor="##E3FBE8" class="tableRow">
              <td colspan="6" valign="baseline"><input type="Radio" name="DefaultPaymentMethod" value="9" onClick="showMe('hiddenCompMembership', this)" <cfif IsDefined("FORM.DefaultPaymentMethod") AND FORM.DefaultPaymentMethod IS 9>checked
              <cfelseif NOT IsDefined("FORM.DefaultPaymentMethod")>checked</cfif>>
                  <strong>Complimentary Membership </strong><span class="style1">Click if Complimentary Membership</span>			  </td>
            </tr>
            
			<tr class="tableRow">
              <td  colspan="4" >
			  
			  <div id="hiddenCompMembership" style="display:none;">
                  
				  <table bgcolor="##FFFFCC" width="467">
                    <tr>
                      <td width="135" valign="top" <cfif ListFindNoCase(ErrorInputName, "CompYear")>class="ErrorMessage"</cfif>><strong>Year:</strong></td>
                      <td width="272" ><label>
                        <input name="CompYear" type="text" id="CompYear" size="20">
                        &nbsp;(dd/mm/yyyy) </label></td>
                    </tr>
                    <tr>
                      <td>&nbsp;</td>
                    </tr>
                    <tr>
                      <td valign="top"><strong>Event: </strong></td>
                      <td valign="baseline" bgcolor="##FFFFCC"><p>
                          <select name="CompEvent" size="5" multiple="multiple">
                            <cfloop query="getCompEvent">
                              <option value="#getCompEvent.CompEvent#">#getCompEvent.CompEvent#</option>
                            </cfloop>
                          </select>
                        <br>
                          <span style=" font-family:Arial, Helvetica, sans-serif; font-size:9px">(Hold down CTRL key to choose multiple options or to de-select option)</span> </td>
                    </tr>
                    <tr>
                      <td>&nbsp;</td>
                    </tr>
                    <tr>
                      <td valign="top"><strong>Designation: </strong></td>
                      <td valign="baseline"><p>
                          <select name="CompDesignation" size="5" multiple="multiple">
                            <cfloop query="getCompDesignation">
                              <option value="#getCompDesignation.CompDesignation#">#getCompDesignation.CompDesignation#</option>
                            </cfloop>
                          </select>
                        <br>
                          <span style=" font-family:Arial, Helvetica, sans-serif; font-size:9px">(Hold down CTRL key to choose multiple options or to de-select option)</span> </td>
                    </tr>
                    <tr>
                      <td>&nbsp;</td>
                    </tr>
                    <tr>
                      <td valign="top"><strong>Category Earned: </strong></td>
                      <td valign="baseline"><p>
                          <select name="CompCategoryEarned" size="3" multiple="multiple">
                            <cfloop query="getCompMembCatEarned">
                              <option value="#getCompMembCatEarned.compCategoryEarned#">#getCompMembCatEarned.compCategoryEarned#</option>
                            </cfloop>
                          </select>
                        <br>
                        <span style=" font-family:Arial, Helvetica, sans-serif; font-size:9px">(Hold down CTRL key to choose multiple options or to de-select option)</span> </td>
                    </tr>
				</table>
					</div>				  </td>
			</tr>
 
            <tr>
              <td colspan="6">&nbsp;</td>
            </tr>
            <TR class="tableRow">
              <TD colspan="4"><INPUT type="Radio" name="DefaultPaymentMethod" value="0" onClick="HideLayer('hiddenCompMembership')" <cfif IsDefined("FORM.DefaultPaymentMethod") AND FORM.DefaultPaymentMethod IS 0>checked
              <cfelseif NOT IsDefined("FORM.DefaultPaymentMethod")>checked</cfif>>
                <STRONG>Send Member a Bill </STRONG><FONT color="##CC0000"><EM>(Membership will not become active until payment is received.) </EM></FONT></TD>
            </TR>
            <TR class="tableRow">
              <TD colspan="4" <cfif ListFindNoCase(ErrorInputName, "ECP")>class="errorMessage"</cfif>><INPUT type="Radio" name="DefaultPaymentMethod" value="2" onClick="HideLayer('hiddenCompMembership')" <cfif IsDefined("FORM.DefaultPaymentMethod") AND FORM.DefaultPaymentMethod IS 2>checked</cfif>>
                <STRONG>Electronic Check Processing (ECP) </STRONG></TD>
            </TR>
            <TR class="tableRow">
              <TD>&nbsp;</TD>
              <TD colspan="3">Account Number              
                <input class="tableRow" type="text" name="AccountNumber" 
              <cfif IsDefined("FORM.AccountNumber")>value="#FORM.AccountNumber#"</cfif>></TD>
            </TR>
            <TR class="tableRow">
              <TD width="98" <cfif ListFindNoCase(ErrorInputName, "CreditCard")>class="ErrorMessage"</cfif>>&nbsp;</TD>
              <TD colspan="3">Routing Number
              <INPUT class="tableRow" type="Text" name="RoutingNumber" 
              <cfif IsDefined("FORM.RoutingNumber")>value="#FORM.RoutingNumber#"</cfif>></TD>
            </TR>
            <TR class="tableRow">
              <TD <cfif ListFindNoCase(ErrorInputName, "CreditCard")>class="ErrorMessage"</cfif>><INPUT type="Radio" name="DefaultPaymentMethod" value="1"  onClick="HideLayer('hiddenCompMembership')" <cfif IsDefined("FORM.DefaultPaymentMethod") AND FORM.DefaultPaymentMethod IS 1>checked
              <cfelseif NOT IsDefined("FORM.DefaultPaymentMethod")>checked</cfif>>
                <STRONG>Credit Card</STRONG></TD>
              <TD colspan="3">&nbsp;</TD>
            </TR>
            <TR class="tableRow">
              <TD>&nbsp;</TD>
              <TD colspan="3">Credit Card Type
                <SELECT name="cctype">
                  <OPTION value="Amex">AMEX</OPTION>
                  <OPTION value="Diners Club">Diners Club</OPTION>
                  <OPTION value="Discover">Discover</OPTION>
                  <OPTION value="MasterCard">MasterCard</OPTION>
                  <OPTION value="Visa">Visa</OPTION>
                </SELECT></TD>
            </TR>
            <TR class="tableRow">
              <TD>&nbsp;</TD>
              <TD colspan="3">Credit Card Number
                <INPUT class="tableRow" type="Text" name="CreditCardNumber" AUTOCOMPLETE="off"
               <cfif Isdefined("FORM.CreditCardNumber")>value="#FORM.CreditCardNumber#"</cfif>>              </TD>
            </TR>
            <TR class="tableRow">
              <TD>&nbsp;</TD>
              <TD colspan="3" <cfif ListFindNoCase(ErrorInputName, "Expiration")>class="ErrorMessage"</cfif>>Expiration Date:
                <SELECT name="ExpMonth" class="tableRow">
                  <CFLOOP from="1" to="12" index="MonthNum">
                    <OPTION value="<cfif MonthNum LTE 9>0</cfif>#MonthNum#"
	            <cfif IsDefined("FORM.ExpMonth") AND FORM.ExpMonth IS MonthNum>selected</cfif>>#MonthAsString(monthNum)# (#monthNum#)</OPTION>
                  </CFLOOP>
                </SELECT>
                <SELECT name="ExpYear" class="tableRow">
                  <CFLOOP from="0" to="19" index="AddToCurrentYear">
                    <OPTION value="#DateFormat(DateAdd("yyyy", AddToCurrentYear, now()), "YY")#">#DateFormat(DateAdd("yyyy", AddToCurrentYear, now()), "YYYY")#</OPTION>
                  </CFLOOP>
                </SELECT>              </TD>
            </TR>
			<tr class="tableRow">
			  <td>&nbsp;</td>
			  <td colspan="5" <cfif ListFindNoCase(ErrorInputName, "Expiration")>class="ErrorMessage"</cfif>>&nbsp;</td>
			  </tr>
			<tr class="tableRow">
                      <td>&nbsp;</td>
                      <td colspan="5" <cfif ListFindNoCase(ErrorInputName, "Expiration")>class="ErrorMessage"</cfif>><strong>Alternate Credit Card?&nbsp;&nbsp;&nbsp;
                        <label>
                        <input type="checkbox" name="checkbox" value="checkbox" onClick="showMe('altCC', this)">
                        </label>
                      </strong></td>
            </tr>
			
			<tr class="tableRow">
              <td>&nbsp;</td>
              <td colspan="5" >
			  
			  <Div id="altCC" style="display:none">
					<table bgcolor="##FFFFCC">
						<tr><td>&nbsp;</td></tr>
                    	<tr class="tableRow">
						  <td colspan="6">Credit Card Type
							<select name="AltCCType">
								<option value="Amex">AMEX</option>
								<option value="Diners Club">Diners Club</option>
								<option value="Discover">Discover</option>
								<option value="MasterCard">MasterCard</option>
								<option value="Visa">Visa</option>
							</select></td>
                    	</tr>
                    	<tr class="tableRow">
                      		<td colspan="6">Credit Card Number
                        	<input class="tableRow" type="Text" name="AltCreditCardNumber" autocomplete="off"
               <cfif Isdefined("FORM.AltCreditCardNumber")>value="#FORM.AltCreditCardNumber#"</cfif>>                      </td>
                    	</tr>
                    	<tr class="tableRow">
                      		<td colspan="6" <cfif ListFindNoCase(ErrorInputName, "Expiration")>class="ErrorMessage"</cfif>>Expiration Date:
                        	<select name="AltExpMonth" class="tableRow"><cfloop from="1" to="12" index="MonthNum">
                              <option value="<cfif MonthNum LTE 9>0</cfif>#MonthNum#"
	            <cfif IsDefined("FORM.ExpMonth") AND FORM.ExpMonth IS MonthNum>selected</cfif>>#MonthAsString(monthNum)# (#monthNum#)</option>
                            </cfloop>
                        	</select>
                          	<select name="AltExpYear" class="tableRow"><cfloop from="0" to="19" index="AddToCurrentYear">
                              <option value="#DateFormat(DateAdd("yyyy", AddToCurrentYear, now()), "YY")#">#DateFormat(DateAdd("yyyy", AddToCurrentYear, now()), "YYYY")#</option>
                            </cfloop>
                          	</select>							</td>
                    	</tr>
						<tr>
							<td>&nbsp;</td>
						</tr>
					</table>
					</Div>				</td>
            </tr>
			<tr class="tableRow">
			  <td>&nbsp;</td>
			  <td colspan="5" >&nbsp;</td>
			 </tr>
            <TR class="NewHeader111">
              <TD colspan="6">Source Information</TD>
            </TR>
            <TR class="tableRow">
              <TD <cfif ListFindNoCase(ErrorInputName, "SourceCode")>class="ErrorMessage"</cfif>><STRONG> SourceCode:</STRONG></TD>
              <TD colspan="3" <cfif ListFindNoCase(ErrorInputName, "SourceCode")>class="ErrorMessage"</cfif>><SELECT name="Sourcecode">
			  	<CFLOOP query="getSourceCodes">
				<OPTION value="#getSourceCodes.SourceCode#" <cfif IsDefined("FORM.SourceCode") AND FORM.SourceCode IS getSourceCodes.SourceCode>selected</cfif>>#getSourceCodes.SourceCode#</OPTION>
				</CFLOOP>
				</SELECT>
                <A href="../../admin/sourcecode_man.cfm">Manage SourceCodes</A> </TD>
            </TR>
            <TR class="tableRow">
              <TD><STRONG>Channel:</STRONG></TD>
              <TD colspan="3"><SELECT name="JoinMethod" class="tableRow">
                <CFLOOP query="GetChannel">
                  <OPTION value="#GetChannel.Channel#" <cfif IsDefined("FORM.JoinMethod") AND FORM.JoinMethod IS GetChannel.Channel>selected</cfif>>#GetChannel.Channel#</OPTION>
                </CFLOOP>
              </SELECT>
                <FONT color="##CC0000">*</FONT></TD>
            </TR>
            <TR class="tableRow">
              <TD><STRONG>Referred By:</STRONG></TD>
              <TD colspan="3"><INPUT type="text" name="referredby" maxlength="9" size="10" <cfif IsDefined("FORM.Referredby")>value="#FORM.ReferredBy#"</cfif>>
(Enter referring Member Number here.)</TD>
            </TR>
            <TR class="tableRow">
              <TD valign="top"><strong>Comments:</strong></TD>
              <TD colspan="3" rowspan="2" valign="top"><label>
                <textarea name="Comments" id="Comments" cols="45" rows="5"></textarea>
              </label></TD>
            </TR>
            <TR class="tableRow">
              <TD>&nbsp;</TD>
            </TR>
            <TR class="tableRow">
              <TD><strong>Member Kit Sent:</strong></TD>
              <TD colspan="5"><label><Input id="kitSent" type="text" size="15" name="kitSent">
              &nbsp;&nbsp;<a href="javascript:NewCal('kitSent','mmddyyyy')"><img src="Includes/cal.gif" width="16" height="16" border="0" alt="Pick a date"></a> 
              </label></TD>
            </TR>
            <TR class="tableRow">
              <TD colspan="4">&nbsp;</TD>
            </TR>
            <TR class="tableRow">
              <TD colspan="4"><INPUT class="tableRow" type="Submit" value="Continue>>" name="btnSumbit">              </TD>
            </TR>
          </TABLE>
          <INPUT type="Hidden" name="Program" value="2">
          <INPUT type="Hidden" name="EmployeeID" value="#Session.user_id#">
        </FORM>
      </cfoutput> </TD>
  </TR>
</TABLE>
      <!--- End: Content Here ---></TD>
  </TR>
</TABLE>
 
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
  <TR>
    <TD align="center" class="copyright">&nbsp;</TD>
  </TR>
  <TR>
    <TD height="40" align="center" background="../../images/bg_footer.gif" class="copyright">&nbsp;</TD>
  </TR>
  <TR>
    <TD height="25" align="center" class="copyright"><DIV align="right">Copyright &copy; 2008 James Beard Foundation. All rights reserved.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </DIV></TD>
  </TR>
</TABLE>
 
</BODY>
</HTML>
 
 
[ EnrollMember_DBADD.cfm ]
<cfparam name="ErrorMessage" default="" type="string">
<cfparam name="ErrorInputName" default="" type="string">
<cfparam name="IsReferral" default="0" type="boolean">
<LINK href="../../css/default.css" rel="stylesheet" type="text/css">
<cfquery datasource="#Request.DSN#" name="GetChannel">
SELECT     channelID
FROM         channel
WHERE     (Channel = N'#FORM.JoinMethod#')
</cfquery>
 
<!--------------------- START ERROR CHECKS ----------------------------->
<cfif Len(Trim(FORM.FirstName)) IS 0>
  <cfset ErrorMessage = ListAppend(ErrorMessage, "First Name Is Required")>
  <cfset ErrorInputName = ListAppend(ErrorInputName, "FirstName")>
</cfif>
 
<cfif Len(Trim(FORM.LastName)) IS 0>
  <cfset ErrorMessage = ListAppend(ErrorMessage, "Last Name Is Required")>
  <cfset ErrorInputName = ListAppend(ErrorInputName, "LastName")>
</cfif>
 
<cfif Trim(LEN(FORM.Address)) IS 0>
  <cfset ErrorMessage = ListAppend(ErrorMessage, "Address Is Required")>
  <cfset ErrorInputName = ListAppend(ErrorInputName, "Address")>  
</cfif>
 
<cfif Len(Trim(FORM.City)) IS 0>
  <cfset ErrorMessage = ListAppend(ErrorMessage, "City Is Required")>
  <cfset ErrorInputName = ListAppend(ErrorInputName, "City")>
</cfif>
 
<cfif Len(Trim(FORM.Zip)) IS 0>
  <cfset ErrorMessage = ListAppend(ErrorMessage, "Zip Code Is Required")>
  <cfset ErrorInputName = ListAppend(ErrorInputName, "Zip")>
</cfif>
 
<!--- Get the list of Complimnetary Designations --->
<CFQUERY datasource="#Request.DSN#" name="getCompDesignation">
SELECT *
FROM CompMembershipDesignation
ORDER BY CompDesignation
</CFQUERY>
 
<!--- Get the list of Complimnetary Events --->
<CFQUERY datasource="#Request.DSN#" name="getCompEvent">
SELECT *
FROM CompMembershipEvent
ORDER BY CompEvent
</CFQUERY>
 
<cfquery name="getCompMembCatEarned" datasource="#Request.DSN#">
SELECT *
FROM dbo.CompMembershipCategoryEarned
</cfquery>
 
<!--- Get the list of Member Types (Positions & Titles) --->
<cfquery name="getMemberType" datasource="#Request.DSN#">
SELECT *
FROM dbo.MemberTypes
</cfquery>
 
 
<!--- Get the list of Complimnetary Designations --->
<CFQUERY datasource="#Request.DSN#" name="getCompDesignation">
SELECT *
FROM CompMembershipDesignation
ORDER BY CompDesignation
</CFQUERY>
 
<!--- Get the list of Complimnetary Events --->
<CFQUERY datasource="#Request.DSN#" name="getCompEvent">
SELECT *
FROM CompMembershipEvent
ORDER BY CompEvent
</CFQUERY>
 
<cfquery name="getCompMembCatEarned" datasource="#Request.DSN#">
SELECT *
FROM dbo.CompMembershipCategoryEarned
</cfquery>
 
<!--- Get the list of Member Types (Positions & Titles) --->
<cfquery name="getMemberType" datasource="#Request.DSN#">
SELECT *
FROM dbo.MemberTypes
</cfquery>
 
 
<!--- Get the list of Comp Reasons for Associats. --->
<CFQUERY datasource="#Request.DSN#" name="getComps">
SELECT *
FROM ValidCompsAssoc
ORDER BY CompReason
</CFQUERY>
 
 
<!--- If member birthdate was left blank --->
<!--- 
<cfif Len(FORM.Birthdate) IS 0>
  <cfset ErrorMessage = ListAppend(ErrorMessage, "Member Date of Birth required")>
  <cfset ErrorInputName = ListAppend(ErrorInputName, "Birthdate")>  
</cfif> 
--->
 
<!--- Make sure member date of birth is filled in correctly
<cfif Len(FORM.Birthdate) GT 0 AND NOT IsDate(FORM.Birthdate) AND FORM.Birthdate NEQ "">
  <cfset ErrorMessage = ListAppend(ErrorMessage, "Member Date of Birth must be a valid date")>
  <cfset ErrorInputName = ListAppend(ErrorInputName, "Birthdate")>  
</cfif> --->
 
<!--- Check to make sure CreditCard number is numerical --->
<cfif FORM.DefaultPaymentMethod IS 1 AND NOT IsNumeric(FORM.CreditCardNumber)>
  <cfset ErrorMessage = ListAppend(ErrorMessage, "Credit Card number must be numeric")>
  <cfset ErrorInputName = ListAppend(ErrorInputName, "CreditCard")>  
</cfif>
 
<!--- Check to make sure Expiration date and numerical --->
<cfif FORM.DefaultPaymentMethod IS 1 AND (NOT IsNumeric(FORM.Expyear) OR NOT IsNumeric(FORM.ExpMonth))>
  <cfset ErrorMessage = ListAppend(ErrorMessage, "Expiration Date must be numerical")>
  <cfset ErrorInputName = ListAppend(ErrorInputName, "Expiration")>
</cfif>
 
<!--- If this fails an invalid date was typed in --->
<cfif FORM.DefaultPaymentMethod IS 1>
  <cftry>
    <cfset ExpDate = CreateDate(FORM.ExpYear, FORM.ExpMonth, "28")>
    <cfcatch type="Any">
      <cfset ErrorMessage = ListAppend(ErrorMessage, "Invalid Expiration Date")>
      <cfset ExpDate = "">
    </cfcatch>
  </cftry>
</cfif>
 
<!--- Check if Credit Card has expired --->
<cfif FORM.DefaultPaymentMethod IS 1 AND IsDate(ExpDate) AND DateCompare(ExpDate, now()) IS -1>
  <cfset ErrorMessage = ListAppend(ErrorMessage, "Credit Card has expired")>
    <cfset ErrorInputName = ListAppend(ErrorInputName, "Expiration")>
</cfif>
 
<!--- Check to make sure routing number is numerical --->
<cfif FORM.DefaultPaymentMethod IS 2 AND NOT IsNumeric(FORM.RoutingNumber)>
  <cfset ErrorMessage = ListAppend(ErrorMessage, "Routing number must be numerical")>  
  <cfset ErrorInputName = ListAppend(ErrorInputName, "ECP")>  
</cfif>
 
<!--- Check the length of the routing number --->
<cfif FORM.DefaultPaymentMethod IS 2 AND Len(FORM.routingNumber) LT 9>
  <cfset ErrorMessage = ListAppend(ErrorMessage, "Routing number be equate to 9 digits or more")>
  <cfset ErrorInputName = ListAppend(ErrorInputName, "ECP")>  
</cfif>
 
<!--- Check and make sure we have a valid Home phone number --->
<cfset PhoneNumber = "#FORM.AreaCode##FORM.Phone1##FORM.Phone2#">
<cfif LEN(PhoneNumber) NEQ 0 AND NOT IsNumeric(PhoneNumber)>
  <cfset ErrorMessage = ListAppend(ErrorMessage, "Phone Number is not numeric")>
    <cfset ErrorInputName = ListAppend(ErrorInputName, "PhoneNumber")>  
</cfif>
 
<!--- Check and make sure we have a valid length Home phone number --->
<cfif LEN(PhoneNumber) NEQ 0 AND LEN(PhoneNumber) NEQ 10>
  <cfset ErrorMessage = ListAppend(ErrorMessage, "PhoneNumber must equate to 10 digits")>
  <cfset ErrorInputName = ListAppend(ErrorInputName, "PhoneNumber")>
</cfif>
 
<!--- Check and make sure we have a valid work phone number --->
<cfset WorkNumber = "#FORM.WorkAreaCode##FORM.Work1##FORM.Work2#">
<cfif LEN(WorkNumber) NEQ 0 AND NOT IsNumeric(WorkNumber)>
  <cfset ErrorMessage = ListAppend(ErrorMessage, "Work Phone Number is not numeric")>
    <cfset ErrorInputName = ListAppend(ErrorInputName, "WorkNumber")>  
</cfif>
 
<!--- Check and make sure we have a valid length work phone number --->
<cfif LEN(WorkNumber) NEQ 0 AND LEN(WorkNumber) NEQ 10>
  <cfset ErrorMessage = ListAppend(ErrorMessage, "Work Phone Number must equate to 10 digits")>
  <cfset ErrorInputName = ListAppend(ErrorInputName, "WorkNumber")>
</cfif>
 
<!--- Check and make sure we have a valid Cell phone number --->
<cfset CellNumber = "#FORM.CellAreaCode##FORM.Cell1##FORM.Cell2#">
<cfif LEN(CellNumber) NEQ 0 AND NOT IsNumeric(CellNumber)>
  <cfset ErrorMessage = ListAppend(ErrorMessage, "Cell Number is not numeric")>
    <cfset ErrorInputName = ListAppend(ErrorInputName, "CellNumber")>  
</cfif>
 
<!--- Check and make sure we have a valid length Cell phone number --->
<cfif LEN(CellNumber) NEQ 0 AND LEN(CellNumber) NEQ 10>
  <cfset ErrorMessage = ListAppend(ErrorMessage, "Cell Number must equate to 10 digits")>
  <cfset ErrorInputName = ListAppend(ErrorInputName, "CellNumber")>
</cfif>
 
<!--- Check and make sure we have a valid FAX number --->
<cfset FAXNumber = "#FORM.FAXAreaCode##FORM.FAX1##FORM.FAX2#">
<cfif LEN(FAXNumber) NEQ 0 AND NOT IsNumeric(FAXNumber)>
  <cfset ErrorMessage = ListAppend(ErrorMessage, "FAX Number is not numeric")>
    <cfset ErrorInputName = ListAppend(ErrorInputName, "FAXNumber")>  
</cfif>
 
<!--- Check and make sure we have a valid length FAX number --->
<cfif LEN(FAXNumber) NEQ 0 AND LEN(FAXNumber) NEQ 10>
  <cfset ErrorMessage = ListAppend(ErrorMessage, "FAX Number must equate to 10 digits")>
  <cfset ErrorInputName = ListAppend(ErrorInputName, "FAXNumber")>
</cfif>
 
<!--- Make sure referred by is numerical
<cfif LEN(FORM.ReferredBy) GT 0 AND NOT IsNumeric(FORM.referredby)>
  <cfset ErrorMessage = ListAppend(ErrorMessage, "Referred membernumber must be numerical")>
  <cfset ErrorInputName = ListAppend(ErrorInputName, "referredby")>
</cfif> --->
 
<!--- Validate this address
<cfsilent>
  <cfmodule template="../admin/customtags/av.cfm"
  company = ""
  street = "#FORM.AddressShip#"
  street2 = ""
  Suite = "#FORM.suiteship#"
  City = "#FORM.cityship#"
  State = "#FORM.StateShip#"
  Zip = "#left(trim(FORM.ZipShip),5)#">
</cfsilent>
 
<cfif Error IS "">
  <cfset newsorg = "#resp_company#">
  <cfset newsaddress = "#resp_street#">
  <!--- <cfset ShipAddress2 = "#resp_street2#"> --->
  <cfset newssuite = "#resp_suite#">
  <cfset newsstate = "#resp_state#">
  <cfset newscity = "#resp_city#">
  <cfset zipand4 = "#resp_zip#-#resp_zip4#"> 
  <cfset newszip = "#zipand4#">
  <cfset expdays = "#expdays#">
  <cfset AddressValidated = 1>
<cfelse>
  <cfset AVErrorMessage = Error>
  <cfset AddressValidated = 0>
  <cfset newsaddress = FORM.Addressship>
  <cfset newssuite = FORM.Suiteship>
  <cfset newscity = FORM.Cityship>
  <cfset newssate = FORM.StateShip>
  <cfset zipand4 = form.zipship>
</cfif>
 --->
 
<cfif Len(ErrorMessage) NEQ 0>
  <cfinclude template="EnrollMember-DBADD.cfm">
  <cfabort>
</cfif>
<!-------------------------------------- END ERROR CHECKS ----------------------------------------->
 
<!--- Lookup the Dues --->
<CFIF DefaultPaymentMethod EQ 9>
<CFSET Variables.Dues = 0>
<CFELSE>
<CFQUERY datasource="#Request.DSN#" name="getDues">
SELECT Dues
FROM MembershipDuesMatrix
WHERE MembershipLevel = #Form.Program#
and Term = '#Form.Term#'
</CFQUERY>
<CFSET Variables.Dues = getDues.Dues>
</CFIF>
 
 
 
<!--- No errors found start database processing --->
<cftransaction>
  <cflock timeout="#CreateTimeSpan(0, 0, 0, 30)#" throwontimeout="Yes">
    <!--- Generate the next member number to use. --->
     <cfstoredproc procedure="sp_GenerateNextMemberNumber" datasource="#Request.DSN#">
      <cfprocparam cfsqltype="cf_sql_char" dbvarname="@Alpha" type="in" value="#Left(Form.LastName,2)#">
      <cfprocresult name="next" resultset="1">
     </cfstoredproc>
    
    <cfset membernumber = next.membernumber>
    
    <!---<cfset cctype = GetCCType(FORM.CreditCardNumber)>--->
    
    <!--- Create membership after we'be updated all the appropiate information in the finder file --->
    <cfquery datasource="#Request.DSN#">
      INSERT INTO Members
		(JoinDate, SourceCode, JoinMethod, MemberNumber, FirstName, LastName, MiddleInitial, Address, Address2, City, State, Zip, Country,
 
		<!--- Added if passed from form -------------------------->
		<CFIF Len(FORM.AltAddress) NEQ 0>AltAddress,</CFIF> 
		<CFIF Len(FORM.AltAddress2) NEQ 0>AltAddress2,</CFIF>
		<CFIF Len(FORM.AltCity) NEQ 0>AltCity,</CFIF>
		<CFIF Len(FORM.AltState) NEQ 0>AltState,</CFIF>
		<CFIF Len(FORM.AltZip) NEQ 0>AltZip,</CFIF>
		<CFIF Len(FORM.AltCountry) NEQ 0>AltCountry,</CFIF>
		<CFIF Len(FORM.Company) NEQ 0>Company,</CFIF>
		
		<!---<CFIF Len(FORM.MembershipCategory) NEQ 0>MembershipCategory,</CFIF>--->
		<!---<CFIF Len(FORM.MemberType) NEQ 0>MemberType,</CFIF>--->
		<!---<CFIF Len(FORM.IsResident) NEQ 0>IsResident,</CFIF>
		<CFIF Len(FORM.TermExpirationDate) NEQ 0>TermExpirationDate,</CFIF>
		<CFIF Len(FORM.Title) NEQ 0>Title,</CFIF>
		<CFIF Len(FORM.IsCorpMaster) NEQ 0>IsCorpMaster,</CFIF>
		<CFIF Len(FORM.IsCorpChild) NEQ 0>IsCorpChild,</CFIF>
		<CFIF Len(FORM.School) NEQ 0>School,</CFIF>
		<CFIF Len(FORM.Region) NEQ 0>Region,</CFIF>
		<CFIF Len(FORM.AltRegion) NEQ 0>AltRegion,</CFIF>
		
		<CFIF Len(FORM.Alt2Address) NEQ 0>Alt2Address,
		Alt2Address2,
		Alt2City,
		Alt2State,
		Alt2Zip,
		Alt2Region,
		Alt2Country,
		</CFIF>--->
		<!---<CFIF Len(FORM.Alt3Address) NEQ 0>Alt3Address,
		Alt3Address2,
		Alt3City,
		Alt3State,
		Alt3Zip,
		Alt3Region,
		Alt3Country,
		</CFIF>
		<CFIF Len(FORM.Alt4Address) NEQ 0>Alt4Address,
		Alt4Address2,
		Alt4City,
		Alt4State,
		Alt4Zip,
		Alt4Region,
		Alt4Country,</CFIF>
		<CFIF Len(FORM.Alt5Address) NEQ 0>Alt5Address,
		Alt5Address2,
		Alt5City,
		Alt5State,
		Alt5Zip,
		Alt5Region,
		Alt5Country,</CFIF>
		<CFIF Len(FORM.Alt6Address) NEQ 0>Alt6Address,
		Alt6Address2,
		Alt6City,
		Alt6State,
		Alt6Zip,
		Alt6Region,
		Alt6Country,</CFIF>
		<CFIF Len(FORM.Alt7Address) NEQ 0>Alt7Address,
		Alt7Address2,
		Alt7City,
		Alt7State,
		Alt7Zip,
		Alt7Region,
		Alt7Country,</CFIF>
		<CFIF Len(FORM.Alt8Address) NEQ 0>Alt8Address,
		Alt8Address2,
		Alt8City,
		Alt8State,
		Alt8Zip,
		Alt8Region,
		Alt8Country,</CFIF>
		<CFIF Len(FORM.Alt9Address) NEQ 0>Alt9Address,
		Alt9Address2,
		Alt9City,
		Alt9State,
		Alt9Zip,
		Alt9Region,
		Alt9Country,</CFIF>
		<CFIF Len(FORM.Alt10Address) NEQ 0>Alt10Address,
		Alt10Address2,
		Alt10City,
		Alt10State,
		Alt10Zip,
		Alt10Region,
		Alt10Country,</CFIF>
		<CFIF Len(FORM.Alt11Address) NEQ 0>Alt11Address,
		Alt11Address2,
		Alt11City,
		Alt11State,
		Alt11Zip,
		Alt11Region,
		Alt11Country,</CFIF>
		<CFIF Len(FORM.Alt12Address) NEQ 0>Alt12Address,
		Alt12Address2,
		Alt12City,
		Alt12State,
		Alt12Zip,
		Alt12Region,
		Alt12Country,</CFIF>
		<CFIF Len(FORM.Alt13Address) NEQ 0>Alt13Address,
		Alt13Address2,
		Alt13City,
		Alt13State,
		Alt13Zip,
		Alt13Region,
		Alt13Country,</CFIF>
		<CFIF Len(FORM.Alt14Address) NEQ 0>Alt14Address,
		Alt14Address2,
		Alt14City,
		Alt14State,
		Alt14Zip,
		Alt14Region,
		Alt14Country,</CFIF>
		<CFIF Len(FORM.Alt15Address) NEQ 0>Alt15Address,
		Alt15Address2,
		Alt15City,
		Alt15State,
		Alt15Zip,
		Alt15Region,
		Alt15Country,</CFIF>
		<CFIF Len(FORM.Alt16Address) NEQ 0>Alt16Address,
		Alt16Address2,
		Alt16City,
		Alt16State,
		Alt16Zip,
		Alt16Region,
		Alt16Country,</CFIF>
		<CFIF Len(FORM.Alt17Address) NEQ 0>Alt17Address,
		Alt17Address2,
		Alt17City,
		Alt17State,
		Alt17Zip,
		Alt17Region,
		Alt17Country,</CFIF>
		<CFIF Len(FORM.Alt18Address) NEQ 0>Alt18Address,
		Alt18Address2,
		Alt18City,
		Alt18State,
		Alt18Zip,
		Alt18Region,
		Alt18Country,</CFIF>
		<CFIF Len(FORM.Alt19Address) NEQ 0>Alt19Address,
		Alt19Address2,
		Alt19City,
		Alt19State,
		Alt19Zip,
		Alt19Region,
		Alt19Country,</CFIF>
		<CFIF Len(FORM.Alt20Address) NEQ 0>Alt20Address,
		Alt20Address2,
		Alt20City,
		Alt20State,
		Alt20Zip,
		Alt20Region,
		Alt20Country,</CFIF>--->
		
		<CFIF Len(FORM.BillingAddress) NEQ 0>BillingAddress,</CFIF>
		<CFIF Len(FORM.BillingAddress2) NEQ 0>BillingAddress2,</CFIF>
		<CFIF Len(FORM.BillingCity) NEQ 0>BillingCity,</CFIF>
		<CFIF Len(FORM.BillingState) NEQ 0>BillingState,</CFIF>
		<CFIF Len(FORM.BillingZip) NEQ 0>BillingZip,</CFIF>
		<CFIF Len(FORM.AltBillingAddress) NEQ 0>AltBillingAddress,</CFIF>
		<CFIF Len(FORM.AltBillingAddress2) NEQ 0>AltBillingAddress2,</CFIF>
		<CFIF Len(FORM.AltBillingCity) NEQ 0>AltBillingCity,</CFIF>
		<CFIF Len(FORM.AltBillingState) NEQ 0>AltBillingState,</CFIF>
		<CFIF Len(FORM.AltBillingZip) NEQ 0>AltBillingZip,</CFIF>
		<CFIF Len(FORM.IsResidence) NEQ 0>IsResidence,</CFIF>
		
		<CFIF Len(FORM.EmailFormat) NEQ 0>EmailFormat,</CFIF>
		<CFIF Len(FORM.GiftMessage) NEQ 0>GiftMessage,</CFIF>
		<CFIF Len(FORM.MemDoNotSolicit) NEQ 0>MemDoNotSolicit,</CFIF>
		<CFIF Len(FORM.MbrDOB) NEQ 0>MbrDOB,</CFIF>
 
		<CFIF Len(FORM.optout) NEQ 0>optout,</CFIF>
		<CFIF Len(FORM.badphone) NEQ 0>badphone,</CFIF>
		<CFIF Len(FORM.lastupdated) NEQ 0>lastupdated,</CFIF>
		
		<CFIF Len(FORM.AltCCType) NEQ 0>AltCCType,</CFIF>
		<CFIF Len(FORM.AltCreditCardNumber) NEQ 0>AltCreditCardNumber,</CFIF>
		<CFIF Len(FORM.AltCreditCardExpDate) NEQ 0>AltCreditCardExpDate,</CFIF>
		<CFIF Len(FORM.AltExpMonth) NEQ 0>AltExpMonth,</CFIF>
		<CFIF Len(FORM.AltExpYear) NEQ 0>AltExpYear,</CFIF>
		<CFIF Len(FORM.declinedate) NEQ 0>declinedate,</CFIF>
		<CFIF Len(FORM.CcdEffort) NEQ 0>CcdEffort,</CFIF>
		<CFIF Len(FORM.CcdDateNext) NEQ 0>CcdDateNext,</CFIF>
		<CFIF Len(FORM.newcc) NEQ 0>newcc,</CFIF>
		
		<CFIF Len(FORM.AddressValidated) NEQ 0>AddressValidated,</CFIF>
		<CFIF Len(FORM.AddressValidatedStamp) NEQ 0>AddressValidatedStamp,</CFIF>
		<CFIF Len(FORM.CompSource) NEQ 0>CompSource,</CFIF>
		<CFIF Len(FORM.CancelDate) NEQ 0>CancelDate,</CFIF>
		<CFIF Len(FORM.CancelReason) NEQ 0>CancelReason,</CFIF>
		<CFIF Len(FORM.DateUpdated) NEQ 0>DateUpdated,</CFIF>
 
		<CFIF Len(FORM.KitSent) NEQ 0>KitSent,</CFIF>
		<CFIF Len(FORM.stuGradDate) NEQ 0>stuGradDate,</CFIF>
		<CFIF Len(FORM.FBP_ProfDir) NEQ 0>FBP_ProfDir,</CFIF>
		<CFIF Len(FORM.FBP_RestDir) NEQ 0>FBP_RestDir,</CFIF>
		<CFIF Len(FORM.PD_RestName) NEQ 0>PD_RestName,</CFIF>
		<CFIF Len(FORM.PD_RestAddress) NEQ 0>PD_RestAddress,</CFIF>
		<CFIF Len(FORM.PD_RestAddress2) NEQ 0>PD_RestAddress2,</CFIF>
		<CFIF Len(FORM.PD_RestCity) NEQ 0>PD_RestCity,</CFIF>
		<CFIF Len(FORM.PD_RestState) NEQ 0>PD_RestState,</CFIF>
		<CFIF Len(FORM.PD_RestZip) NEQ 0>PD_RestZip,</CFIF>
		<CFIF Len(FORM.PD_RestCountry) NEQ 0>PD_RestCountry,</CFIF>
		<CFIF Len(FORM.PD_www) NEQ 0>PD_www,</CFIF>
		<CFIF Len(FORM.PD_EmailAddress2) NEQ 0>PD_EmailAddress2,</CFIF>
		<CFIF Len(FORM.PD_WorkGenNumber) NEQ 0>PD_WorkGenNumber,</CFIF>
		<CFIF Len(FORM.PD_WorkResNumber) NEQ 0>PD_WorkResNumber,</CFIF>
		<CFIF Len(FORM.PD_FaxNumberRest) NEQ 0>PD_FaxNumberRest,</CFIF>
		<CFIF Len(FORM.PD_ExecChef_fname) NEQ 0>PD_ExecChef_fname,</CFIF>
		<CFIF Len(FORM.PD_ExecChef_lname) NEQ 0>PD_ExecChef_lname,</CFIF>
		<CFIF Len(FORM.PD_ExecChefOwner) NEQ 0>PD_ExecChefOwner,</CFIF>
		<CFIF Len(FORM.PD_Chef_fname) NEQ 0>PD_Chef_fname,</CFIF>
		<CFIF Len(FORM.PD_Chef_lname) NEQ 0>PD_Chef_lname,</CFIF>
		<CFIF Len(FORM.PD_ChefOwner) NEQ 0>PD_ChefOwner,</CFIF>
		<CFIF Len(FORM.PD_PastryChef_fname) NEQ 0>PD_PastryChef_fname,</CFIF>
		<CFIF Len(FORM.PD_PastryChef_lname) NEQ 0>PD_PastryChef_lname,</CFIF>
		<CFIF Len(FORM.PD_PastryChefOwner) NEQ 0>PD_PastryChefOwner,</CFIF>
		<CFIF Len(FORM.PD_wdSommelier_fname) NEQ 0>PD_wdSommelier_fname,</CFIF>
		<CFIF Len(FORM.PD_wdSommelier_lname) NEQ 0>PD_wdSommelier_lname,</CFIF>
		<CFIF Len(FORM.PD_wdSommelierOwner) NEQ 0>PD_wdSommelierOwner,</CFIF>
		<CFIF Len(FORM.PD_maitredGM_fname) NEQ 0>PD_maitredGM_fname,</CFIF>
		<CFIF Len(FORM.PD_maitredGM_lname) NEQ 0>PD_maitredGM_lname,</CFIF>
		<CFIF Len(FORM.PD_maitredGMOwner) NEQ 0>PD_maitredGMOwner,</CFIF>
		<CFIF Len(FORM.PD_owner1_fname) NEQ 0>PD_owner1_fname,</CFIF>
		<CFIF Len(FORM.PD_owner1_lname) NEQ 0>PD_owner1_lname,</CFIF>
		<CFIF Len(FORM.PD_owner2_fname) NEQ 0>PD_owner2_fname,</CFIF>
		<CFIF Len(FORM.PD_owner2_lname) NEQ 0>PD_owner2_lname,</CFIF>
		<CFIF Len(FORM.PD_typeRest) NEQ 0>PD_typeRest,</CFIF>
		<CFIF Len(FORM.PD_cuisine) NEQ 0>PD_cuisine,</CFIF>
		<CFIF Len(FORM.PD_DIRprice) NEQ 0>PD_DIRprice,</CFIF>
		<CFIF Len(FORM.PD_swl_yn) NEQ 0>PD_swl_yn,</CFIF>
		<CFIF Len(FORM.PD_CCAccepted) NEQ 0>PD_CCAccepted,</CFIF>
		<CFIF Len(FORM.PD_ClosedOn) NEQ 0>PD_ClosedOn,</CFIF>
		<CFIF Len(FORM.PD_CINN) NEQ 0>PD_CINN,</CFIF>
		<CFIF Len(FORM.PD_Hotel) NEQ 0>PD_Hotel,</CFIF>
		<CFIF Len(FORM.PD_DressCode) NEQ 0>PD_DressCode,</CFIF>
		<CFIF Len(FORM.PD_PrivateRooms) NEQ 0>PD_PrivateRooms,</CFIF>
		<CFIF Len(FORM.PD_SignatureDishes) NEQ 0>PD_SignatureDishes,</CFIF>
		<CFIF Len(FORM.PD_AdditionalDetails) NEQ 0>PD_AdditionalDetails,</CFIF>
		<CFIF Len(FORM.PD_CompNameProfDir) NEQ 0>PD_CompNameProfDir,</CFIF>
		<CFIF Len(FORM.PD_CompanyName) NEQ 0>PD_CompanyName,</CFIF>
		<CFIF Len(FORM.PD_Company_fname) NEQ 0>PD_Company_fname,</CFIF>
		<CFIF Len(FORM.PD_Company_lname) NEQ 0>PD_Company_lname,</CFIF>
		<CFIF Len(FORM.PD_Company_title) NEQ 0>PD_Company_title,</CFIF>
		<CFIF Len(FORM.PD_Company_address) NEQ 0>PD_Company_address,</CFIF>
		<CFIF Len(FORM.PD_Company_address2) NEQ 0>PD_Company_address2,</CFIF>
		<CFIF Len(FORM.PD_Company_URL) NEQ 0>PD_Company_URL,</CFIF>
		<CFIF Len(FORM.PD_Company_phone) NEQ 0>PD_Company_phone,</CFIF>
		<CFIF Len(FORM.PD_Company_fax) NEQ 0>PD_Company_fax,</CFIF>
		<CFIF Len(FORM.PD_Company_email) NEQ 0>PD_Company_email,</CFIF>
		<CFIF Len(FORM.PD_Company_description) NEQ 0>PD_Company_description,</CFIF>
		<CFIF Len(FORM.PD_ApprovedtoAdd) NEQ 0>PD_ApprovedtoAdd,</CFIF>
		<CFIF Len(FORM.RD_RestName) NEQ 0>RD_RestName,</CFIF>
		<CFIF Len(FORM.RD_RestAddress) NEQ 0>RD_RestAddress,</CFIF>
		<CFIF Len(FORM.RD_RestAddress2) NEQ 0>RD_RestAddress2,</CFIF>
		<CFIF Len(FORM.RD_RestCity) NEQ 0>RD_RestCity,</CFIF>
		<CFIF Len(FORM.RD_RestState) NEQ 0>RD_RestState,</CFIF>
		<CFIF Len(FORM.RD_RestZip) NEQ 0>RD_RestZip,</CFIF>
		<CFIF Len(FORM.RD_RestCountry) NEQ 0>RD_RestCountry,</CFIF>
		<CFIF Len(FORM.RD_www) NEQ 0>RD_www,</CFIF>
		<CFIF Len(FORM.RD_EmailAddress2) NEQ 0>RD_EmailAddress2,</CFIF>
		<CFIF Len(FORM.RD_WorkGenNumber) NEQ 0>RD_WorkGenNumber,</CFIF>
		<CFIF Len(FORM.RD_WorkResNumber) NEQ 0>RD_WorkResNumber,</CFIF>
		<CFIF Len(FORM.RD_FaxNumberRest) NEQ 0>RD_FaxNumberRest,</CFIF>
		<CFIF Len(FORM.RD_ExecChef_fname) NEQ 0>RD_ExecChef_fname,</CFIF>
		<CFIF Len(FORM.RD_ExecChef_lname) NEQ 0>RD_ExecChef_lname,</CFIF>
		<CFIF Len(FORM.RD_ExecChefOwner) NEQ 0>RD_ExecChefOwner,</CFIF>
		<CFIF Len(FORM.RD_Chef_fname) NEQ 0>RD_Chef_fname,</CFIF>
		<CFIF Len(FORM.RD_Chef_lname) NEQ 0>RD_Chef_lname,</CFIF>
		<CFIF Len(FORM.RD_ChefOwner) NEQ 0>RD_ChefOwner,</CFIF>
		<CFIF Len(FORM.RD_PastryChef_fname) NEQ 0>RD_PastryChef_fname,</CFIF>
		<CFIF Len(FORM.RD_PastryChef_lname) NEQ 0>RD_PastryChef_lname,</CFIF>
		<CFIF Len(FORM.RD_PastryChefOwner) NEQ 0>RD_PastryChefOwner,</CFIF>
		<CFIF Len(FORM.RD_wdSommelier_fname) NEQ 0>RD_wdSommelier_fname,</CFIF>
		<CFIF Len(FORM.RD_wdSommelier_lname) NEQ 0>RD_wdSommelier_lname,</CFIF>
		<CFIF Len(FORM.RD_wdSommelierOwner) NEQ 0>RD_wdSommelierOwner,</CFIF>
		<CFIF Len(FORM.RD_maitredGM_fname) NEQ 0>RD_maitredGM_fname,</CFIF>
		<CFIF Len(FORM.RD_maitredGM_lname) NEQ 0>RD_maitredGM_lname,</CFIF>
		<CFIF Len(FORM.RD_maitredGMOwner) NEQ 0>RD_maitredGMOwner,</CFIF>
		<CFIF Len(FORM.RD_owner1_fname) NEQ 0>RD_owner1_fname,</CFIF>
		<CFIF Len(FORM.RD_owner1_lname) NEQ 0>RD_owner1_lname,</CFIF>
		<CFIF Len(FORM.RD_owner2_fname) NEQ 0>RD_owner2_fname,</CFIF>
		<CFIF Len(FORM.RD_owner2_lname) NEQ 0>RD_owner2_lname,</CFIF>
		<CFIF Len(FORM.RD_typeRest) NEQ 0>RD_typeRest,</CFIF>
		<CFIF Len(FORM.RD_cuisine) NEQ 0>RD_cuisine,</CFIF>
		<CFIF Len(FORM.RD_DIRprice) NEQ 0>RD_DIRprice,</CFIF>
		<CFIF Len(FORM.RD_swl_yn) NEQ 0>RD_swl_yn,</CFIF>
		<CFIF Len(FORM.RD_CCAccepted) NEQ 0>RD_CCAccepted,</CFIF>
		<CFIF Len(FORM.RD_ClosedOn) NEQ 0>RD_ClosedOn,</CFIF>
		<CFIF Len(FORM.RD_CINN) NEQ 0>RD_CINN,</CFIF>
		<CFIF Len(FORM.RD_Hotel) NEQ 0>RD_Hotel,</CFIF>
		<CFIF Len(FORM.RD_DressCode) NEQ 0>RD_DressCode,</CFIF>
		<CFIF Len(FORM.RD_PrivateRooms) NEQ 0>RD_PrivateRooms,</CFIF>
		<CFIF Len(FORM.RD_SignatureDishes) NEQ 0>RD_SignatureDishes,</CFIF>
		<CFIF Len(FORM.RD_AdditionalDetails) NEQ 0>RD_AdditionalDetails,</CFIF>
		<CFIF Len(FORM.RD_CompNameProfDir) NEQ 0>RD_CompNameProfDir,</CFIF>
		<CFIF Len(FORM.RD_CompanyName) NEQ 0>RD_CompanyName,</CFIF>
		<CFIF Len(FORM.RD_Company_fname) NEQ 0>RD_Company_fname,</CFIF>
		<CFIF Len(FORM.RD_Company_lname) NEQ 0>RD_Company_lname,</CFIF>
		<CFIF Len(FORM.RD_Company_title) NEQ 0>RD_Company_title,</CFIF>
		<CFIF Len(FORM.RD_Company_address) NEQ 0>RD_Company_address,</CFIF>
		<CFIF Len(FORM.RD_Company_address2) NEQ 0>RD_Company_address2,</CFIF>
		<CFIF Len(FORM.RD_Company_URL) NEQ 0>RD_Company_URL,</CFIF>
		<CFIF Len(FORM.RD_Company_phone) NEQ 0>RD_Company_phone,</CFIF>
		<CFIF Len(FORM.RD_Company_fax) NEQ 0>RD_Company_fax,</CFIF>
		<CFIF Len(FORM.RD_Company_email) NEQ 0>RD_Company_email,</CFIF>
		<CFIF Len(FORM.RD_Company_description) NEQ 0>RD_Company_description,</CFIF>
		<CFIF Len(FORM.RD_ApprovedtoAdd) NEQ 0>RD_ApprovedtoAdd,</CFIF>
		<CFIF Len(FORM.culPosTitle) NEQ 0>culPosTitle,</CFIF>
		<CFIF Len(FORM.culPosTitle2) NEQ 0>culPosTitle2,</CFIF>
		<CFIF Len(FORM.culPosTitle3) NEQ 0>culPosTitle3,</CFIF>
		<CFIF Len(FORM.culPosTitle4) NEQ 0>culPosTitle4,</CFIF>
		<CFIF Len(FORM.culPosTitle5) NEQ 0>culPosTitle5,</CFIF>
		<CFIF Len(FORM.BillingDiffMailing) NEQ 0>BillingDiffMailing,</CFIF>
		<CFIF Len(FORM.JBFawards) NEQ 0>JBFawards,</CFIF>
		<CFIF Len(FORM.JBFWhosWho) NEQ 0>JBFWhosWho,</CFIF>
		<CFIF Len(FORM.MemberPriceTicketsNum) NEQ 0>MemberPriceTicketsNum,</CFIF>
		<CFIF Len(FORM.AllNamesAdded) NEQ 0>AllNamesAdded,</CFIF>
		<CFIF Len(FORM.BoardRoomPrivilege) NEQ 0>BoardRoomPrivilege,</CFIF>
		<CFIF Len(FORM.BoardRoomPrivilegeDate1) NEQ 0>BoardRoomPrivilegeDate1,</CFIF>
		<CFIF Len(FORM.BoardRoomPrivilegeDate2) NEQ 0>BoardRoomPrivilegeDate2,</CFIF>
		<CFIF Len(FORM.BoardRoomPrivilegeDate3) NEQ 0>BoardRoomPrivilegeDate3,</CFIF>
		<CFIF Len(FORM.HouseRentalWithFee) NEQ 0>HouseRentalWithFee,</CFIF>
		<CFIF Len(FORM.HouseRentalWithFeeDate1) NEQ 0>HouseRentalWithFeeDate1,</CFIF>
		<CFIF Len(FORM.AwardID) NEQ 0>AwardID</CFIF>
		
		<cfif FORM.DefaultPaymentMethod IS 1>
				CCType, CreditCardNumber, CreditCardExpDate, 
			<cfelseif FORM.DefaultPaymentMethod IS 2> routingnumber, bankaccount, 
			<cfelseif FORM.DefaultPaymentMethod IS 0>
		</cfif>
		
		PhoneNumber, PhoneExt, WorkNumber, WorkExt, CellNumber, FAXNumber, EmailAddress, emailable, Comments,
		<!---<cfif IsDate(FORM.BirthDate)>MbrDOB, </cfif>--->
		defaultpaymentmethod<!---, AddressValidated <cfif AddressValidated>,AddressValidatedStamp</cfif>--->, Dues, Term)
 
 <!--- 
		AltAddress, 
		AltAddress2,
		AltCity,
		AltState,
		AltZip,</CFIF>
		AltCountry,</CFIF>
		Company,</CFIF>
 
		<!--- MembershipCategory,--->
		MemberType,
		IsResident,
		TermExpirationDate,
		Title,
		IsCorpMaster,
		IsCorpChild,
		School,
		Region,
		
		AltRegion,
		Alt2Address,
		Alt2Address2,
		Alt2City,
		Alt2State,
		Alt2Zip,
		Alt2Region,
		Alt2Country,
		Alt3Address,
		Alt3Address2,
		Alt3City,
		Alt3State,
		Alt3Zip,
		Alt3Region,
		Alt3Country,
		Alt4Address,
		Alt4Address2,
		Alt4City,
		Alt4State,
		Alt4Zip,
		Alt4Region,
		Alt4Country,
		Alt5Address,
		Alt5Address2,
		Alt5City,
		Alt5State,
		Alt5Zip,
		Alt5Region,
		Alt5Country,
		Alt6Address,
		Alt6Address2,
		Alt6City,
		Alt6State,
		Alt6Zip,
		Alt6Region,
		Alt6Country,
		Alt7Address,
		Alt7Address2,
		Alt7City,
		Alt7State,
		Alt7Zip,
		Alt7Region,
		Alt7Country,
		Alt8Address,
		Alt8Address2,
		Alt8City,
		Alt8State,
		Alt8Zip,
		Alt8Region,
		Alt8Country,
		Alt9Address,
		Alt9Address2,
		Alt9City,
		Alt9State,
		Alt9Zip,
		Alt9Region,
		Alt9Country,
		Alt10Address,
		Alt10Address2,
		Alt10City,
		Alt10State,
		Alt10Zip,
		Alt10Region,
		Alt10Country,
		Alt11Addess,
		Alt11Address2,
		Alt11City,
		Alt11State,
		Alt11Zip,
		Alt11Region,
		Alt11Country,
		Alt12Address,
		Alt12Address2,
		Alt12City,
		Alt12State,
		Alt12Zip,
		Alt12Region,
		Alt12Country,
		Alt13Address,
		Alt13Address2,
		Alt13City,
		Alt13State,
		Alt13Zip,
		Alt13Region,
		Alt13Country,
		Alt14Address,
		Alt14Address2,
		Alt14City,
		Alt14State,
		Alt14Zip,
		Alt14Region,
		Alt14Country,
		Alt15Address,
		Alt15Address2,
		Alt15City,
		Alt15State,
		Alt15Zip,
		Alt15Region,
		Alt15Country,
		Alt16Address,
		Alt16Address2,
		Alt16City,
		Alt16State,
		Alt16Zip,
		Alt16Region,
		Alt16Country,
		Alt17Address,
		Alt17Address2,
		Alt17City,
		Alt17State,
		Alt17Zip,
		Alt17Region,
		Alt17Country,
		Alt18Address,
		Alt18Address2,
		Alt18City,
		Alt18State,
		Alt18Zip,
		Alt18Region,
		Alt18Country,
		Alt19Address,
		Alt19Address2,
		Alt19City,
		Alt19State,
		Alt19Zip,
		Alt19Region,
		Alt19Country,
		Alt20Address,
		Alt20Address2,
		Alt20City,
		Alt20State,
		Alt20Zip,
		Alt20Region,
		Alt20Country,
		BillingAddress,
		BillingAddress2,
		BillingCity,
		BillingState,
		BillingZip,
		AltBillingAddress,
		AltBillingAddress2,
		AltBillingCity,
		AltBillingState,
		AltBillingZip,
		IsResidence,
 
		EmailAddress,
		EmailFormat,
		GiftMessage,
		MemDoNotSolicit,
		MbrDOB,
		optout,
		badphone,
		lastupdated,
 
		AltCCType,
		AltCreditCardNumber,
		AltCreditCardExpDate,
		AltExpMonth,
		AltExpYear,
		declinedate,
		CcdEffort,
		CcdDateNext,
		newcc,
 
		AddressValidated,
		AddressValidatedStamp,
		CompSource,
		CancelDate,
		CancelReason,
		DateUpdated,
		Comments,
		KitSent,
		stuGradDate,
		
		FBP_ProfDir,
		FBP_RestDir,
		
		PD_RestName,
		PD_RestAddress,
		PD_RestAddress2,
		PD_RestCity,
		PD_RestState,
		PD_RestZip,
		PD_RestCountry,
		PD_www,
		PD_EmailAddress2,
		PD_WorkGenNumber,
		PD_WorkResNumber,
		PD_FaxNumberRest,
		PD_ExecChef_fname,
		PD_ExecChef_lname,
		PD_ExecChefOwner,
		PD_Chef_fname,
		PD_Chef_lname,
		PD_ChefOwner,
		PD_PastryChef_fname,
		PD_PastryChef_lname,
		PD_PastryChefOwner,
		PD_wdSommelier_fname,
		PD_wdSommelier_lname,
		PD_wdSommelierOwner,
		PD_maitredGM_fname,
		PD_maitredGM_lname,
		PD_maitredGMOwner,
		PD_owner1_fname,
		PD_owner1_lname,
		PD_owner2_fname,
		PD_owner2_lname,
		PD_typeRest,
		PD_cuisine,
		PD_DIRprice,
		PD_swl_yn,
		PD_CCAccepted,
		PD_ClosedOn,
		PD_CINN,
		PD_Hotel,
		PD_DressCode,
		PD_PrivateRooms,
		PD_SignatureDishes,
		PD_AdditionalDetails,
		PD_CompNameProfDir,
		PD_CompanyName,
		PD_Company_fname,
		PD_Company_lname,
		PD_Company_title,
		PD_Company_address,
		PD_Company_address2,
		PD_Company_URL,
		PD_Company_phone,
		PD_Company_fax,
		PD_Company_email,
		PD_Company_description,
		PD_ApprovedtoAdd,
		
		RD_RestName,
		RD_RestAddress,
		RD_RestAddress2,
		RD_RestCity,
		RD_RestState,
		RD_RestZip,
		RD_RestCountry,
		RD_www,
		RD_EmailAddress2,
		RD_WorkGenNumber,
		RD_WorkResNumber,
		RD_FaxNumberRest,
		RD_ExecChef_fname,
		RD_ExecChef_lname,
		RD_ExecChefOwner,
		RD_Chef_fname,
		RD_Chef_lname,
		RD_ChefOwner,
		RD_PastryChef_fname,
		RD_PastryChef_lname,
		RD_PastryChefOwner,
		RD_wdSommelier_fname,
		RD_wdSommelier_lname,
		RD_wdSommelierOwner,
		RD_maitredGM_fname,
		RD_maitredGM_lname,
		RD_maitredGMOwner,
		RD_owner1_fname,
		RD_owner1_lname,
		RD_owner2_fname,
		RD_owner2_lname,
		RD_typeRest,
		RD_cuisine,
		RD_DIRprice,
		RD_swl_yn,
		RD_CCAccepted,
		RD_ClosedOn,
		RD_CINN,
		RD_Hotel,
		RD_DressCode,
		RD_PrivateRooms,
		RD_SignatureDishes,
		RD_AdditionalDetails,
		RD_CompNameProfDir,
		RD_CompanyName,
		RD_Company_fname,
		RD_Company_lname,
		RD_Company_title,
		RD_Company_address,
		RD_Company_address2,
		RD_Company_URL,
		RD_Company_phone,
		RD_Company_fax,
		RD_Company_email,
		RD_Company_description,
		RD_ApprovedtoAdd,
		
		culPosTitle,
		culPosTitle2,
		culPosTitle3,
		culPosTitle4,
		culPosTitle5,
		BillingDiffMailing,
		JBFawards,
		JBFWhosWho,
		MemberPriceTicketsNum,
		AllNamesAdded,
		
		BoardRoomPrivilege,
		BoardRoomPrivilegeDate1,
		BoardRoomPrivilegeDate2,
		BoardRoomPrivilegeDate3,
		
		HouseRentalWithFee,
		HouseRentalWithFeeDate1,
		
		AwardID
 
 --->
      
	  VALUES 
 
	  (GETDATE(),              
	  '#FORM.Sourcecode#',     
	  '#FORM.JoinMethod#',     
	  '#membernumber#',      
	  '#FORM.FirstName#',  
	  '#FORM.LastName#',   
	  '#FORM.MiddleInitial#',   
	  '#FORM.Address#',         
	  '#FORM.Address2#',         
	  '#FORM.city#',           
	  '#FORM.State#',      
	  '#left(trim(FORM.Zip),5)#',             
	  '#FORM.Country#',
	  
	  <CFIF Len(FORM.AltAddress) NEQ 0>
	  '#FORM.AltAddress#',         
	  '#FORM.AltAddress2#',         
	  '#FORM.Altcity#',           
	  '#FORM.AltState#',      
	  '#left(trim(FORM.AltZip),5)#',             
	  '#FORM.AltCountry#',
	   </CFIF>
	   
	  '#Form.Company#',
	  
	<!--- Newly added fields--->
		
		<!--- <CFIF Len(FORM.MembershipCategory) NEQ 0>'#Form.MembershipCategory#',</CFIF>--->
		<CFIF Len(FORM.MemberType) NEQ 0>'#Form.MemberType#',</CFIF>
		<CFIF Len(FORM.IsResident) NEQ 0>'#Form.IsResident#',</CFIF>
		<CFIF Len(FORM.TermExpirationDate) NEQ 0>'#Form.TermExpirationDate#',</CFIF>
		<CFIF Len(FORM.Title) NEQ 0>'#Form.Title#',</CFIF>
		<CFIF Len(FORM.IsCorpMaster) NEQ 0>'#Form.IsCorpMaster#',</CFIF>
		<CFIF Len(FORM.IsCorpChild) NEQ 0>'#Form.IsCorpChild#',</CFIF>
		<CFIF Len(FORM.School) NEQ 0>'#Form.School#',</CFIF>
		<CFIF Len(FORM.Region) NEQ 0>'#Form.Region#',</CFIF>
		<CFIF Len(FORM.AltRegion) NEQ 0>'#Form.AltRegion#',</CFIF>
		<CFIF Len(FORM.Alt2Address) NEQ 0>'#Form.Alt2Address#',
		'#Form.Alt2Address2#',
		'#Form.Alt2City#',
		'#Form.Alt2State#',
		'#Form.Alt2Zip#',
		'#Form.Alt2Region#',
		'#Form.Alt2Country#',
		</CFIF>
		<CFIF Len(FORM.Alt3Address) NEQ 0>'#Form.Alt3Address#',
		'#Form.Alt3Address2#',
		'#Form.Alt3City#',
		'#Form.Alt3State#',
		'#Form.Alt3Zip#',
		'#Form.Alt3Region#',
		'#Form.Alt3Country#',
		</CFIF>
		<CFIF Len(FORM.Alt4Address) NEQ 0>'#Form.Alt4Address#',
		'#Form.Alt4Address2#',
		'#Form.Alt4City#',
		'#Form.Alt4State#',
		'#Form.Alt4Zip#',
		'#Form.Alt4Region#',
		'#Form.Alt4Country#',
		</CFIF>
		<CFIF Len(FORM.Alt5Address) NEQ 0>'#Form.Alt5Address#',
		'#Form.Alt5Address2#',
		'#Form.Alt5City#',
		'#Form.Alt5State#',
		'#Form.Alt5Zip#',
		'#Form.Alt5Region#',
		'#Form.Alt5Country#',
		</CFIF>
		<CFIF Len(FORM.Alt6Address) NEQ 0>'#Form.Alt6Address#',
		'#Form.Alt6Address2#',
		'#Form.Alt6City#',
		'#Form.Alt6State#',
		'#Form.Alt6Zip#',
		'#Form.Alt6Region#',
		'#Form.Alt6Country#',
		</CFIF>
		<CFIF Len(FORM.Alt7Address) NEQ 0>'#Form.Alt7Address#',
		'#Form.Alt7Address2#',
		'#Form.Alt7City#',
		'#Form.Alt7State#',
		'#Form.Alt7Zip#',
		'#Form.Alt7Region#',
		'#Form.Alt7Country#',
		</CFIF>
		<CFIF Len(FORM.Alt8Address) NEQ 0>'#Form.Alt8Address#',
		'#Form.Alt8Address2#',
		'#Form.Alt8City#',
		'#Form.Alt8State#',
		'#Form.Alt8Zip#',
		'#Form.Alt8Region#',
		'#Form.Alt8Country#',
		</CFIF>
		<CFIF Len(FORM.Alt9Address) NEQ 0>'#Form.Alt9Address#',
		'#Form.Alt9Address2#',
		'#Form.Alt9City#',
		'#Form.Alt9State#',
		'#Form.Alt9Zip#',
		'#Form.Alt9Region#',
		'#Form.Alt9Country#',
		</CFIF>
		<CFIF Len(FORM.Alt10Address) NEQ 0>'#Form.Alt10Address#',
		'#Form.Alt10Address2#',
		'#Form.Alt10City#',
		'#Form.Alt10State#',
		'#Form.Alt10Zip#',
		'#Form.Alt10Region#',
		'#Form.Alt10Country#',
		</CFIF>
		<CFIF Len(FORM.Alt11Address) NEQ 0>'#Form.Alt11Address#',
		'#Form.Alt11Address2#',
		'#Form.Alt11City#',
		'#Form.Alt11State#',
		'#Form.Alt11Zip#',
		'#Form.Alt11Region#',
		'#Form.Alt11Country#',
		</CFIF>
		<CFIF Len(FORM.Alt12ddress) NEQ 0>'#Form.Alt12Address#',
		'#Form.Alt12Address2#',
		'#Form.Alt12City#',
		'#Form.Alt12State#',
		'#Form.Alt12Zip#',
		'#Form.Alt12Region#',
		'#Form.Alt12Country#',
		</CFIF>
		<CFIF Len(FORM.Alt13Address) NEQ 0>'#Form.Alt13Address#',
		'#Form.Alt13Address2#',
		'#Form.Alt13City#',
		'#Form.Alt13State#',
		'#Form.Alt13Zip#',
		'#Form.Alt13Region#',
		'#Form.Alt13Country#',
		</CFIF>
		<CFIF Len(FORM.Alt14Address) NEQ 0>'#Form.Alt14Address#',
		'#Form.Alt14Address2#',
		'#Form.Alt14City#',
		'#Form.Alt14State#',
		'#Form.Alt14Zip#',
		'#Form.Alt14Region#',
		'#Form.Alt14Country#',
		</CFIF>
		<CFIF Len(FORM.Alt15Address) NEQ 0>'#Form.Alt15Address#',
		'#Form.Alt15Address2#',
		'#Form.Alt15City#',
		'#Form.Alt15State#',
		'#Form.Alt15Zip#',
		'#Form.Alt15Region#',
		'#Form.Alt15Country#',
		</CFIF>
		<CFIF Len(FORM.Alt16Address) NEQ 0>'#Form.Alt16Address#',
		'#Form.Alt16Address2#',
		'#Form.Alt16City#',
		'#Form.Alt16State#',
		'#Form.Alt16Zip#',
		'#Form.Alt16Region#',
		'#Form.Alt16Country#',
		</CFIF>
		<CFIF Len(FORM.Alt17Address) NEQ 0>'#Form.Alt17Address#',
		'#Form.Alt17Address2#',
		'#Form.Alt17City#',
		'#Form.Alt17State#',
		'#Form.Alt17Zip#',
		'#Form.Alt17Region#',
		'#Form.Alt17Country#',
		</CFIF>
		<CFIF Len(FORM.Alt18Address) NEQ 0>'#Form.Alt18Address#',
		'#Form.Alt18Address2#',
		'#Form.Alt18City#',
		'#Form.Alt18State#',
		'#Form.Alt18Zip#',
		'#Form.Alt18Region#',
		'#Form.Alt18Country#',
		</CFIF>
		<CFIF Len(FORM.Alt19Address) NEQ 0>'#Form.Alt19Address#',
		'#Form.Alt19Address2#',
		'#Form.Alt19City#',
		'#Form.Alt19State#',
		'#Form.Alt19Zip#',
		'#Form.Alt19Region#',
		'#Form.Alt19Country#',
		</CFIF>
		<CFIF Len(FORM.Alt20Address) NEQ 0>'#Form.Alt20Address#',
		'#Form.Alt20Address2#',
		'#Form.Alt20City#',
		'#Form.Alt20State#',
		'#Form.Alt20Zip#',
		'#Form.Alt20Region#',
		'#Form.Alt20Country#',
		</CFIF>
 
 
		<CFIF Len(FORM.BillingAddress) NEQ 0>'#Form.BillingAddress#',</CFIF>
		<CFIF Len(FORM.BillingAddress2) NEQ 0>'#Form.BillingAddress2#',</CFIF>
		<CFIF Len(FORM.BillingCity) NEQ 0>'#Form.BillingCity#',</CFIF>
		<CFIF Len(FORM.BillingState) NEQ 0>'#Form.BillingState#',</CFIF>
		<CFIF Len(FORM.BillingZip) NEQ 0>'#Form.BillingZip#',</CFIF>
		<CFIF Len(FORM.AltBillingAddress) NEQ 0>'#Form.AltBillingAddress#',</CFIF>
		<CFIF Len(FORM.AltBillingAddress2) NEQ 0>'#Form.AltBillingAddress2#',</CFIF>
		<CFIF Len(FORM.AltBillingCity) NEQ 0>'#Form.AltBillingCity#',</CFIF>
		<CFIF Len(FORM.AltBillingState) NEQ 0>'#Form.AltBillingState#',</CFIF>
		<CFIF Len(FORM.AltBillingZip) NEQ 0>'#Form.AltBillingZip#',</CFIF>
		<CFIF Len(FORM.IsResidence) NEQ 0>'#Form.IsResidence#',</CFIF>
		
		<CFIF Len(FORM.EmailFormat) NEQ 0>'#Form.EmailFormat#',</CFIF>
		<CFIF Len(FORM.GiftMessage) NEQ 0>'#Form.GiftMessage#',</CFIF>
		<CFIF Len(FORM.MemDoNotSolicit) NEQ 0>'#Form.MemDoNotSolicit#',</CFIF>
		<CFIF Len(FORM.MbrDOB) NEQ 0>'#Form.MbrDOB#',</CFIF>
 
		<CFIF Len(FORM.optout) NEQ 0>'#Form.optout#',</CFIF>
		<CFIF Len(FORM.badphone) NEQ 0>'#Form.badphone#',</CFIF>
		<CFIF Len(FORM.lastupdated) NEQ 0>'#Form.lastupdated#',</CFIF>
		
		<CFIF Len(FORM.AltCCType) NEQ 0>'#Form.AltCCType#',</CFIF>
		<CFIF Len(FORM.AltCreditCardNumber) NEQ 0>'#Form.AltCreditCardNumber#',</CFIF>
		<CFIF Len(FORM.AltCreditCardExpDate) NEQ 0>'#Form.AltCreditCardExpDate#',</CFIF>
		<CFIF Len(FORM.AltExpMonth) NEQ 0>'#Form.AltExpMonth#',</CFIF>
		<CFIF Len(FORM.AltExpYear) NEQ 0>'#Form.AltExpYear#',</CFIF>
		<CFIF Len(FORM.declinedate) NEQ 0>'#Form.declinedate#',</CFIF>
		<CFIF Len(FORM.CcdEffort) NEQ 0>'#Form.CcdEffort#',</CFIF>
		<CFIF Len(FORM.CcdDateNext) NEQ 0>'#Form.CcdDateNext#',</CFIF>
		<CFIF Len(FORM.newcc) NEQ 0>'#Form.newcc#',</CFIF>
		
		<CFIF Len(FORM.AddressValidated) NEQ 0>'#Form.AddressValidated#',</CFIF>
		<CFIF Len(FORM.AddressValidatedStamp) NEQ 0>'#Form.AddressValidatedStamp#',</CFIF>
		<CFIF Len(FORM.CompSource) NEQ 0>'#Form.CompSource#',</CFIF>
		<CFIF Len(FORM.CancelDate) NEQ 0>'#Form.CancelDate#',</CFIF>
		<CFIF Len(FORM.CancelReason) NEQ 0>'#Form.CancelReason#',</CFIF>
		<CFIF Len(FORM.DateUpdated) NEQ 0>'#Form.DateUpdated#',</CFIF>
 
		<CFIF Len(FORM.KitSent) NEQ 0>'#Form.KitSent#',</CFIF>
		<CFIF Len(FORM.stuGradDate) NEQ 0>'#Form.stuGradDate#',</CFIF>
		<CFIF Len(FORM.FBP_ProfDir) NEQ 0>'#Form.FBP_ProfDir#',</CFIF>
		<CFIF Len(FORM.FBP_RestDir) NEQ 0>'#Form.FBP_RestDir#',</CFIF>
		<CFIF Len(FORM.PD_RestName) NEQ 0>'#Form.PD_RestName#',</CFIF>
		<CFIF Len(FORM.PD_RestAddress) NEQ 0>'#Form.PD_RestAddress#',</CFIF>
		<CFIF Len(FORM.PD_RestAddress2) NEQ 0>'#Form.PD_RestAddress2#',</CFIF>
		<CFIF Len(FORM.PD_RestCity) NEQ 0>'#Form.PD_RestCity#',</CFIF>
		<CFIF Len(FORM.PD_RestState) NEQ 0>'#Form.PD_RestState#',</CFIF>
		<CFIF Len(FORM.PD_RestZip) NEQ 0>'#Form.PD_RestZip#',</CFIF>
		<CFIF Len(FORM.PD_RestCountry) NEQ 0>'#Form.PD_RestCountry#',</CFIF>
		<CFIF Len(FORM.PD_www) NEQ 0>'#Form.PD_www#',</CFIF>
		<CFIF Len(FORM.PD_EmailAddress2) NEQ 0>'#Form.PD_EmailAddress2#',</CFIF>
		<CFIF Len(FORM.PD_WorkGenNumber) NEQ 0>'#Form.PD_WorkGenNumber#',</CFIF>
		<CFIF Len(FORM.PD_WorkResNumber) NEQ 0>'#Form.PD_WorkResNumber#',</CFIF>
		<CFIF Len(FORM.PD_FaxNumberRest) NEQ 0>'#Form.PD_FaxNumberRest#',</CFIF>
		<CFIF Len(FORM.PD_ExecChef_fname) NEQ 0>'#Form.PD_ExecChef_fname#',</CFIF>
		<CFIF Len(FORM.PD_ExecChef_lname) NEQ 0>'#Form.PD_ExecChef_lname#',</CFIF>
		<CFIF Len(FORM.PD_ExecChefOwner) NEQ 0>'#Form.PD_ExecChefOwner#',</CFIF>
		<CFIF Len(FORM.PD_Chef_fname) NEQ 0>'#Form.PD_Chef_fname#',</CFIF>
		<CFIF Len(FORM.PD_Chef_lname) NEQ 0>'#Form.PD_Chef_lname#',</CFIF>
		<CFIF Len(FORM.PD_ChefOwner) NEQ 0>'#Form.PD_ChefOwner#',</CFIF>
		<CFIF Len(FORM.PD_PastryChef_fname) NEQ 0>'#Form.PD_PastryChef_fname#',</CFIF>
		<CFIF Len(FORM.PD_PastryChef_lname) NEQ 0>'#Form.PD_PastryChef_lname#',</CFIF>
		<CFIF Len(FORM.PD_PastryChefOwner) NEQ 0>'#Form.PD_PastryChefOwner#',</CFIF>
		<CFIF Len(FORM.PD_wdSommelier_fname) NEQ 0>'#Form.PD_wdSommelier_fname#',</CFIF>
		<CFIF Len(FORM.PD_wdSommelier_lname) NEQ 0>'#Form.PD_wdSommelier_lname#',</CFIF>
		<CFIF Len(FORM.PD_wdSommelierOwner) NEQ 0>'#Form.PD_wdSommelierOwner#',</CFIF>
		<CFIF Len(FORM.PD_maitredGM_fname) NEQ 0>'#Form.PD_maitredGM_fname#',</CFIF>
		<CFIF Len(FORM.PD_maitredGM_lname) NEQ 0>'#Form.PD_maitredGM_lname#',</CFIF>
		<CFIF Len(FORM.PD_maitredGMOwner) NEQ 0>'#Form.PD_maitredGMOwner#',</CFIF>
		<CFIF Len(FORM.PD_owner1_fname) NEQ 0>'#Form.PD_owner1_fname#',</CFIF>
		<CFIF Len(FORM.PD_owner1_lname) NEQ 0>'#Form.PD_owner1_lname#',</CFIF>
		<CFIF Len(FORM.PD_owner2_fname) NEQ 0>'#Form.PD_owner2_fname#',</CFIF>
		<CFIF Len(FORM.PD_owner2_lname) NEQ 0>'#Form.PD_owner2_lname#',</CFIF>
		<CFIF Len(FORM.PD_typeRest) NEQ 0>'#Form.PD_typeRest#',</CFIF>
		<CFIF Len(FORM.PD_cuisine) NEQ 0>'#Form.PD_cuisine#',</CFIF>
		<CFIF Len(FORM.PD_DIRprice) NEQ 0>'#Form.PD_DIRprice#',</CFIF>
		<CFIF Len(FORM.PD_swl_yn) NEQ 0>'#Form.PD_swl_yn#',</CFIF>
		<CFIF Len(FORM.PD_CCAccepted) NEQ 0>'#Form.PD_CCAccepted#',</CFIF>
		<CFIF Len(FORM.PD_ClosedOn) NEQ 0>'#Form.PD_ClosedOn#',</CFIF>
		<CFIF Len(FORM.PD_CINN) NEQ 0>'#Form.PD_CINN#',</CFIF>
		<CFIF Len(FORM.PD_Hotel) NEQ 0>'#Form.PD_Hotel#',</CFIF>
		<CFIF Len(FORM.PD_DressCode) NEQ 0>'#Form.PD_DressCode#',</CFIF>
		<CFIF Len(FORM.PD_PrivateRooms) NEQ 0>'#Form.PD_PrivateRooms#',</CFIF>
		<CFIF Len(FORM.PD_SignatureDishes) NEQ 0>'#Form.PD_SignatureDishes#',</CFIF>
		<CFIF Len(FORM.PD_AdditionalDetails) NEQ 0>'#Form.PD_AdditionalDetails#',</CFIF>
		<CFIF Len(FORM.PD_CompNameProfDir) NEQ 0>'#Form.PD_CompNameProfDir#',</CFIF>
		<CFIF Len(FORM.PD_CompanyName) NEQ 0>'#Form.PD_CompanyName#',</CFIF>
		<CFIF Len(FORM.PD_Company_fname) NEQ 0>P'#Form.D_Company_fname#',</CFIF>
		<CFIF Len(FORM.PD_Company_lname) NEQ 0>'#Form.PD_Company_lname#',</CFIF>
		<CFIF Len(FORM.PD_Company_title) NEQ 0>'#Form.PD_Company_title#',</CFIF>
		<CFIF Len(FORM.PD_Company_address) NEQ 0>'#Form.PD_Company_address#',</CFIF>
		<CFIF Len(FORM.PD_Company_address2) NEQ 0>'#Form.PD_Company_address2#',</CFIF>
		<CFIF Len(FORM.PD_Company_URL) NEQ 0>'#Form.PD_Company_URL#',</CFIF>
		<CFIF Len(FORM.PD_Company_phone) NEQ 0>'#Form.PD_Company_phone#',</CFIF>
		<CFIF Len(FORM.PD_Company_fax) NEQ 0>'#Form.PD_Company_fax#',</CFIF>
		<CFIF Len(FORM.PD_Company_email) NEQ 0>'#Form.PD_Company_email#',</CFIF>
		<CFIF Len(FORM.PD_Company_description) NEQ 0>'#Form.PD_Company_description#',</CFIF>
		<CFIF Len(FORM.PD_ApprovedtoAdd) NEQ 0>'#Form.PD_ApprovedtoAdd#',</CFIF>
		<CFIF Len(FORM.RD_RestName) NEQ 0>'#Form.RD_RestName#',</CFIF>
		<CFIF Len(FORM.RD_RestAddress) NEQ 0>'#Form.RD_RestAddress#',</CFIF>
		<CFIF Len(FORM.RD_RestAddress2) NEQ 0>'#Form.RD_RestAddress2#',</CFIF>
		<CFIF Len(FORM.RD_RestCity) NEQ 0>'#Form.RD_RestCity#',</CFIF>
		<CFIF Len(FORM.RD_RestState) NEQ 0>'#Form.RD_RestState#',</CFIF>
		<CFIF Len(FORM.RD_RestZip) NEQ 0>'#Form.RD_RestZip#',</CFIF>
		<CFIF Len(FORM.RD_RestCountry) NEQ 0>'#Form.RD_RestCountry#',</CFIF>
		<CFIF Len(FORM.RD_www) NEQ 0>'#Form.RD_www#',</CFIF>
		<CFIF Len(FORM.RD_EmailAddress2) NEQ 0>'#Form.RD_EmailAddress2#',</CFIF>
		<CFIF Len(FORM.RD_WorkGenNumber) NEQ 0>'#Form.RD_WorkGenNumber#',</CFIF>
		<CFIF Len(FORM.RD_WorkResNumber) NEQ 0>'#Form.RD_WorkResNumber#',</CFIF>
		<CFIF Len(FORM.RD_FaxNumberRest) NEQ 0>'#Form.RD_FaxNumberRest#',</CFIF>
		<CFIF Len(FORM.RD_ExecChef_fname) NEQ 0>'#Form.RD_ExecChef_fname#',</CFIF>
		<CFIF Len(FORM.RD_ExecChef_lname) NEQ 0>'#Form.RD_ExecChef_lname#',</CFIF>
		<CFIF Len(FORM.RD_ExecChefOwner) NEQ 0>'#Form.RD_ExecChefOwner#',</CFIF>
		<CFIF Len(FORM.RD_Chef_fname) NEQ 0>'#Form.RD_Chef_fname#',</CFIF>
		<CFIF Len(FORM.RD_Chef_lname) NEQ 0>'#Form.RD_Chef_lname#',</CFIF>
		<CFIF Len(FORM.RD_ChefOwner) NEQ 0>'#Form.RD_ChefOwner#',</CFIF>
		<CFIF Len(FORM.RD_PastryChef_fname) NEQ 0>'#Form.RD_PastryChef_fname#',</CFIF>
		<CFIF Len(FORM.RD_PastryChef_lname) NEQ 0>'#Form.RD_PastryChef_lname#',</CFIF>
		<CFIF Len(FORM.RD_PastryChefOwner) NEQ 0>'#Form.RD_PastryChefOwner#',</CFIF>
		<CFIF Len(FORM.RD_wdSommelier_fname) NEQ 0>'#Form.RD_wdSommelier_fname#',</CFIF>
		<CFIF Len(FORM.RD_wdSommelier_lname) NEQ 0>'#Form.RD_wdSommelier_lname#',</CFIF>
		<CFIF Len(FORM.RD_wdSommelierOwner) NEQ 0>'#Form.RD_wdSommelierOwner#',</CFIF>
		<CFIF Len(FORM.RD_maitredGM_fname) NEQ 0>'#Form.RD_maitredGM_fname#',</CFIF>
		<CFIF Len(FORM.RD_maitredGM_lname) NEQ 0>'#Form.RD_maitredGM_lname#',</CFIF>
		<CFIF Len(FORM.RD_maitredGMOwner) NEQ 0>'#Form.RD_maitredGMOwner#',</CFIF>
		<CFIF Len(FORM.RD_owner1_fname) NEQ 0>'#Form.RD_owner1_fname#',</CFIF>
		<CFIF Len(FORM.RD_owner1_lname) NEQ 0>'#Form.RD_owner1_lname#',</CFIF>
		<CFIF Len(FORM.RD_owner2_fname) NEQ 0>'#Form.RD_owner2_fname#',</CFIF>
		<CFIF Len(FORM.RD_owner2_lname) NEQ 0>'#Form.RD_owner2_lname#',</CFIF>
		<CFIF Len(FORM.RD_typeRest) NEQ 0>'#Form.RD_typeRest#',</CFIF>
		<CFIF Len(FORM.RD_cuisine) NEQ 0>'#Form.RD_cuisine#',</CFIF>
		<CFIF Len(FORM.RD_DIRprice) NEQ 0>'#Form.RD_DIRprice#',</CFIF>
		<CFIF Len(FORM.RD_swl_yn) NEQ 0>'#Form.RD_swl_yn#',</CFIF>
		<CFIF Len(FORM.RD_CCAccepted) NEQ 0>'#Form.RD_CCAccepted#',</CFIF>
		<CFIF Len(FORM.RD_ClosedOn) NEQ 0>'#Form.RD_ClosedOn#',</CFIF>
		<CFIF Len(FORM.RD_CINN) NEQ 0>'#Form.RD_CINN#',</CFIF>
		<CFIF Len(FORM.RD_Hotel) NEQ 0>'#Form.RD_Hotel#',</CFIF>
		<CFIF Len(FORM.RD_DressCode) NEQ 0>'#Form.RD_DressCode#',</CFIF>
		<CFIF Len(FORM.RD_PrivateRooms) NEQ 0>'#Form.RD_PrivateRooms#',</CFIF>
		<CFIF Len(FORM.RD_SignatureDishes) NEQ 0>'#Form.RD_SignatureDishes#',</CFIF>
		<CFIF Len(FORM.RD_AdditionalDetails) NEQ 0>'#Form.RD_AdditionalDetails#',</CFIF>
		<CFIF Len(FORM.RD_CompNameProfDir) NEQ 0>'#Form.RD_CompNameProfDir#',</CFIF>
		<CFIF Len(FORM.RD_CompanyName) NEQ 0>'#Form.RD_CompanyName#',</CFIF>
		<CFIF Len(FORM.RD_Company_fname) NEQ 0>'#Form.RD_Company_fname#',</CFIF>
		<CFIF Len(FORM.RD_Company_lname) NEQ 0>'#Form.RD_Company_lname#',</CFIF>
		<CFIF Len(FORM.RD_Company_title) NEQ 0>'#Form.RD_Company_title#',</CFIF>
		<CFIF Len(FORM.RD_Company_address) NEQ 0>'#Form.RD_Company_address#',</CFIF>
		<CFIF Len(FORM.RD_Company_address2) NEQ 0>'#Form.RD_Company_address2#',</CFIF>
		<CFIF Len(FORM.RD_Company_URL) NEQ 0>'#Form.RD_Company_URL#',</CFIF>
		<CFIF Len(FORM.RD_Company_phone) NEQ 0>'#Form.RD_Company_phone#',</CFIF>
		<CFIF Len(FORM.RD_Company_fax) NEQ 0>'#Form.RD_Company_fax#',</CFIF>
		<CFIF Len(FORM.RD_Company_email) NEQ 0>'#Form.RD_Company_email#',</CFIF>
		<CFIF Len(FORM.RD_Company_description) NEQ 0>'#Form.RD_Company_description#',</CFIF>
		<CFIF Len(FORM.RD_ApprovedtoAdd) NEQ 0>'#Form.RD_ApprovedtoAdd#',</CFIF>
		<CFIF Len(FORM.culPosTitle) NEQ 0>'#Form.culPosTitle#',</CFIF>
		<CFIF Len(FORM.culPosTitle2) NEQ 0>'#Form.culPosTitle2#',</CFIF>
		<CFIF Len(FORM.culPosTitle3) NEQ 0>'#Form.culPosTitle3#',</CFIF>
		<CFIF Len(FORM.culPosTitle4) NEQ 0>'#Form.culPosTitle4#',</CFIF>
		<CFIF Len(FORM.culPosTitle5) NEQ 0>'#Form.culPosTitle5#',</CFIF>
		<CFIF Len(FORM.BillingDiffMailing) NEQ 0>'#Form.BillingDiffMailing#',</CFIF>
		<CFIF Len(FORM.JBFawards) NEQ 0>'#Form.JBFawards#',</CFIF>
		<CFIF Len(FORM.JBFWhosWho) NEQ 0>'#Form.JBFWhosWho#',</CFIF>
		<CFIF Len(FORM.MemberPriceTicketsNum) NEQ 0>'#Form.MemberPriceTicketsNum#',</CFIF>
		<CFIF Len(FORM.AllNamesAdded) NEQ 0>'#Form.AllNamesAdded#',</CFIF>
		<CFIF Len(FORM.BoardRoomPrivilege) NEQ 0>'#Form.BoardRoomPrivilege#',</CFIF>
		<CFIF Len(FORM.BoardRoomPrivilegeDate1) NEQ 0>'#Form.BoardRoomPrivilegeDate1#',</CFIF>
		<CFIF Len(FORM.BoardRoomPrivilegeDate2) NEQ 0>'#Form.BoardRoomPrivilegeDate2#',</CFIF>
		<CFIF Len(FORM.BoardRoomPrivilegeDate3) NEQ 0>'#Form.BoardRoomPrivilegeDate3#',</CFIF>
		<CFIF Len(FORM.HouseRentalWithFee) NEQ 0>'#Form.HouseRentalWithFee#',</CFIF>
		<CFIF Len(FORM.HouseRentalWithFeeDate1) NEQ 0>'#Form.HouseRentalWithFeeDate1#',</CFIF>
		<CFIF Len(FORM.AwardID) NEQ 0>'#Form.AwardID#'</CFIF>
 
 
	<!--- End newly added fields--->
	
	  <cfif FORM.DefaultPaymentMethod IS 1>
	  '#FORM.CCType#',
	  '#FORM.CreditCardNumber#', 
	  '#FORM.ExpMonth##FORM.ExpYear#', 
	  <cfelseif FORM.DefaultPaymentMethod IS 2>
	  '#FORM.RoutingNumber#',   
	  '#FORM.AccountNumber#',
	  <cfelseif FORM.DefaultPaymentMethod IS 0>
	  </cfif>
	  
	  '#Variables.PhoneNumber#',
	  '#Form.PhoneExt#',
	  '#Variables.WorkNumber#',
	  '#Form.WorkExt#',
	  '#Variables.CellNumber#',
	  '#Variables.FAXNumber#',
	  '#FORM.EmailAddress#',
	  '#FORM.emailable#',
	  '#FORM.Comments#', 
	  <!---<cfif IsDate(FORM.Birthdate)>
	  #CreateODBCDate(FORM.BirthDate)#, 
	  </cfif>--->
	  #FORM.DefaultPaymentMethod#<!---,
	  #AddressValidated#
	  <cfif AddressValidated>
	  ,getdate()
	  </cfif>--->,
	  #Variables.Dues#,
	  '#Form.Term#')
	</cfquery>
	</cflock>
 
  <cfset noteClassID = 58>
  <cfset noteMessage = "Individual">
  
  	<cfif FORM.DefaultPaymentMethod EQ 9>
	    <cfinvokeargument name="CompDesignation" value="#FORM.CompDesignation#">
		<!--- Insert info into CompMembership table --->
		<cfquery datasource="#Request.DSN#">
  	INSERT INTO CompMembership(<CFIF len(Form.memberID) NEQ 0>memberID</CFIF>, CompDesignation, CompEvent, CompYear)
  	VALUES(<CFIF len(Form.MemberID) NEQ 0>'#Form.memberID#',</CFIF>'#Form.CompDesignation#', '#Form.CompEvent#', '#FORM.CompYear#')
  		</cfquery>
	</cfif>
  
  <!--- Insert note about new membership --->
 <cfquery datasource="#Request.DSN#">
  	INSERT INTO MemberNotes(MemberNumber, alarm, membernote, updated, noteclassid, user_initials, notemethod, kitSent, Comments, Program)
  	VALUES('#membernumber#', 0, '#NoteMessage#', getdate(), #noteclassID#, '#Session.User_initials#', '#FORM.JoinMethod#', '#FORM.kitSent#','#FORM.Comments#',#FORM.Program#)
  </cfquery>
  
  <!---<cfquery datasource="#Request.DSN#" name="m">
    SELECT     Members.StateShip
    FROM         Members INNER JOIN
                          States ON Members.StateShip = States.State
    WHERE     (Members.MemberNumber = #membernumber#)
  </cfquery>--->
</cftransaction>  
 
<!--- This creates the porfile record. --->
 
  <!---<cfobject component="memberServices" name="myMember">--->
  <cfinvoke component="components.memberServices" method="Init">
	  <cfinvokeargument name="Membernumber" value="#membernumber#">
	  <cfinvokeargument name="Employeeid" value="#Session.user_ID#">
  <!---<cfset temp = myMember.Init(membernumber, Session.user_ID)>--->
  </cfinvoke>
 
  <cfinvoke component="components.memberServices" method="CreateProfile">
	  <cfinvokeargument name="Membernumber" value="#membernumber#">
	  <cfinvokeargument name="Program" value="#FORM.Program#">
	  <cfinvokeargument name="Employeeid" value="#Session.user_ID#">
	  <cfinvokeargument name="JoinMethod" value="#Form.JoinMethod#">
	  <cfif FORM.DefaultPaymentMethod EQ 9>
	    <cfinvokeargument name="Dues" value="0">
	  <cfelse>	
		<cfinvokeargument name="Dues" value="#Form.Dues#">
	  </cfif>
	  <cfif IsReferral>
	  	<cfinvokeargument name="Referrer" value="#referredby#">
	  </cfif>
	  <cfinvokeargument name="Sourcecode" value="#FORM.Sourcecode#">
	  <cfinvokeargument name="IsBmlJoin" value="#IIF(FORM.DefaultPaymentMethod IS 0, 1, 0)#">
	  <cfinvokeargument name="Term" value="#FORM.Term#">
	 
	  <cfif Len(Trim(FORM.StartDate)) NEQ 0>
	    <cfinvokeargument name="StartDate" value="#FORM.StartDate#">
	  </cfif>
	  <cfif Len(Trim(FORM.ExpireDate)) NEQ 0>
	    <cfinvokeargument name="ExpireDate" value="#FORM.ExpireDate#">
	  </cfif>
  </cfinvoke>
	
  <cfif FORM.Referredby NEQ "">
		<!--- Check if referral membernumber exists --->
		<cfquery name="ref" datasource="#Request.DSN#">
		SELECT Membernumber
		FROM Members
		WHERE MemberNumber=#referredby#
		</cfquery>
		
		<!--- If member exists we are going to insert a referall note on their account.
		Referral still needs to be created for "referee" --->
		<cfif ref.recordcount IS 1>
			<cfset IsReferral = 1>
			
			<!--- Insert a note about who member was referred by --->  
			<cfquery datasource="#Request.DSN#">
			INSERT INTO MemberNotes(MemberNumber, alarm, membernote, updated, noteclassid, user_initials, notemethod)
			VALUES(#memberNumber#, 0, 'Member was referred by #FORM.referredby#', getdate(), 16, '#Session.User_initials#', 'Auto')
			</cfquery>
			
			<!--- Insert a note about this member referring somemone --->
			<cfquery datasource="#Request.DSN#">
			INSERT INTO MemberNotes(MemberNumber, alarm, membernote, updated, noteclassid, user_initials, notemethod)
			VALUES(#referredby#, 0, 'Member referred #memberNumber#', #now()#, 16, '#Session.User_initials#', 'Auto')
			</cfquery>    
		</cfif>
	</cfif>
	
<!--- Send welcome e-mail to James Beard Member Database members only
<cfif FORM.Program IS 1>
  <cf_send_welcome_email membernumber="#membernumber#">
</cfif> --->
 
<!--- Send them to the Search Page--->
<CFLOCATION url="findmember2.cfm?member=#membernumber#&type=shipfind" addtoken="no">
 
<!---<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
  <TITLE>Activate New Member</TITLE>
  <LINK rel="stylesheet" href="../../css/default.css" type="text/css">
</HEAD>
<BODY>
<cfinclude template="universal_header.cfm">
<TABLE width="100%" border="0" cellspacing="0" cellpadding="10">
  <TR>
  <TD bgcolor="#FFFFFF">
  <TABLE border="0" cellspacing="0" cellpadding="0" align="right">
      <TR>
        <TD class="mininav"><cfoutput><A href="../../index2.cfm">Main Menu</A> | <A href="index.cfm">Member Locator</A> | <A href="#CurrentPage#?MM_logout=1">Logout</A></cfoutput></TD>
      </TR>
    </TABLE>
  <H3>Activate New Studen Membership</H3>
<cfoutput>
<!---<cfif IsDefined("AVErrorMessage")>
<SPAN class="ErrorMessage"><B>Warnings:</B></SPAN>
<SPAN class="errorMessage">#AVErrorMessage#</SPAN><p>
</cfif>--->
Member #membernumber# has been activated.<BR>
<!---<A href="cgemail1.cfm?member=#membernumber#&type=member">Enter Email Address</A><BR>
<A href="cgphone1.cfm?member=#membernumber#&type=member">Enter Phone Number</A><BR>
<A href="cgadd1.cfm?member=#membernumber#&type=member">Change Address</A><BR>
<A href="cgname1.cfm?member=#membernumber#&type=member">Enter Change of Name/Correct Misspelling of Name</A><BR>
<A href="findmember2.cfm?member=#membernumber#&type=member">Back to the Member Gateway</A>--->
</cfoutput>
</TD>
</TR>
</TABLE>
<cfinclude template="universal_footer.cfm">
</BODY>
</HTML>--->

Open in new window

Avatar of rob_lorentz
rob_lorentz

i would look into using cfinclude to create a single code base that did the validations and data updates.
Avatar of PaulyWolly

ASKER

Do you have an example or something to get me started? I sent all the code I have, maybe to create something new.
ASKER CERTIFIED SOLUTION
Avatar of infomaster1st
infomaster1st

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial