(file) Return to act_addorganization.cfm CVS log (file) (dir) Up to [Development] / p2rx-programs

File: [Development] / p2rx-programs / act_addorganization.cfm (download)
Revision: 1.3, Wed Aug 31 18:59:32 2005 UTC (4 years, 2 months ago) by pKanel
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +20 -10 lines
Enhancements made to resolve programs added or udpated by Outsite users.

<!--- 	Name:  act_addorganization.cfm
    	Purpose: This functions as the action file to insert the organizational information passed on from the dsp_addorganization.cfm form
		.The values are inserted into the dorganization table. The value of storedate (which is the date when the organization info is being inserted
		into the table) is also passed onto the next form of dsp_contact so that the current organization info is visible on the dsp_addcontact
		form where the storedate acts as a key value to differentiate between various users using the same form.
		Date created: 02/24/2005
       	Dependancy: URL.Orgid 
		Variables: 	Currdate - Stores the current date/time value.
					Storedate - a hidden value which is a replica of the currdate to pass onto the next form.
					
		Functions: 
		Date changed: 
					02/24/2005		Prabin & Neena  Created
					02/24/2005		Neena		    Documentation
					08/22/2005		Prabin			added cfoutput to get the list of states.	
---> 

<!--- New code inserted for adding new org id based on maximum + 1 of existing orgid Number --->
<cfquery name="getMaxOrgID" datasource="#programsdb#">
Select max(orgid) as MaxOrgID from dorganization 
</cfquery>

<cfset neworgid = #getMaxOrgID.MaxOrgID# + 1> 

<!--- earlier code continues here --->

<cfif 	#form.Phone_Area# EQ "" OR 
	  	#form.Phone_Area# EQ "N/A" OR
		#form.Phone_Prefix# EQ "" OR
		#form.Phone_Prefix# EQ "N/A" OR
		#form.Phone_Num# EQ "" OR
		#form.Phone_Num# EQ "N/A"
	>
		<cfset FinalPhoneNumber="">

<cfelse>
		<cfset FinalPhoneNumber='#form.Phone_Area#-#form.Phone_Prefix#-#form.Phone_Num#'> 
</cfif>


<cfif 	#form.FaxNumber_Area# EQ "" OR 
	  	#form.FaxNumber_Area# EQ "N/A" OR
		#form.FaxNumber_Prefix# EQ "" OR
		#form.FaxNumber_Prefix# EQ "N/A" OR
		#form.FaxNumber_Num# EQ "" OR
		#form.FaxNumber_Num# EQ "N/A"
>
		<cfset FinalFaxNumber="">

<cfelse>
		<cfset FinalFaxNumber='#form.FaxNumber_Area#-#form.FaxNumber_Prefix#-#form.FaxNumber_Num#'> 
</cfif>


<cfif 	#form.Hotline_Area# EQ "" OR 
	  	#form.Hotline_Area# EQ "N/A" OR
		#form.Hotline_Prefix# EQ "" OR
		#form.Hotline_Prefix# EQ "N/A" OR
		#form.Hotline_Num# EQ "" OR
		#form.Hotline_Num# EQ "N/A"
>
		<cfset FinalHotline="">

<cfelse>
		<cfset FinalHotline='#form.Hotline_Area#-#form.Hotline_Prefix#-#form.Hotline_Num#'> 
</cfif>

<cfset currdate= DateFormat(Now(),"mm/dd/yyyy") & " " & TimeFormat(Now(),"hh:mm:ss")> 
<!--- in order to insert a timestamp for the new organization to come over the conflict problem --->
<cfset storedate = currdate>

<cfquery name="InsertOrg" datasource="#programsdb#">
Insert Into dOrganization
				(Orgid,OrganizationName, Phone, Extension, Division, FaxNumber, TimeZone, Address1, EmailName, GeoServiceID, Address2, Hotline, City, StateOrProvince, URL, PostalCode, Country, GraphicURL, Profile, Times, Visitor_Id, UpdateStatus)
		Values	 (#neworgid#,
				 '#form.OrganizationName#', 
				 '#FinalPhoneNumber#', 
				 '#form.Extension#', 
				 '#form.Division#', 
				 '#FinalFaxNumber#', 
				 '#form.TimeZone#', 
				 '#form.Address1#', 
				 '#form.EmailName#', 
				 #form.GeoServiceID#, 
				 '#form.Address2#', 
				 '#FinalHotline#', 				
				 '#form.City#', 
				 '#form.StateOrProvince#', 
				 '#form.URL#', 
				 '#form.PostalCode#', 
				 '#form.Country#', 
				 '#form.GraphicURL#', 
				 '#form.Profile#',
				 '#currdate#',
				  #userdate#,
				  '1')
</cfquery>

<cfoutput> <input type="hidden" name="storedate" value="#storedate#"> </cfoutput> 

CVS Admin
Powered by
ViewCVS 1.0-dev