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

File: [Development] / p2rx-programs / act_addProgramtypes.cfm (download)
Revision: 1.2, Fri Aug 26 16:08:19 2005 UTC (4 years, 2 months ago) by pKanel
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +26 -13 lines
Enhancements made to resolve programs added or udpated by Outsite users.

<!--- 	Name:  act_addprogramTypes.cfm
    	Purpose: This functions as the action file to link the existing programtypes selected by the user for their 
				organization to the	dorganization table. The values are passed on from the dsp_addprogramtypes.cfm form.
				Each time this page is called,the records in the dorgtoprogramtype table are deleted for the particular 
				organization and fresh records are appended.
		Date created: 02/24/2005
       	Dependancy: URL.URL.Orgid
		Variables: 	
					
		Functions: 
		Date changed: 	02/24/2005			Prabin & Neena  Created & Documentation
						05/05/2005			Neena			Made changes to balance the code for removing Autonumber Field 
															from dOrgToProgramType Table for OrgPTID field. 
						08/15/2005			Terry			Added URL variable for skipping step
						08/15/2005			Terry			Documentation
---> 

<!--- checks to see if the skip variable is present in the URL - determines whether a user can skip through the step --->
<cfif #url.skip# NEQ 1>
	<cfquery name="deletepg" datasource="#Programsdb#">
		delete 
		from   dOrgToProgramType
		Where	OrgID = #URL.ORGID#
	</cfquery> 


<cfset Array = #ListToArray(form.ProgramTypeID)#>

<cfloop from="1" to="#ArrayLen(Array)#" index="x">

	<!--- New code added in next 4 statements to compute maximum OrgPTID --->
<!--- 		<cfquery name="maxOPId" datasource="#programsdb#">
		Select max(OrgPTID) as maxOrgPTID from dOrgtoprogramtype
		</cfquery>
		<cfset newOrgPTID = #maxOPId.maxOrgPTID# + 1>  --->
		
		<cfquery datasource="#Programsdb#">
			Insert Into dOrgtoprogramtype (OrgID, ProgramTypeID)
			Values(#URL.OrgID#, #Array[x]#)
		</cfquery>
		
</cfloop>
</cfif>

CVS Admin
Powered by
ViewCVS 1.0-dev