1 neenan 1.1 <!--- Name: act_addprogramTypes.cfm
2 Purpose: This functions as the action file to link the existing programtypes selected by the user for their
3 organization to the dorganization table. The values are passed on from the dsp_addprogramtypes.cfm form.
4 Each time this page is called,the records in the dorgtoprogramtype table are deleted for the particular
5 organization and fresh records are appended.
6 Date created: 02/24/2005
7 Dependancy: URL.URL.Orgid
8 Variables:
9
10 Functions:
11 Date changed: 02/24/2005 Prabin & Neena Created & Documentation
|
12 pKanel 1.2 05/05/2005 Neena Made changes to balance the code for removing Autonumber Field
13 from dOrgToProgramType Table for OrgPTID field.
14 08/15/2005 Terry Added URL variable for skipping step
15 08/15/2005 Terry Documentation
16 --->
17
18 <!--- checks to see if the skip variable is present in the URL - determines whether a user can skip through the step --->
19 <cfif #url.skip# NEQ 1>
20 <cfquery name="deletepg" datasource="#Programsdb#">
21 delete
22 from dOrgToProgramType
23 Where OrgID = #URL.ORGID#
24 </cfquery>
|
25 neenan 1.1
26
27 <cfset Array = #ListToArray(form.ProgramTypeID)#>
28
29 <cfloop from="1" to="#ArrayLen(Array)#" index="x">
|
30 pKanel 1.2
31 <!--- New code added in next 4 statements to compute maximum OrgPTID --->
32 <!--- <cfquery name="maxOPId" datasource="#programsdb#">
33 Select max(OrgPTID) as maxOrgPTID from dOrgtoprogramtype
34 </cfquery>
35 <cfset newOrgPTID = #maxOPId.maxOrgPTID# + 1> --->
36
37 <cfquery datasource="#Programsdb#">
38 Insert Into dOrgtoprogramtype (OrgID, ProgramTypeID)
39 Values(#URL.OrgID#, #Array[x]#)
40 </cfquery>
41
|
42 neenan 1.1 </cfloop>
|
43 pKanel 1.2 </cfif>
|