|
|
|
|
File: [Development] / p2rx-programs / dsp_editcontact.cfm
(download)
Revision: 1.4, Fri Aug 26 16:08:19 2005 UTC (4 years, 2 months ago) by pKanel Branch: MAIN Changes since 1.3: +23 -112 lines Enhancements made to resolve programs added or udpated by Outsite users. |
<!--- Name: dsp_editcontact.cfm
Purpose: It helps to edit an existing contact information while editing the recently added organization
and related information in the database. It also transfers all the form variables to act_updatecontact.cfm
and the actual action of updating the data in the dcontact table. URL.ContactID is passed on to the action
form to retreive the necessary contact info.
Date created: 02/23/2005
Dependancy: URL.Orgid and URL.ContactID
Variables: Primary - Primary contact or not
FirstName - First Name of the contact(Required)
Middle - Middle name of the contact if applicable.
LastName - Phone Number of the organization (Required)
NameSuffix - Suffix such as Mr, Mrs or Miss
Title - Title of the contact
Address - Postal address of the contact
City- Contact's city name
Zip - Zip code for the contact's address
Country - Country of official residence.
WorkPhone_Area - Work Phone Area Number of the contact
WorkPhone_Prefix - Work Phone Prefix of the contact
WorkPhone_Num - Work Phone Number of the contact
WorkExtension - Extension if applicable
FaxNumber_Area - Fax Area Number of the contact
FaxNumber_Prefix - Fax Number Prefix of the contact
FaxNumber_Num - Fax Number of the contact
MobilePhone_Area - Mobile Phone Area of the contact
MobilePhone_Prefix - Mobile Phone Prefix of the contact
MobilePhone_Num - Mobile Phone Number of the contact
EmailName - Email of the contact
Functions:
Date changed:
02/23/2005 Prabin & Neena Created
02/23/2005 Neena Documentation
03/22/2005 Neena Commented out the Span and image tags
08/15/2005 Terry Added hyperlink for user to skip step
08/26/2005 Prabin Added qery to get states and populate
the value of the state.
--->
<cfparam name="URL.EditContact" default="no">
<cfif #URL.fuseaction# IS "EditContacts" or #URl.fuseaction# is "editcontacts1">
<cfquery name="getcontacts" datasource="#programsdb#">
Select *
From dContacts, dOrganization
Where dContacts.OrgID = dOrganization.OrgID
And dOrganization.OrgID = #URL.OrgID#
</cfquery>
</cfif>
<cfif #URL.EditContact# IS "YES">
<cfquery name="getcontactsinfo" datasource="#programsdb#">
Select *
From dContacts, dOrganization
Where dContacts.OrgID = dOrganization.OrgID
And dOrganization.OrgID = #URL.OrgID#
And dContacts.ContactID = #URL.ContactID#
</cfquery>
<cfif #getcontactsinfo.WorkPhone# EQ "" OR #getcontactsinfo.WorkPhone# EQ "N/A">
<cfset WorkPhone_Area = "">
<cfset WorkPhone_Prefix = "">
<cfset WorkPhone_Num = "">
<cfelse>
<cfset WorkPhone_Area = Left(getcontactsinfo.WorkPhone, 3)>
<cfset WorkPhone_Prefix = Mid(getcontactsinfo.WorkPhone, 5, 3)>
<cfset WorkPhone_Num = right(getcontactsinfo.WorkPhone, 4)>
</cfif>
<cfif #getcontactsinfo.FaxNumber# EQ "" OR #getcontactsinfo.FaxNumber# EQ "N/A">
<cfset FaxNumber_Area = "">
<cfset FaxNumber_Prefix = "">
<cfset FaxNumber_Num = "">
<cfelse>
<cfset FaxNumber_Area = Left(getcontactsinfo.FaxNumber, 3)>
<cfset FaxNumber_Prefix = Mid(getcontactsinfo.FaxNumber, 5, 3)>
<cfset FaxNumber_Num = right(getcontactsinfo.FaxNumber, 4)>
</cfif>
<cfif #getcontactsinfo.MobilePhone# EQ "" OR #getcontactsinfo.MobilePhone# EQ "N/A">
<cfset MobilePhone_Area = "">
<cfset MobilePhone_Prefix = "">
<cfset MobilePhone_Num = "">
<cfelse>
<cfset MobilePhone_Area = Left(getcontactsinfo.MobilePhone, 3)>
<cfset MobilePhone_Prefix = Mid(getcontactsinfo.MobilePhone, 5, 3)>
<cfset MobilePhone_Num = right(getcontactsinfo.MobilePhone, 4)>
</cfif>
</cfif>
<!-- #BeginEditable "Content" -->
<table width="100%" border="0" cellspacing="0" cellpadding="10" name="text">
<tr>
<td>
<p>
<!--- <span class="subheading"> --->
EDIT A PROGRAM -> <!--- <img src="../images/siteimage/dart.gif" border="0"> --->
EDIT CONTACT INFO <!--- <img src="../images/siteimage/dart.gif" border="0"></span> --->
<!--- <span class="sublink2"> --->Step 2 <!--- <img src="../images/siteimage/dart.gif" border="0"></span> ---><br><br>
<cfif getcontacts.recordcount gt 0>
<cfoutput query="getcontacts">
<!--- <span class="redtext"> --->* Required Fields<!--- </span> --->
<br><br>
Please click on contact person's name to update information or click <a href="addeditprograms.cfm?fuseaction=editProgramTypes1&OrgID=<cfoutput>#URl.Orgid#</cfoutput>"><strong>here</strong></a> to proceed to the next step.<br><br>
<cfif #URL.fuseaction# Is "EditContacts1">
<a href="addeditprograms.cfm?fuseaction=EditContacts1&OrgID=#OrgID#&ContactID=#ContactID#&EditContact=yes" class="linktext2">
<cfelseif #URL.fuseaction# Is "EditContacts">
<a href="addeditprograms.cfm?fuseaction=EditContacts&OrgID=#OrgID#&ContactID=#ContactID#&EditContact=yes" class="linktext2">
</cfif>
<strong>#FirstName# #LastName#</strong></a>
</cfoutput>
<cfelse>
<a href="addeditprograms.cfm?fuseaction=NewContact&OrgID=<cfoutput>#URL.orgid#</cfoutput>" class="linktext2">
<strong>Add a contact</strong></a>
</cfif>
<cfif #URL.fuseaction# is "editcontacts1" and #URL.EditContact# is "yes">
<form name="editContact" action="addeditprograms.cfm?fuseaction=EditMoreContacts1&OrgID=<cfoutput>#URL.OrgID#</cfoutput>" onclick="return namevalidate(this);" method="post">
<table width="95%" border="0" cellspacing="0" cellpadding="5" bgcolor="#F4FFE9">
<cfoutput query="getcontactsinfo">
<tr>
<td><div class="formtext">Primary ?</td></div>
<td><cfif #Primary# is "1">
<input type="checkbox" name="Primary" value="1" checked>
<cfelse>
<input type="checkbox" name="Primary" value="1">
</cfif>
</td>
</tr>
<tr>
<td><div class="formtext">Prefix</td>
<td><input type="text" name="Prefix" size="4" value="#Prefix#"></div></td>
</tr>
<tr>
<td><div class="formtext">First Name <font style="color: red">*</font></td>
<td><input type="text" size="15" name="FirstName" value="#FirstName#">
<input type="hidden" name="FirstName_required" value="Please enter contact person's first name, or enter 'n/a'.">
</td>
</tr>
<tr>
<td><div class="formtext">Middle</td>
<td><input type="text" size="1" name="Middle"></div></td>
</tr>
<tr>
<td><div class="formtext">Last Name <font style="color: red">*</font></td>
<td><input type="text" size="15" name="LastName" value="#LastName#">
<input type="hidden" name="LastName_required" value="Please enter contact person's last name, or enter 'n/a'.">
</td>
</tr>
<tr>
<td><div class="formtext">Suffix </td>
<td><input type="text" size="5" name="NameSuffix" value="#NameSuffix#"></td>
</tr>
<tr>
<td><div class="formtext">Title</td>
<td><input type="text" size="20" name="Title" value="#Title#"></td>
</tr>
<tr>
<td><div class="formtext">Address</td>
<td>
<input type="text" size="25" name="Address" value="#Address#"></div>
</td>
</tr>
<tr>
<td><div class="formtext">City</td>
<td align="justified" nowrap>
<input type="text" size="25" name="City" value="#City#"></div>
</td>
</tr>
</cfoutput>
<tr>
<td><div class="formtext">State</td>
<td>
<select name="State">
<cfoutput query="getState">
<option value="#Abbr#" <cfif #Abbr# EQ #getcontactsinfo.stateOrProvince#> selected </cfif>>#State#</option>
</cfoutput>
</select></div>
</td>
</tr>
<tr>
<td><div class="formtext">Zip</td>
<td align="justified" nowrap>
<input type="text" size="10" name="Zip" value="#Zip#"></div>
</td>
</tr>
<cfoutput query="getcontactsinfo">
<tr>
<td><div class="formtext">Country </td>
<td><input type="text" size="18" name="Country" value="United States"></div>
</td>
</tr>
<tr>
<td><div class="formtext">Contact Phone</td>
<td><input type="Text" size="3" maxlength="3" name="WorkPhone_Area">-
<input type="Text" size="3" maxlength="3" name="WorkPhone_Prefix">-
<input type="Text" size="4" maxlength="4" name="WorkPhone_Num">
<font class="formtext">Ext.</font>
<input type="text" size="5" name="WorkExtension">
</td>
</tr>
<tr>
<td><div class="formtext">Contact Fax</td>
<td><input type="Text" size="3" maxlength="3" name="FaxNumber_Area">-
<input type="Text" size="3" maxlength="3" name="FaxNumber_Prefix">-
<input type="Text" size="4" maxlength="4" name="FaxNumber_Num"></div>
</td>
</tr>
<tr>
<td><div class="formtext">Mobile Phone</td>
<td><input type="Text" size="3" maxlength="3" name="MobilePhone_Area">-
<input type="Text" size="3" maxlength="3" name="MobilePhone_Prefix">-
<input type="Text" size="4" maxlength="4" name="MobilePhone_Num"></div>
</td>
</tr>
<tr>
<td><div class="formtext">Email</td>
<td colspan="3"><input type="text" size="40" name="EmailName" value="@"></div></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
<td><div class="formtext"><INPUT type="submit" value="EditContact">
<INPUT type="Hidden" name="contactID" value="#URL.ContactID#">
<INPUT type="reset" value="Reset"></div></td>
</tr>
</cfoutput>
</table>
</form>
<cfelseif #URL.fuseaction# is "editcontacts" and #URL.EditContact# is "yes">
<form name="editContact" action="addeditprograms.cfm?fuseaction=EditMoreContacts&OrgID=<cfoutput>#URL.OrgID#</cfoutput>" onsubmit="return namevalidate(this);" method="post">
<table width="95%" border="0" cellspacing="0" cellpadding="5" bgcolor="#F4FFE9">
<tr>
<td><div class="formtext">Primary ?</td></div>
<cfoutput query="getcontactsinfo">
<td><cfif #Primary# is "1">
<input type="checkbox" name="Primary" value="1" checked>
<cfelse>
<input type="checkbox" name="Primary" value="1">
</cfif>
</td>
</tr>
<tr>
<td><div class="formtext">Prefix</td>
<td><input type="text" name="Prefix" size="4" value="#Prefix#"></div></td>
</tr>
<tr>
<td><div class="formtext">First Name <font style="color: red">*</font></td>
<td><input type="text" size="15" name="FirstName" value="#FirstName#">
<input type="hidden" name="FirstName_required" value="Please enter contact person's first name, or enter 'n/a'.">
</td>
</tr>
<tr>
<td><div class="formtext">Middle</td>
<td><input type="text" size="1" name="Middle"></div></td>
</tr>
<tr>
<td><div class="formtext">Last Name <font style="color: red">*</font></td>
<td><input type="text" size="15" name="LastName" value="#LastName#">
<input type="hidden" name="LastName_required" value="Please enter contact person's last name, or enter 'n/a'.">
</td>
</tr>
<tr>
<td><div class="formtext">Suffix </td>
<td><input type="text" size="5" name="NameSuffix" value="#NameSuffix#"></td>
</tr>
<tr>
<td><div class="formtext">Title</td>
<td><input type="text" size="20" name="Title" value="#Title#"></td>
</tr>
<tr>
<td><div class="formtext">Address</td>
<td>
<input type="text" size="25" name="Address" value="#Address#"></div>
</td>
</tr>
<tr>
<td><div class="formtext">City</td>
<td align="justified" nowrap>
<input type="text" size="25" name="City" value="#City#"></div>
</td>
</tr>
</cfoutput>
<tr>
<td><div class="formtext">State</td>
<td><select name="State">
<cfoutput query="getState">
<option value="#Abbr#" <cfif #Abbr# EQ #getcontactsinfo.stateOrProvince#> selected </cfif>>#State#</option>
</cfoutput>
</select></div>
</td>
</tr>
<cfoutput query="getcontactsinfo">
<tr>
<td><div class="formtext">Zip</td>
<td align="justified" nowrap>
<input type="text" size="10" name="Zip" value="#Zip#"></div>
</td>
</tr>
<tr>
<td><div class="formtext">Country </td>
<td><input type="text" size="18" name="Country" value="United States"></div>
</td>
</tr>
<tr>
<td><div class="formtext">Contact Phone</td>
<td><input type="Text" size="3" maxlength="3" name="WorkPhone_Area">-
<input type="Text" size="3" maxlength="3" name="WorkPhone_Prefix">-
<input type="Text" size="4" maxlength="4" name="WorkPhone_Num">
<font class="formtext">Ext.</font>
<input type="text" size="5" name="WorkExtension">
</td>
</tr>
<tr>
<td><div class="formtext">Contact Fax</td>
<td><input type="Text" size="3" maxlength="3" name="FaxNumber_Area">-
<input type="Text" size="3" maxlength="3" name="FaxNumber_Prefix">-
<input type="Text" size="4" maxlength="4" name="FaxNumber_Num"></div>
</td>
</tr>
<tr>
<td><div class="formtext">Mobile Phone</td>
<td><input type="Text" size="3" maxlength="3" name="MobilePhone_Area">-
<input type="Text" size="3" maxlength="3" name="MobilePhone_Prefix">-
<input type="Text" size="4" maxlength="4" name="MobilePhone_Num"></div>
</td>
</tr>
<tr>
<td><div class="formtext">Email</td>
<td colspan="3"><input type="text" size="40" name="EmailName" value="@"></div></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
<td><div class="formtext">
<INPUT type="submit" value="Edit Contact">
<INPUT type="Hidden" name="contactID" value="#URL.ContactID#">
<INPUT type="reset" value="Reset"></div></td>
</tr>
</cfoutput>
</table>
</form>
</cfif>
</td>
</tr>
</table>
</p>
| CVS Admin |
Powered by ViewCVS 1.0-dev |