Link to home
Start Free TrialLog in
Avatar of AaronDitto
AaronDitto

asked on

Mulitple URL Variables in CFWINDOW - Destroy / Create

I have a page with a normal HTML table that has a CFLOOP populating it. I am needing to pass two URL variables through to a CFWINDOW which has another CFLOOP on it that is conditional based off the variables that are passed. Below is a snippet. I have it now where it is at least populating the CFWINDOW, but only with the first record, and it doesn't matter which link you click on as it always uses the first record, as opposed to the record ID of the link you click on.

I have to be able to pass both a project_id variable (which is already being passed through the URL) and a type= variable which is pulled from the ServicesQuery

Any and all help would be much appreciated.


<!--- Begin Sales & Services Scheduled Table ---->
 
<table width="945"> 
<tr bgcolor="#edeeef">
<td><font size="2"><b>Service</b></font></td>
<td><font size="2"><b>Number Of</b></font></td>
<td><font size="2"><b>Amount Per</b></font></td>
<td><font size="2"><b>Amount Total</b></font></td>
<td><font size="2"><b>Date(s) of Service</b></font></td>
<td><font size="2"><b>Consultant</a></b></font></td>
<td><font size="2"><b>SLA Signed?</a></b></font></td>
<td><font size="2"><b>Comments</b></font></td>
<td><font size="2"><center><b>Edit / Delete</b></center></font></td>
</tr>
 
<cfset dark=false>
<cfloop query="ServicesQuery">
<cfquery datasource="#application.dsn#" name="getics">
		select emplid as icid, lastName, firstName, 'Staff' as status 
		from Employee
		where (emplid = '2' or emplid = '18' or emplid = '26' or emplid = '139' or emplid = '140')
		and status <> 'T'
		UNION
		select icid, lastName, firstName, 'IC' as status 
		from independentContractor
		where status = 'A'
order by lastname, firstname
</cfquery>
<tr <cfif dark is true>bgcolor="#edeeef"</cfif><cfoutput>>
 
<td>#ServicesQuery.service#</td>
<td>#ServicesQuery.num_days#</td>
<td>#NumberFormat(ServicesQuery.amount_per,'$_,____.__')#</td>
<td>#NumberFormat(ServicesQuery.charge,'$_,____.__')#</td>
<td>#dateformat(ServicesQuery.sched_date,"mm/dd/yy")# - #dateformat(ServicesQuery.endsched_date,"mm/dd/yy")#</td>
	<cfif ServicesQuery.employee_id gt 0>
	<cfquery datasource="#application.dsn#" name="getempname2">
	select firstname, lastname
	from employee
	where emplid = #ServicesQuery.employee_id#
	</cfquery>
	<td>#getempname2.firstname# #getempname2.lastname#</td>
	<cfelseif ServicesQuery.ic_id is 2 or ServicesQuery.ic_id is 18 or ServicesQuery.ic_id is 26 or ServicesQuery.ic_id is 139 or ServicesQuery.ic_id is 140>
	<cfquery datasource="#application.dsn#" name="getempname">
	select firstname, lastname
	from employee
	where emplid = #ServicesQuery.ic_id#
	</cfquery>
	<td>#getempname.firstname# #getempname.lastname#</td>
	<cfelse>
	<cfquery datasource="#application.dsn#" name="geticname">
	select firstname, lastname
	from independentcontractor
	where icid = '#ServicesQuery.ic_id#'
	</cfquery>
	<td>#geticname.firstname# #geticname.lastname#</td>
	</cfif>
<td>#ServicesQuery.sla_signed#</td>
 
<td><a href="##" onclick="javascript:ColdFusion.Window.show('servicesComments')">Comments</a></td>
 
<td><center><a href=""><img src="edit.gif" border="0" /></a>&nbsp;/&nbsp;<a href=""><img src="delete.gif" border="0" /></a></center></td>
</tr>
</cfoutput>
<cfif dark is true><cfset dark=false><cfelse><cfset dark=true></cfif>
 
</cfloop>
</table>
 
<cfwindow x="210" y="100" width="675" height="550" name="servicesComments" 
        refreshOnShow="true" modal="true" minHeight="550" minWidth="675" 
        title="Sales & Services Comment" initshow="false"
        source="servicescomments.cfm?project_id=#project_id#&type=#ServicesQuery.type#" />
		
<!---- Begin Sales & Services Input Form ---->
<cfform height="700" width="950" format="flash" skin="haloblue" name="salesandservices" wMode="transparent" method="post">
 
<cfformgroup type="panel" label="HR Solutions - Sales & Services Scheduling" style="color:##000000; fontSize:10; text-align: Left;">
 
<cfformgroup type="horizontal">
  	<cfselect name="type" width="175" label="     Service:"  tooltip="Please Select a Service" >        
