Albee_J
asked on
ColdFusion Form inserting entries twice
I have a form that is used to add/edit/delete entries. However, it is inserting the entries twice. Â Please see form superdeck-add.cfm and the listing.cfc that goes with it.
<cfif IsDefined('FORM.Action')>
<cfparam name="FORM.SuperDeckTitle" default="">
<cfparam name="FORM.SuperDeckText" default="">
<cfparam name="FORM.SuperdeckCategoryID" default="">
<cfparam name="FORM.Live" default="">
<cfparam name="FORM.ExpireDate" default="">
<cfparam name="FORM.ExpireDate" default="">
<cfparam name="FORM.CompanyID" default="">
<cfparam name="FORM.ContactCompanyName" default="">
<cfparam name="FORM.ContactPhone" default="">
<cfparam name="FORM.ContactDisplayURL" default="">
<cfparam name="FORM.ContactActualURL" default="">
<cfparam name="FORM.ContactEmail" default="">
<cfparam name="FORM.ContactName" default="">
<cfparam name="FORM.SuperDeckImage" default="">
<cfinvoke component="Components.SuperDeck.Listing"
method="insertListing"
returnvariable="Listing"
argumentcollection="#FORM#"
>
</cfinvoke>
<cfset status = 3>
</cfif>
<cfif IsDefined('FORM.SuperDeckID')>
<cfif IsDefined('FORM.Delete')>
<cfinvoke component="Components.SuperDeck.Listing"
method="deleteListing"
returnvariable="Listing">
<cfinvokeargument name="SuperDeckID" value="#FORM.SuperDeckID#">
</cfinvoke>
<cfset status = 1>
<cfelse>
<cfparam name="FORM.SuperDeckTitle" default="">
<cfparam name="FORM.SuperDeckText" default="">
<cfparam name="FORM.SuperdeckCategoryID" default="">
<cfparam name="FORM.Live" default="">
<cfparam name="FORM.ExpireDate" default="">
<cfparam name="FORM.CompanyID" default="">
<cfparam name="FORM.ContactCompanyName" default="">
<cfparam name="FORM.ContactPhone" default="">
<cfparam name="FORM.ContactDisplayURL" default="">
<cfparam name="FORM.ContactActualURL" default="">
<cfparam name="FORM.ContactEmail" default="">
<cfparam name="FORM.ContactName" default="">
<cfparam name="FORM.SuperDeckImage" default="">
<cfinvoke component="Components.SuperDeck.Listing"
method="updateListing"
returnvariable="Listing"
argumentcollection="#FORM#"
>
</cfinvoke>
<cfparam name="URL.SuperDeckID" default="#FORM.SuperDeckID#">
<cfset status = 2>
</cfif>
</cfif>
<cfif NOT IsDefined('URL.SuperDeckID')>
<cfinvoke component="Components.SuperDeck.Listing"
method="getCategories"
returnvariable="Categories">
</cfinvoke>
<cfinvoke component="Components.SuperDeck.Listing"
method="getFFIDcompanies"
returnvariable="Companies">
</cfinvoke>
<cfinvoke component="Components.SuperDeck.Listing"
method="getFFIDcompanies"
returnvariable="Companies">
</cfinvoke>
<cfelse>
<cfinvoke component="Components.SuperDeck.Listing"
method="getOneListing"
returnvariable="Listing">
<cfif IsDefined('URL.SuperDeckID')>
<cfinvokeargument name="SuperDeckID" value="#URL.SuperDeckID#">
</cfif>
</cfinvoke>
<cfinvoke component="Components.SuperDeck.Listing"
method="getFFIDcompanies"
returnvariable="Companies">
<cfif IsDefined('URL.CompanyID')>
<cfinvokeargument name="CompanyID" value="#URL.CompanyID#">
</cfif>
</cfinvoke>
<cfinvoke component="Components.SuperDeck.Listing"
method="getCategories"
returnvariable="Categories">
</cfinvoke>
</cfif>
<cfif IsDefined('URL.SuperDeckID')>
<cf_FFID-Admin-Header pagetitle="SuperDeck Edit Listing">
<cfelse>
<cf_FFID-Admin-Header pagetitle="SuperDeck Add Listing">
</cfif>
<cf_FFID-Admin-Sidebar>
<!--- Page Title --->
<cfoutput>
<h2>SuperDeck <cfif IsDefined('URL.SuperDeckID')>Edit<cfelse>Add</cfif> Listing</h2>
</cfoutput>
<!--- Page Description --->
<p>Create or edit a Superdeck listing.</p>
<!--- BEGIN Content--->
<cfif IsDefined('status')>
<cfswitch expression="#status#">
<cfcase value="2"><p align="center"><font color="#ff0000"><b>Listing has been updated.</b></font><br/><a href="http://www.thefabricator.com/SuperDeck/Listing.cfm?SuperDeckID=<cfoutput>#FORM.SuperDeckID#</cfoutput>">View Live</a></p>
</cfcase>
<cfcase value="1"> <p align="center"><font color="#ff0000"><b>Listing has been removed.</b></font></p>
</cfcase>
<cfcase value="3"><p align="center"><font color="#ff0000"><b>Listing has been added.</b></font></p>
</cfcase>
</cfswitch>
</cfif>
<cfparam name="Listing.SuperdeckCategoryID" default="0">
<cfoutput>
<cfform action="Superdeck-Add.cfm" enctype="multipart/form-data">
<table cellpadding="3" cellspacing="0" width="600" border="0">
<td align="right"><b>Company:</b></td>
<td><select name="CompanyID">
<option value="INVALID"></option>
<cfloop query="Companies">
<option value="#Companies.CompanyID#"
<cfif IsDefined('Listing.CompanyID')>
<cfif Companies.CompanyID EQ Listing.CompanyID>
selected
</cfif>
</cfif>
>#Companies.CompanyName# - #Companies.CompanyID#</option>
</cfloop>
</select></td>
</tr>
<tr>
<td align="right"><b>Category:</b></b></td>
<td><select name="SuperdeckCategoryID">
<cfloop query="Categories">
<option value="#Categories.CategoryID#" <cfif Categories.CategoryID EQ Listing.SuperDeckCategoryID>selected</cfif>>#Categories.CategoryName#</option>
</cfloop>
</select>
</td>
</tr>
<tr>
<td align="right"><b>Title:</b></td>
<td>
<cfif IsDefined('Listing.SuperdeckTitle')>
<cfinput name="SuperdeckTitle" type="text" size="67" maxlength="255" required="yes" message="Please provide a Title to your ad." value="#Listing.SuperdeckTitle#">
<cfelse>
<cfinput name="SuperdeckTitle" type="text" size="67" maxlength="255" required="yes" message="Please provide a Title to your ad.">
</cfif></td>
</tr>
<tr>
<td valign="top" align="right"><b>Copy:</b><br />
<span class="body10pt"><i>150 words max.</i></span></td>
<td valign="top"><cfif IsDefined('Listing.SuperDeckText')>
<textarea name="SuperDeckText" id="SuperDeckText" required="yes" rows="6" cols="60"><cfoutput>#Listing.SuperDeckText#</cfoutput></textarea>
<script language="javascript1.2">
generate_wysiwyg('SuperDeckText');
</script>
<cfelse>
<textarea name="SuperDeckText" id="SuperDeckText" required="yes" rows="6" cols="60"></textarea>
<script language="javascript1.2">
generate_wysiwyg('SuperDeckText');
</script>
</cfif></td>
</tr>
<tr>
<td align="right"><b>Product Photo:</b></td>
<td><cfif IsDefined('Listing.SuperDeckImage') AND len(Listing.SuperDeckImage) GT 0>
<cfoutput><img src="http://www.thefabricator.com/SuperDeck/SuperDeckImages/#Listing.SuperDeckImage#"></cfoutput><br>
<input name="SuperDeckImage" type="file">
<cfelse>
<input name="SuperDeckImage" type="file">
</cfif></td>
</tr>
<tr>
<td align="right"><b>Live:</b></td>
<td><cfif IsDefined('Listing.Live')>
<cfif Listing.Live EQ 1>
<cfinput name="Live" type="radio" value="1" id="radio" checked> Yes<br/>
<cfinput name="Live" type="radio" value="0" id="radio"> No
<cfelse>
<cfinput name="Live" type="radio" value="1" id="radio"> Yes<br/>
<cfinput name="Live" type="radio" value="0" id="radio" checked> No
</cfif>
<cfelse>
<cfinput name="Live" type="radio" value="1" id="radio" checked> Yes<br/>
<cfinput name="Live" type="radio" value="0" id="radio"> No
</cfif></td>
</tr>
<tr>
<td align="right"><b>Expire Date:</b></td>
<td><cfif IsDefined('Listing.ExpireDate')>
<cfinput name="ExpireDate" type="text" required="yes" maxlength="255" size="10" value="#dateformat(Listing.ExpireDate,'short')#">
<cfelse>
<cfinput name="ExpireDate" type="text" required="yes" maxlength="255" size="10">
</cfif> <i>( M/D/YY format )</i></td>
</tr>
<tr><td colspan="2" class="subhead">Contact Information<hr></td></tr>
<tr>
<td align="right"><b>Company Name:</b></td>
<td><cfif IsDefined('Listing.ContactCompanyName')>
<cfinput name="ContactCompanyName" type="text" required="yes" maxlength="255" size="60" value="#Listing.ContactCompanyName#">
<cfelse>
<cfinput name="ContactCompanyName" type="text" required="yes" maxlength="255" size="60">
</cfif></td>
</tr>
<tr>
<td align="right"><b>Name:</b></td>
<td><cfif IsDefined('Listing.ContactName')>
<cfinput name="ContactName" type="text" required="yes" maxlength="255" size="50" value="#Listing.ContactName#">
<cfelse>
<cfinput name="ContactName" type="text" required="yes" maxlength="255" size="50">
</cfif></td>
</tr>
<tr>
<td align="right"><b>Phone:</b></td>
<td><cfif IsDefined('Listing.ContactPhone')>
<cfinput name="ContactPhone" type="text" required="yes" maxlength="255" size="20" value="#Listing.ContactPhone#">
<cfelse>
<cfinput name="ContactPhone" type="text" required="yes" maxlength="255" size="20">
</cfif></td>
</tr>
<tr>
<td align="right"><b>Email:</b></td>
<td><cfif IsDefined('Listing.ContactEmail')>
<cfinput name="ContactEmail" type="text" required="yes" maxlength="255" size="50" value="#Listing.ContactEmail#">
<cfelse>
<cfinput name="ContactEmail" type="text" required="yes" maxlength="255" size="50">
</cfif></td>
</tr>
<tr>
<td align="right"><b>Display URL:</b></td>
<td><cfif IsDefined('Listing.ContactDisplayURL')>
<cfinput name="ContactDisplayURL" type="text" required="yes" maxlength="255" size="60" value="#Listing.ContactDisplayURL#">
<cfelse>
<cfinput name="ContactDisplayURL" type="text" required="yes" maxlength="255" size="60">
</cfif></td>
</tr>
<tr>
<td align="right"><b>Actual URL:</b></td>
<td><cfif IsDefined('Listing.ContactActualURL')>
<cfinput name="ContactActualURL" type="text" required="yes" maxlength="255" size="60" value="#Listing.ContactActualURL#">
<cfelse>
<cfinput name="ContactActualURL" type="text" required="yes" maxlength="255" size="60">
</cfif></td>
</tr>
<tr>
<td align="right"> </td>
<td><cfif IsDefined('URL.SuperDeckID')>
<input type="Submit" name="Submit" value="Update Listing" id="submit"> <input type="Submit" name="Delete" value="Remove Listing" id="submit"><input type="hidden" name="SuperDeckID" value="#URL.SuperDeckID#" id="submit">
<cfelse>
<input type="Submit" name="Submit" id="submit" value="Add Listing"><input type="hidden" name="Action" value="Add" id="submit">
</cfif></td>
</tr>
</table>
</cfform>
</cfoutput>
<!--- END Content--->
<cf_FFID-Admin-Footer>
form.superDeckId is defined so when you aren't doing your delete you fall into your else and call listing component a second time.
ASKER
What should I do to correct the problem?
Sorry, I'm still pretty new to cf.
Sorry, I'm still pretty new to cf.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
I implemented the solution and strangely it is still duplicating
<cfparam name="FORM.SuperDeckTitle" default="">
<cfparam name="FORM.SuperDeckText" default="">
<cfparam name="FORM.SuperdeckCategoryID" default="">
<cfparam name="FORM.Live" default="">
<cfparam name="FORM.ExpireDate" default="">
<cfparam name="FORM.CompanyID" default="">
<cfparam name="FORM.ContactCompanyName" default="">
<cfparam name="FORM.ContactPhone" default="">
<cfparam name="FORM.ContactDisplayURL" default="">
<cfparam name="FORM.ContactActualURL" default="">
<cfparam name="FORM.ContactEmail" default="">
<cfparam name="FORM.ContactName" default="">
<cfparam name="FORM.SuperDeckImage" default="">
<cfparam name = "form.act" default="">
<cfif form.act is "Add Listing">
<cfinvoke component="Components.SuperDeck.Listing"
method="insertListing"
returnvariable="Listing"
argumentcollection="#FORM#"
>
</cfinvoke>
<cfset status = 3>
<cfelseif form.act is "Remove Listing">
<cfinvoke component="Components.SuperDeck.Listing"
method="deleteListing"
returnvariable="Listing">
<cfinvokeargument name="SuperDeckID" value="#FORM.SuperDeckID#">
</cfinvoke>
<cfset status = 1>
<cfelseIf form.act is "Update Listing">
<cfinvoke component="Components.SuperDeck.Listing"
method="updateListing"
returnvariable="Listing"
argumentcollection="#FORM#"
>
</cfinvoke>
<cfset status = 2>
</cfif>
<cfif NOT IsDefined('URL.SuperDeckID')>
<cfinvoke component="Components.SuperDeck.Listing"
method="getCategories"
returnvariable="Categories">
</cfinvoke>
<cfinvoke component="Components.SuperDeck.Listing"
method="getFFIDcompanies"
returnvariable="Companies">
</cfinvoke>
<cfinvoke component="Components.SuperDeck.Listing"
method="getFFIDcompanies"
returnvariable="Companies">
</cfinvoke>
<cfelse>
<cfinvoke component="Components.SuperDeck.Listing"
method="getOneListing"
returnvariable="Listing">
<cfif IsDefined('URL.SuperDeckID')>
<cfinvokeargument name="SuperDeckID" value="#URL.SuperDeckID#">
</cfif>
</cfinvoke>
<cfinvoke component="Components.SuperDeck.Listing"
method="getFFIDcompanies"
returnvariable="Companies">
<cfif IsDefined('URL.CompanyID')>
<cfinvokeargument name="CompanyID" value="#URL.CompanyID#">
</cfif>
</cfinvoke>
<cfinvoke component="Components.SuperDeck.Listing"
method="getCategories"
returnvariable="Categories">
</cfinvoke>
</cfif>
<cfif IsDefined('URL.SuperDeckID')>
<cf_FFID-Admin-Header pagetitle="SuperDeck Edit Listing">
<cfelse>
<cf_FFID-Admin-Header pagetitle="SuperDeck Add Listing">
</cfif>
<cf_FFID-Admin-Sidebar>
<!--- Page Title --->
<cfoutput>
<h2>SuperDeck <cfif IsDefined('URL.SuperDeckID')>Edit<cfelse>Add</cfif> Listing</h2>
</cfoutput>
<!--- Page Description --->
<p>Create or edit a Superdeck listing.</p>
<!--- BEGIN Content--->
<cfif IsDefined('status')>
<cfswitch expression="#status#">
<cfcase value="2"><p align="center"><font color="#ff0000"><b>Listing has been updated.</b></font><br/><a href="http://www.thefabricator.com/SuperDeck/Listing.cfm?SuperDeckID=<cfoutput>#FORM.SuperDeckID#</cfoutput>">View Live</a></p>
</cfcase>
<cfcase value="1"> <p align="center"><font color="#ff0000"><b>Listing has been removed.</b></font></p>
</cfcase>
<cfcase value="3"><p align="center"><font color="#ff0000"><b>Listing has been added.</b></font></p>
</cfcase>
</cfswitch>
</cfif>
<cfparam name="Listing.SuperdeckCategoryID" default="0">
<cfoutput>
<cfform action="Superdeck-Add.cfm" enctype="multipart/form-data">
<table cellpadding="3" cellspacing="0" width="600" border="0">
<td align="right"><b>Company:</b></td>
<td><select name="CompanyID">
<option value="INVALID"></option>
<cfloop query="Companies">
<option value="#Companies.CompanyID#"
<cfif IsDefined('Listing.CompanyID')>
<cfif Companies.CompanyID EQ Listing.CompanyID>
selected
</cfif>
</cfif>
>#Companies.CompanyName# - #Companies.CompanyID#</option>
</cfloop>
</select></td>
</tr>
<tr>
<td align="right"><b>Category:</b></b></td>
<td><select name="SuperdeckCategoryID">
<cfloop query="Categories">
<option value="#Categories.CategoryID#" <cfif Categories.CategoryID EQ Listing.SuperDeckCategoryID>selected</cfif>>#Categories.CategoryName#</option>
</cfloop>
</select>
</td>
</tr>
<tr>
<td align="right"><b>Title:</b></td>
<td>
<cfif IsDefined('Listing.SuperdeckTitle')>
<cfinput name="SuperdeckTitle" type="text" size="67" maxlength="255" required="yes" message="Please provide a Title to your ad." value="#Listing.SuperdeckTitle#">
<cfelse>
<cfinput name="SuperdeckTitle" type="text" size="67" maxlength="255" required="yes" message="Please provide a Title to your ad.">
</cfif></td>
</tr>
<tr>
<td valign="top" align="right"><b>Copy:</b><br />
<span class="body10pt"><i>150 words max.</i></span></td>
<td valign="top"><cfif IsDefined('Listing.SuperDeckText')>
<textarea name="SuperDeckText" id="SuperDeckText" required="yes" rows="6" cols="60"><cfoutput>#Listing.SuperDeckText#</cfoutput></textarea>
<script language="javascript1.2">
generate_wysiwyg('SuperDeckText');
</script>
<cfelse>
<textarea name="SuperDeckText" id="SuperDeckText" required="yes" rows="6" cols="60"></textarea>
<script language="javascript1.2">
generate_wysiwyg('SuperDeckText');
</script>
</cfif></td>
</tr>
<tr>
<td align="right"><b>Product Photo:</b></td>
<td><cfif IsDefined('Listing.SuperDeckImage') AND len(Listing.SuperDeckImage) GT 0>
<cfoutput><img src="http://www.thefabricator.com/SuperDeck/SuperDeckImages/#Listing.SuperDeckImage#"></cfoutput><br>
<input name="SuperDeckImage" type="file">
<cfelse>
<input name="SuperDeckImage" type="file">
</cfif></td>
</tr>
<tr>
<td align="right"><b>Live:</b></td>
<td><cfif IsDefined('Listing.Live')>
<cfif Listing.Live EQ 1>
<cfinput name="Live" type="radio" value="1" id="radio" checked> Yes<br/>
<cfinput name="Live" type="radio" value="0" id="radio"> No
<cfelse>
<cfinput name="Live" type="radio" value="1" id="radio"> Yes<br/>
<cfinput name="Live" type="radio" value="0" id="radio" checked> No
</cfif>
<cfelse>
<cfinput name="Live" type="radio" value="1" id="radio" checked> Yes<br/>
<cfinput name="Live" type="radio" value="0" id="radio"> No
</cfif></td>
</tr>
<tr>
<td align="right"><b>Expire Date:</b></td>
<td><cfif IsDefined('Listing.ExpireDate')>
<cfinput name="ExpireDate" type="text" required="yes" maxlength="255" size="10" value="#dateformat(Listing.ExpireDate,'short')#">
<cfelse>
<cfinput name="ExpireDate" type="text" required="yes" maxlength="255" size="10">
</cfif> <i>( M/D/YY format )</i></td>
</tr>
<tr><td colspan="2" class="subhead">Contact Information<hr></td></tr>
<tr>
<td align="right"><b>Company Name:</b></td>
<td><cfif IsDefined('Listing.ContactCompanyName')>
<cfinput name="ContactCompanyName" type="text" required="yes" maxlength="255" size="60" value="#Listing.ContactCompanyName#">
<cfelse>
<cfinput name="ContactCompanyName" type="text" required="yes" maxlength="255" size="60">
</cfif></td>
</tr>
<tr>
<td align="right"><b>Name:</b></td>
<td><cfif IsDefined('Listing.ContactName')>
<cfinput name="ContactName" type="text" required="yes" maxlength="255" size="50" value="#Listing.ContactName#">
<cfelse>
<cfinput name="ContactName" type="text" required="yes" maxlength="255" size="50">
</cfif></td>
</tr>
<tr>
<td align="right"><b>Phone:</b></td>
<td><cfif IsDefined('Listing.ContactPhone')>
<cfinput name="ContactPhone" type="text" required="yes" maxlength="255" size="20" value="#Listing.ContactPhone#">
<cfelse>
<cfinput name="ContactPhone" type="text" required="yes" maxlength="255" size="20">
</cfif></td>
</tr>
<tr>
<td align="right"><b>Email:</b></td>
<td><cfif IsDefined('Listing.ContactEmail')>
<cfinput name="ContactEmail" type="text" required="yes" maxlength="255" size="50" value="#Listing.ContactEmail#">
<cfelse>
<cfinput name="ContactEmail" type="text" required="yes" maxlength="255" size="50">
</cfif></td>
</tr>
<tr>
<td align="right"><b>Display URL:</b></td>
<td><cfif IsDefined('Listing.ContactDisplayURL')>
<cfinput name="ContactDisplayURL" type="text" required="yes" maxlength="255" size="60" value="#Listing.ContactDisplayURL#">
<cfelse>
<cfinput name="ContactDisplayURL" type="text" required="yes" maxlength="255" size="60">
</cfif></td>
</tr>
<tr>
<td align="right"><b>Actual URL:</b></td>
<td><cfif IsDefined('Listing.ContactActualURL')>
<cfinput name="ContactActualURL" type="text" required="yes" maxlength="255" size="60" value="#Listing.ContactActualURL#">
<cfelse>
<cfinput name="ContactActualURL" type="text" required="yes" maxlength="255" size="60">
</cfif></td>
</tr>
<tr>
<td align="right"> </td>
<td><cfif IsDefined('URL.SuperDeckID')>
<input type="Submit" name="act" value="Update Listing" id="submit"> <input type="Submit" name="act" value="Remove Listing" id="submit"><input type="hidden" name="SuperDeckID" value="#URL.SuperDeckID#" id="submit">
<cfelse>
<input type="Submit" name="act" id="submit" value="Add Listing">
</cfif></td>
</tr>
</table>
</cfform>
</cfoutput>
<!--- END Content--->
then i suspect the problem is actually in the superDeck.listing component
is this the source for Superdeck-Add.cfm? i hope.
ASKER
Yes.
Below is the source for the component...
-------------------------- ---------- ---------- ---------- ---------- --------
<cfcomponent displayName="Super Deck Component" hint="Grab the schools for FMAF">
      <cffunction name="getListings" displayName="Get All Super Deck" hint="Return all schools in the table" access="public" returnType="any" output="false">
<cfargument required="no" name="Expired">
<cfargument required="no" name="SuperDeckCategory">
<cfquery datasource="FCData" name="listing">
SELECT Â Â tSuperDeck.SuperDeckID, tSuperDeck.SuperDeckTitle, tSuperDeck.SuperDeckText, tSuperDeck.SuperDeckImage, tSuperDeck.ContactCompanyN ame,
           tSuperDeck.ContactPhone, tSuperDeck.ContactDisplayU RL, tSuperDeck.ContactActualUR L, tSuperDeck.ContactEmail, tSuperDeck.ContactName,
           tSuperDeck.TotalClicks, tSuperDeck.AddedDate, tSuperDeck.ExpireDate, tSuperDeck.Live, tSuperDeck.CompanyLogo,
           tSuperDeckCategories.Categ oryName, tSuperDeck.SuperDeckCatego ry, tSuperDeckCategories.Categ oryNameEsp , tIndDirCompanies.CompanyID ,
           tIndDirCompanies.CompanyNa me, tSuperDeckCategories.Categ oryID, tSuperDeck.SuperDeckCatego ryID
FROM Â Â Â Â tSuperDeck INNER JOIN
           tSuperDeckCategories ON tSuperDeck.SuperDeckCatego ryID = tSuperDeckCategories.Categ oryID LEFT OUTER JOIN
           tIndDirCompanies ON tSuperDeck.CompanyID = tIndDirCompanies.CompanyID
<cfif IsDefined('Arguments.Super DeckCatego ryName')>
WHERE Â SuperDeckCategoryName LIKE ('#Arguments.SuperDeckCate goryName#' )
</cfif>
<cfif IsDefined('ARGUMENTS.Expir ed')>
WHERE Â Â (ExpireDate <Â #createODBCDate(now())#)
</cfif>
<cfif IsDefined('ARGUMENTS.Curre nt')>
WHERE Â Â (Live = 1)
</cfif>
<cfif IsDefined('ARGUMENTS.Past' )>
WHERE Â Â (Live = 0)
</cfif>
ORDER BY CategoryName, SuperDeckTitle
</cfquery>
<cfreturn listing>
      </cffunction>
<cffunction name="getExpired" displayName="Get All Super Deck" hint="Return all schools in the table" access="public" returnType="any" output="false">
<cfquery datasource="FCData" name="listing">
SELECT Â Â tSuperDeck.SuperDeckID, tSuperDeck.SuperDeckTitle, tSuperDeck.SuperDeckText, tSuperDeck.SuperDeckImage, tSuperDeck.ContactCompanyN ame,
           tSuperDeck.ContactPhone, tSuperDeck.ContactDisplayU RL, tSuperDeck.ContactActualUR L, tSuperDeck.ContactEmail, tSuperDeck.ContactName,
           tSuperDeck.TotalClicks, tSuperDeck.AddedDate, tSuperDeck.ExpireDate, tSuperDeck.Live, tSuperDeck.CompanyLogo,
           tSuperDeckCategories.Categ oryName, tSuperDeck.SuperDeckCatego ry, tSuperDeckCategories.Categ oryNameEsp , tIndDirCompanies.CompanyID ,
           tIndDirCompanies.CompanyNa me, tSuperDeckCategories.Categ oryID, tSuperDeck.SuperDeckCatego ryID
FROM Â Â Â Â tSuperDeck INNER JOIN
           tSuperDeckCategories ON tSuperDeck.SuperDeckCatego ryID = tSuperDeckCategories.Categ oryID LEFT OUTER JOIN
           tIndDirCompanies ON tSuperDeck.CompanyID = tIndDirCompanies.CompanyID
WHERE Â Â (Live = 0)
ORDER BY tIndDirCompanies.CompanyNa me
</cfquery>
<cfreturn listing>
</cffunction>
     Â
<cffunction name="deleteListing" access="public" returnType="void" output="false" hint="Deletes a listing.">
      <cfargument name="SuperDeckID" type="numeric" required="true">
           <cfquery datasource="FCData">
           DELETE FROM tSuperDeck
           WHERE SuperDeckID = <cfqueryparam value="#arguments.SuperDec kID#" cfsqltype="CF_SQL_VARCHAR" maxlength="35">
           </cfquery>
      </cffunction>
          Â
<cffunction name="updateListing" access="public" returnType="void" output="false" hint="Updates a School.">
<cfargument name="SuperDeckID" type="numeric" required="true">
<cfargument name="SuperDeckTitle" type="string" required="true">
<cfargument name="SuperDeckText" type="string" required="false">
<cfargument name="SuperdeckCategoryID" type="string" required="false">
<cfargument name="Live" type="numeric" default="0">
<cfargument name="ExpireDate" type="string" required="false">
<cfargument name="CompanyID" type="numeric" default="" required="false">
  <cfargument name="ContactCompanyName" type="string" required="false">
  <cfargument name="ContactPhone" type="string" required="false">
  <cfargument name="ContactDisplayURL" type="string" required="false">
  <cfargument name="ContactActualURL" type="string" required="false">
  <cfargument name="ContactEmail" type="string" required="false">
  <cfargument name="ContactName" type="string" required="false">
  <cfargument name="SuperDeckImage" type="string" required="false" value="">
                      <cfif Arguments.SuperDeckImage NEQ "">
<cffile action="Upload" filefield="SuperDeckImage" destination="E:\Coldfusion 8\wwwroot\ SuperDeck\ Images" nameconflict="skip">
   Â
 <cfftp action = "open"
 username="*****"
 password="****"
 server="Publish7.Argos.net "
 connection = "images"
 passive="Yes"
 stopOnError = "Yes"
 timeout = "1200"
 retrycount="1">
Â
<cfftp  action="PUTFILE"
 connection = "images"
 passive="Yes"
 stopOnError = "Yes"
Localfile="E:\Coldfusion8\ wwwroot\Su perDeck\Im ages\#cffi le.serverf ile#" remotefile="/Laurie H. 009/fma8/wwwroot-theFabric ator/Super Deck/Super DeckImages /#cffile.s erverfile# " >
<cfftp  action = "close"
 connection = "images">  Â
               <cfset Image = cffile.serverfile>
      <cfelse>
               <cfset Image = "">
      </cfif>
      <cfquery datasource="FCData">
           UPDATE tSuperDeck SET
                 CompanyID = #CompanyID#,
                 ExpireDate = #createODBCdate(ExpireDate )#,
                 Live = #Live#,
                 SuperdeckCategoryID = #SuperdeckCategoryID#,
                 SuperDeckText = '#SuperDeckText#',
                 SuperDeckTitle = '#SuperDeckTitle#',
                            ContactCompanyName = '#Arguments.ContactCompany Name#',
                            ContactPhone = '#Arguments.ContactPhone#' ,
                            ContactDisplayURL = '#Arguments.ContactDisplay URL#',                Â
           <cfif Image NEQ "">SuperDeckImage = '#Image#',
           </cfif>
           ContactActualURL = '#Arguments.ContactActualU RL#',
                            ContactEmail = '#Arguments.ContactEmail#' ,
                            ContactName = '#Arguments.ContactName#'                Â
                Â
           WHERE SuperDeckID = #Arguments.SuperDeckID#
      </cfquery>
</cffunction>
     Â
<cffunction name="insertListing" access="public" returnType="void" output="false" hint="Inserts a School.">
<cfargument name="SuperDeckTitle" type="string" required="true">
<cfargument name="SuperDeckText" type="string" required="false">
<cfargument name="SuperDeckCategoryID" required="false">
<cfargument name="Live" type="numeric" default="0">
<cfargument name="ExpireDate" type="string" required="false">
<cfargument name="CompanyID" type="numeric" default="" required="false">
  <cfargument name="ContactCompanyName" type="string" required="false">
  <cfargument name="ContactPhone" type="string" required="false">
  <cfargument name="ContactDisplayURL" type="string" required="false">
  <cfargument name="ContactActualURL" type="string" required="false">
  <cfargument name="ContactEmail" type="string" required="false">
  <cfargument name="ContactName" type="string" required="false">
  <cfargument name="SuperDeckImage" type="string" required="false" value="">
      <cfargument name="CompanyLogo" type="string" required="false" value="">
     Â
                      <cfif Arguments.SuperDeckImage NEQ "">
        <cffile action="Upload" filefield="SuperDeckImage" destination="E:\Coldfusion 8\wwwroot\ SuperDeck\ Images" nameconflict="skip">
 <cfftp action = "open"
 username="****"
 password="*****"
 server="Publish7.Argos.net "
 connection = "images"
 passive="Yes"
 stopOnError = "Yes"
 timeout = "1200"
 retrycount="1">
<cfftp action="PUTFILE"
  connection = "images"
      passive="Yes"
 stopOnError = "Yes"
Localfile="E:\Coldfusion8\ wwwroot\Su perDeck\Im ages\#cffi le.serverf ile#" remotefile="/Laurie H. 009/wwwroot-theFabricator/ SuperDeck/ SuperDeckI mages/#cff ile.server file#" >
<cfftp  action = "close"
 connection = "images">  Â
                   <cfset Image = cffile.serverfile>
      <cfelse>
               <cfset Image = "">
      </cfif>
           <cfquery datasource="FCData">
           INSERT INTO tSuperDeck(
                 CompanyID,
                 ExpireDate,
                 AddedDate,
                 Live,
                 SuperDeckCategoryID,
                 SuperDeckText,
                 SuperDeckTitle,
                            ContactCompanyName,
                            ContactPhone,
                            ContactDisplayURL,
                            ContactActualURL,
                            ContactEmail,                Â
           <cfif Image NEQ "">                 SuperDeckImage,
           </cfif>
           ContactName,
                            TotalClicks                Â
           )
           VALUES
           (
                 #Arguments.CompanyID#,
                 #createODBCdate(Arguments. ExpireDate )#,
                 #createODBCdate(now())#,
                 #Arguments.Live#,
                 #Arguments.SuperDeckCatego ryID#,
                 '#Arguments.SuperDeckText# ',
                 '#Arguments.SuperDeckTitle #',
                            '#Arguments.ContactCompany Name#',
                            '#Arguments.ContactPhone#' ,
                            '#Arguments.ContactDisplay URL#',
                            '#Arguments.ContactActualU RL#',
                            '#Arguments.ContactEmail#' ,                Â
           <cfif Image NEQ "">                 '#Image#',
           </cfif>
                      '#Arguments.ContactName#',
                            0                Â
           )
           </cfquery>
           <cfquery datasource="FCData" name="checkListing">
           SELECT   CompanyID, SubcategoryID
           FROM     tIndDirCompanyCategory
           WHERE CompanyID = #Arguments.CompanyID# AND SubcategoryID = 637
           </cfquery>
          Â
           <cfif checkListing.RecordCount EQ 0>
           <cfquery datasource="FCData" name="insertListing">     Â
           INSERT INTO tIndDirCompanyCategory
    (
           CompanyID,
           SubcategoryID
           )
           VALUES
           (
           #Arguments.CompanyID#,
           637
           )
           </cfquery>
           </cfif>
          Â
      </cffunction>
     Â
<cffunction name="getOneListing" displayName="Get only one school" hint="Return all schools in the table" access="public" returnType="any" output="false">
<cfargument required="no" name="SuperDeckID" type="string">
<cfquery datasource="FCData" name="listing">
SELECT Â Â tSuperDeck.SuperDeckID, tSuperDeck.CompanyID, tSuperDeck.SuperDeckTitle, tSuperDeck.SuperDeckText, tSuperDeck.SuperDeckImage,
           tSuperDeck.ContactCompanyN ame, tSuperDeck.ContactPhone, tSuperDeck.ContactDisplayU RL, tSuperDeck.ContactActualUR L,
           tSuperDeck.ContactEmail, tSuperDeck.ContactName, tSuperDeck.TotalClicks, tSuperDeck.AddedDate, tSuperDeck.ExpireDate, tSuperDeck.Live,
           tSuperDeck.CompanyLogo, tSuperDeckCategories.Categ oryName, tSuperDeck.SuperDeckCatego ry,  tSuperDeck.SuperDeckCatego ryID
FROM Â Â Â Â tSuperDeck INNER JOIN
           tSuperDeckCategories ON tSuperDeck.SuperDeckCatego ryID = tSuperDeckCategories.Categ oryID
<cfif IsDefined('Arguments.Super DeckID')>
WHERE Â SuperDeckID = ('#Arguments.SuperDeckID#' )
</cfif>
</cfquery>
           <cfreturn listing>
      </cffunction>
     Â
<cffunction name="getFFIDcompanies" displayName="Get either all FFID companies or just one." hint="Return all FFID companies." access="public" returnType="any" output="false">
<cfargument required="no" name="CompanyID" type="string">
<cfquery datasource="FCData" name="companies">
SELECT Â Â CompanyID, CompanyName
FROM Â Â Â Â tIndDirCompanies
<cfif IsDefined('Arguments.Compa nyID')>
WHERE Â CompanyID = ('#Arguments.CompanyID#')
<cfelse>
</cfif>
ORDER BY CompanyName     Â
</cfquery>
           <cfreturn companies>
      </cffunction>
     Â
<cffunction name="updateStatus" access="public" returnType="void" output="false" hint="Updates a School.">
<cfargument name="SuperDeckID" type="numeric" required="true">
<cfargument name="Live" type="numeric" default="">
      <cfquery datasource="FCData">
           UPDATE tSuperDeck SET
                 Live = #Arguments.Live#
           WHERE SuperDeckID = #Arguments.SuperDeckID#
      </cfquery>
</cffunction> Â Â Â Â Â
     Â
      <cffunction name="getCurrentClicks" access="public" returnType="any" output="false" hint="Updates a School.">
      <cfquery datasource="FCData" name="getCurrentClicks">
SELECT Â Â tIndDirCompanies.CompanyNa me, tSuperDeck.SuperDeckCatego ry, tSuperDeck.SuperDeckTitle, tSuperDeck.TotalClicks
FROM Â Â Â Â tSuperDeck LEFT OUTER JOIN
           tIndDirCompanies ON tSuperDeck.CompanyID = tIndDirCompanies.CompanyID
WHERE Â Â (tSuperDeck.Live = 1)
ORDER BY tIndDirCompanies.CompanyNa me, tSuperDeck.SuperDeckTitle
           </cfquery>
           <cfreturn getCurrentClicks>
</cffunction> Â Â Â Â Â
     Â
<cffunction name="getSummary" access="public" returnType="any" output="false" hint="Updates a School.">
<cfargument name="Sort" required="Yes">
<cfquery datasource="FCData" name="getSummary">
SELECT Â Â tIndDirCompanies.CompanyNa me, tSuperDeck.SuperDeckCatego ry, tSuperDeck.SuperDeckTitle, tSuperDeck.TotalClicks
FROM Â Â Â Â tSuperDeck LEFT OUTER JOIN
           tIndDirCompanies ON tSuperDeck.CompanyID = tIndDirCompanies.CompanyID
WHERE Â Â (tSuperDeck.Live = 1)
ORDER BY tIndDirCompanies.CompanyNa me, tSuperDeck.SuperDeckTitle      Â
ORDER BY #ARGUMENTS.Sort# ASC
           </cfquery>
           <cfreturn getSummary>
</cffunction> Â Â Â Â Â
<cffunction name="getCategories" access="public" returnType="any" output="false">
<cfargument name="CategoryID" default="0">
<cfquery datasource="FCData" name="getCategories">
SELECT Â Â CategoryNameEsp, CategoryName, CategoryID
FROM Â Â Â Â tSuperDeckCategories
<cfif ARGUMENTS.CategoryID NEQ 0>
WHERE CategoryID = #ARGUMENTS.CategoryID#
</cfif>
ORDER BY CategoryName
</cfquery>
           <cfreturn getCategories>
</cffunction>
     Â
</cfcomponent>
Below is the source for the component...
--------------------------
<cfcomponent displayName="Super Deck Component" hint="Grab the schools for FMAF">
      <cffunction name="getListings" displayName="Get All Super Deck" hint="Return all schools in the table" access="public" returnType="any" output="false">
<cfargument required="no" name="Expired">
<cfargument required="no" name="SuperDeckCategory">
<cfquery datasource="FCData" name="listing">
SELECT Â Â tSuperDeck.SuperDeckID, tSuperDeck.SuperDeckTitle,
           tSuperDeck.ContactPhone, tSuperDeck.ContactDisplayU
           tSuperDeck.TotalClicks, tSuperDeck.AddedDate, tSuperDeck.ExpireDate, tSuperDeck.Live, tSuperDeck.CompanyLogo,
           tSuperDeckCategories.Categ
           tIndDirCompanies.CompanyNa
FROM Â Â Â Â tSuperDeck INNER JOIN
           tSuperDeckCategories ON tSuperDeck.SuperDeckCatego
           tIndDirCompanies ON tSuperDeck.CompanyID = tIndDirCompanies.CompanyID
<cfif IsDefined('Arguments.Super
WHERE Â SuperDeckCategoryName LIKE ('#Arguments.SuperDeckCate
</cfif>
<cfif IsDefined('ARGUMENTS.Expir
WHERE Â Â (ExpireDate <Â #createODBCDate(now())#)
</cfif>
<cfif IsDefined('ARGUMENTS.Curre
WHERE Â Â (Live = 1)
</cfif>
<cfif IsDefined('ARGUMENTS.Past'
WHERE Â Â (Live = 0)
</cfif>
ORDER BY CategoryName, SuperDeckTitle
</cfquery>
<cfreturn listing>
      </cffunction>
<cffunction name="getExpired" displayName="Get All Super Deck" hint="Return all schools in the table" access="public" returnType="any" output="false">
<cfquery datasource="FCData" name="listing">
SELECT Â Â tSuperDeck.SuperDeckID, tSuperDeck.SuperDeckTitle,
           tSuperDeck.ContactPhone, tSuperDeck.ContactDisplayU
           tSuperDeck.TotalClicks, tSuperDeck.AddedDate, tSuperDeck.ExpireDate, tSuperDeck.Live, tSuperDeck.CompanyLogo,
           tSuperDeckCategories.Categ
           tIndDirCompanies.CompanyNa
FROM Â Â Â Â tSuperDeck INNER JOIN
           tSuperDeckCategories ON tSuperDeck.SuperDeckCatego
           tIndDirCompanies ON tSuperDeck.CompanyID = tIndDirCompanies.CompanyID
WHERE Â Â (Live = 0)
ORDER BY tIndDirCompanies.CompanyNa
</cfquery>
<cfreturn listing>
</cffunction>
     Â
<cffunction name="deleteListing" access="public" returnType="void" output="false" hint="Deletes a listing.">
      <cfargument name="SuperDeckID" type="numeric" required="true">
           <cfquery datasource="FCData">
           DELETE FROM tSuperDeck
           WHERE SuperDeckID = <cfqueryparam value="#arguments.SuperDec
           </cfquery>
      </cffunction>
          Â
<cffunction name="updateListing" access="public" returnType="void" output="false" hint="Updates a School.">
<cfargument name="SuperDeckID" type="numeric" required="true">
<cfargument name="SuperDeckTitle" type="string" required="true">
<cfargument name="SuperDeckText" type="string" required="false">
<cfargument name="SuperdeckCategoryID"
<cfargument name="Live" type="numeric" default="0">
<cfargument name="ExpireDate" type="string" required="false">
<cfargument name="CompanyID" type="numeric" default="" required="false">
  <cfargument name="ContactCompanyName" type="string" required="false">
  <cfargument name="ContactPhone" type="string" required="false">
  <cfargument name="ContactDisplayURL" type="string" required="false">
  <cfargument name="ContactActualURL" type="string" required="false">
  <cfargument name="ContactEmail" type="string" required="false">
  <cfargument name="ContactName" type="string" required="false">
  <cfargument name="SuperDeckImage" type="string" required="false" value="">
                      <cfif Arguments.SuperDeckImage NEQ "">
<cffile action="Upload" filefield="SuperDeckImage"
   Â
 <cfftp action = "open"
 username="*****"
 password="****"
 server="Publish7.Argos.net
 connection = "images"
 passive="Yes"
 stopOnError = "Yes"
 timeout = "1200"
 retrycount="1">
Â
<cfftp  action="PUTFILE"
 connection = "images"
 passive="Yes"
 stopOnError = "Yes"
Localfile="E:\Coldfusion8\
<cfftp  action = "close"
 connection = "images">  Â
               <cfset Image = cffile.serverfile>
      <cfelse>
               <cfset Image = "">
      </cfif>
      <cfquery datasource="FCData">
           UPDATE tSuperDeck SET
                 CompanyID = #CompanyID#,
                 ExpireDate = #createODBCdate(ExpireDate
                 Live = #Live#,
                 SuperdeckCategoryID = #SuperdeckCategoryID#,
                 SuperDeckText = '#SuperDeckText#',
                 SuperDeckTitle = '#SuperDeckTitle#',
                            ContactCompanyName = '#Arguments.ContactCompany
                            ContactPhone = '#Arguments.ContactPhone#'
                            ContactDisplayURL = '#Arguments.ContactDisplay
           <cfif Image NEQ "">SuperDeckImage = '#Image#',
           </cfif>
           ContactActualURL = '#Arguments.ContactActualU
                            ContactEmail = '#Arguments.ContactEmail#'
                            ContactName = '#Arguments.ContactName#'                Â
                Â
           WHERE SuperDeckID = #Arguments.SuperDeckID#
      </cfquery>
</cffunction>
     Â
<cffunction name="insertListing" access="public" returnType="void" output="false" hint="Inserts a School.">
<cfargument name="SuperDeckTitle" type="string" required="true">
<cfargument name="SuperDeckText" type="string" required="false">
<cfargument name="SuperDeckCategoryID"
<cfargument name="Live" type="numeric" default="0">
<cfargument name="ExpireDate" type="string" required="false">
<cfargument name="CompanyID" type="numeric" default="" required="false">
  <cfargument name="ContactCompanyName" type="string" required="false">
  <cfargument name="ContactPhone" type="string" required="false">
  <cfargument name="ContactDisplayURL" type="string" required="false">
  <cfargument name="ContactActualURL" type="string" required="false">
  <cfargument name="ContactEmail" type="string" required="false">
  <cfargument name="ContactName" type="string" required="false">
  <cfargument name="SuperDeckImage" type="string" required="false" value="">
      <cfargument name="CompanyLogo" type="string" required="false" value="">
     Â
                      <cfif Arguments.SuperDeckImage NEQ "">
        <cffile action="Upload" filefield="SuperDeckImage"
 <cfftp action = "open"
 username="****"
 password="*****"
 server="Publish7.Argos.net
 connection = "images"
 passive="Yes"
 stopOnError = "Yes"
 timeout = "1200"
 retrycount="1">
<cfftp action="PUTFILE"
  connection = "images"
      passive="Yes"
 stopOnError = "Yes"
Localfile="E:\Coldfusion8\
<cfftp  action = "close"
 connection = "images">  Â
                   <cfset Image = cffile.serverfile>
      <cfelse>
               <cfset Image = "">
      </cfif>
           <cfquery datasource="FCData">
           INSERT INTO tSuperDeck(
                 CompanyID,
                 ExpireDate,
                 AddedDate,
                 Live,
                 SuperDeckCategoryID,
                 SuperDeckText,
                 SuperDeckTitle,
                            ContactCompanyName,
                            ContactPhone,
                            ContactDisplayURL,
                            ContactActualURL,
                            ContactEmail,                Â
           <cfif Image NEQ "">                 SuperDeckImage,
           </cfif>
           ContactName,
                            TotalClicks                Â
           )
           VALUES
           (
                 #Arguments.CompanyID#,
                 #createODBCdate(Arguments.
                 #createODBCdate(now())#,
                 #Arguments.Live#,
                 #Arguments.SuperDeckCatego
                 '#Arguments.SuperDeckText#
                 '#Arguments.SuperDeckTitle
                            '#Arguments.ContactCompany
                            '#Arguments.ContactPhone#'
                            '#Arguments.ContactDisplay
                            '#Arguments.ContactActualU
                            '#Arguments.ContactEmail#'
           <cfif Image NEQ "">                 '#Image#',
           </cfif>
                      '#Arguments.ContactName#',
                            0                Â
           )
           </cfquery>
           <cfquery datasource="FCData" name="checkListing">
           SELECT   CompanyID, SubcategoryID
           FROM     tIndDirCompanyCategory
           WHERE CompanyID = #Arguments.CompanyID# AND SubcategoryID = 637
           </cfquery>
          Â
           <cfif checkListing.RecordCount EQ 0>
           <cfquery datasource="FCData" name="insertListing">     Â
           INSERT INTO tIndDirCompanyCategory
    (
           CompanyID,
           SubcategoryID
           )
           VALUES
           (
           #Arguments.CompanyID#,
           637
           )
           </cfquery>
           </cfif>
          Â
      </cffunction>
     Â
<cffunction name="getOneListing" displayName="Get only one school" hint="Return all schools in the table" access="public" returnType="any" output="false">
<cfargument required="no" name="SuperDeckID" type="string">
<cfquery datasource="FCData" name="listing">
SELECT Â Â tSuperDeck.SuperDeckID, tSuperDeck.CompanyID, tSuperDeck.SuperDeckTitle,
           tSuperDeck.ContactCompanyN
           tSuperDeck.ContactEmail, tSuperDeck.ContactName, tSuperDeck.TotalClicks, tSuperDeck.AddedDate, tSuperDeck.ExpireDate, tSuperDeck.Live,
           tSuperDeck.CompanyLogo, tSuperDeckCategories.Categ
FROM Â Â Â Â tSuperDeck INNER JOIN
           tSuperDeckCategories ON tSuperDeck.SuperDeckCatego
<cfif IsDefined('Arguments.Super
WHERE Â SuperDeckID = ('#Arguments.SuperDeckID#'
</cfif>
</cfquery>
           <cfreturn listing>
      </cffunction>
     Â
<cffunction name="getFFIDcompanies" displayName="Get either all FFID companies or just one." hint="Return all FFID companies." access="public" returnType="any" output="false">
<cfargument required="no" name="CompanyID" type="string">
<cfquery datasource="FCData" name="companies">
SELECT Â Â CompanyID, CompanyName
FROM Â Â Â Â tIndDirCompanies
<cfif IsDefined('Arguments.Compa
WHERE Â CompanyID = ('#Arguments.CompanyID#')
<cfelse>
</cfif>
ORDER BY CompanyName     Â
</cfquery>
           <cfreturn companies>
      </cffunction>
     Â
<cffunction name="updateStatus" access="public" returnType="void" output="false" hint="Updates a School.">
<cfargument name="SuperDeckID" type="numeric" required="true">
<cfargument name="Live" type="numeric" default="">
      <cfquery datasource="FCData">
           UPDATE tSuperDeck SET
                 Live = #Arguments.Live#
           WHERE SuperDeckID = #Arguments.SuperDeckID#
      </cfquery>
</cffunction> Â Â Â Â Â
     Â
      <cffunction name="getCurrentClicks" access="public" returnType="any" output="false" hint="Updates a School.">
      <cfquery datasource="FCData" name="getCurrentClicks">
SELECT Â Â tIndDirCompanies.CompanyNa
FROM Â Â Â Â tSuperDeck LEFT OUTER JOIN
           tIndDirCompanies ON tSuperDeck.CompanyID = tIndDirCompanies.CompanyID
WHERE Â Â (tSuperDeck.Live = 1)
ORDER BY tIndDirCompanies.CompanyNa
           </cfquery>
           <cfreturn getCurrentClicks>
</cffunction> Â Â Â Â Â
     Â
<cffunction name="getSummary" access="public" returnType="any" output="false" hint="Updates a School.">
<cfargument name="Sort" required="Yes">
<cfquery datasource="FCData" name="getSummary">
SELECT Â Â tIndDirCompanies.CompanyNa
FROM Â Â Â Â tSuperDeck LEFT OUTER JOIN
           tIndDirCompanies ON tSuperDeck.CompanyID = tIndDirCompanies.CompanyID
WHERE Â Â (tSuperDeck.Live = 1)
ORDER BY tIndDirCompanies.CompanyNa
ORDER BY #ARGUMENTS.Sort# ASC
           </cfquery>
           <cfreturn getSummary>
</cffunction> Â Â Â Â Â
<cffunction name="getCategories" access="public" returnType="any" output="false">
<cfargument name="CategoryID" default="0">
<cfquery datasource="FCData" name="getCategories">
SELECT Â Â CategoryNameEsp, CategoryName, CategoryID
FROM Â Â Â Â tSuperDeckCategories
<cfif ARGUMENTS.CategoryID NEQ 0>
WHERE CategoryID = #ARGUMENTS.CategoryID#
</cfif>
ORDER BY CategoryName
</cfquery>
           <cfreturn getCategories>
</cffunction>
     Â
</cfcomponent>
ASKER
I also have a question in the Superdeck-Add.cfm form. Â You have
<cfparam name="form.act" default="">
<cfif form.act is "Add Listing">
Where is "Add Listing" being set ?
<cfparam name="form.act" default="">
<cfif form.act is "Add Listing">
Where is "Add Listing" being set ?
ASKER
rob_lorentz:
I apologize my browser must have been cached your code is working.
I do still have the question about
<cfparam name="form.act" default="">
<cfif form.act is "Add Listing">
Where is "Add Listing" being set ?
I am just trying to understand how that is set....
I apologize my browser must have been cached your code is working.
I do still have the question about
<cfparam name="form.act" default="">
<cfif form.act is "Add Listing">
Where is "Add Listing" being set ?
I am just trying to understand how that is set....