<option value="" selected>Select a Service</option>
<cfif survey is 'eos'><option value="mk">Management Kickoff</option></cfif>
<cfif survey is 'eos' or survey is 'apulse' or survey is 'exit'><option value="sp">Survey Processing</option></cfif>
<cfif survey is 'eos' or survey is 'apulse' or survey is 'exit'><option value="projm">Project Maintenance</option></cfif>
<cfif survey is 'eos' or survey is 'apulse' or survey is 'exit'><option value="trans">Translations</option></cfif>
<cfif survey is 'eos' or survey is 'exit'><option value="sa">Survey Administration</option></cfif>
<cfif survey is 'eos' or survey is 'apulse' or survey is 'exit'><option value="bre">BRE's</option></cfif>
<cfif survey is 'eos' or survey is 'apulse' or survey is 'exit'><option value="packp">Package Preps</option></cfif>
<cfif survey is 'exit'><option value="phone">Phone Interviews</option></cfif>
<cfif survey is 'eos' or survey is 'exit'><option value="ac">Analysis</option></cfif>
<cfif survey is 'eos' or survey is 'apulse' or survey is 'exit'><option value="hd">History Data</option></cfif>
<cfif survey is 'eos' or survey is 'apulse' or survey is 'exit'><option value="rmfee">Report Modification Fee</option></cfif>
<cfif survey is 'eos' or survey is 'apulse' or survey is 'exit'><option value="cr">Customized Reports</option></cfif>
<cfif survey is 'eos' or survey is 'apulse' or survey is 'exit'><option value="apreport">ActionPro Reporting</option></cfif>
<cfif survey is 'eos' or survey is 'exit'><option value="ip">Initial Presentation</option></cfif>
<cfif survey is 'eos'><option value="f">Feedback</option></cfif>
<cfif survey is 'eos' or survey is 'exit'><option value="fr">Final Report</option></cfif>
<cfif survey is 'eos' or survey is 'exit'><option value="fp">Final Presentation</option></cfif>
<cfif survey is 'eos'><option value="aproap">ActionPro Action Planning</option></cfif>
<cfif survey is 'eos'><option value="aprot">ActionPro Training</option></cfif>
<cfif survey is 'eos'><option value="aplant">Action Plan Training</option></cfif>
<cfif survey is 'eos' or survey is 'apulse'><option value="aconday">Apulse Consulting Day</option></cfif>
</cfselect>
	<cfinput name="num_days" size="6" type="text" label="Number Of:" tooltip="Please Enter Number of Days or Services" required="Yes" message="Number of Services/Days is Required" />        
    <cfinput name="amount_per" size="6" type="text" label="Amount Per:" tooltip="Please Enter Amount Per Day or Service" required="Yes" message="Amount Per Service/Day is Required"  />        
	<cfinput name="charge" size="6" type="text" label="Amount Total:" tooltip="Totals Automatically" required="Yes" message="Amount Total is Required" bind="{(num_days.text * 1) * (amount_per.text * 1)}" readonly/>        
</cfformgroup>  
 
<cfformgroup type="horizontal">
   	
	<cfselect name="icid" width="175" label="Consultant:"  tooltip="Please add a Consultant" >        
              <cfoutput>
			  <option value="">Select a Consultant</option>     
			  <cfloop query="getics">
 			  <option value="#getics.icid#">#getics.lastname#, #getics.firstname#</option>
			  </cfloop>
			  </cfoutput>
</cfselect>
 
<cfinput label="Start Date:" type="DateField" name="sched_date" width="150"  tooltip="Please Enter a Start Date">
<cfinput label="End Date:" type="DateField" name="endsched_date" width="150"  tooltip="Please Enter an End Date (optional)">
<cfinput label="SLA Signed?" type="checkbox" name="sla" tooltip="Check for Yes">
</cfformgroup>
 
 
<cfformgroup type="panel" label="Comments:"  style="color:##000000; fontSize:12; text-align: Left;">
 
<cftextarea name="comments" rows="12"/>
</cfformgroup>
<cfformgroup type="horizontal">
</cfformgroup>
<cfformgroup type="horizontal">
</cfformgroup>
	<cfformgroup type="horizontal">
        <cfinput name="submit" value="Submit" type="submit" label="Submit" />            
        <cfinput name="reset" value="Reset Form" type="reset" label="Reset Form" />
    </cfformgroup>
		
</cfformgroup>
 
</cfform>

Open in new window

Avatar of AaronDitto
AaronDitto

ASKER

Attached is the query - and lines 60 and 70-73 are the window popup.
<cfquery datasource="#application.dsn#" name="ServicesQuery">
		SELECT *
		FROM project_services
		INNER JOIN project_services_type on project_services.type=project_services_type.service_type
		where project_id = #project_id#
		order by service_order asc
</cfquery>

Open in new window

I'm also needing to know how to have the CFWINDOW destroy the last contents, and refresh with the new contents from a different link (ID)
ASKER CERTIFIED SOLUTION
Avatar of AaronDitto
AaronDitto

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial