Quantcast
Channel: Adobe Community: Message List - ColdFusion
Viewing all articles
Browse latest Browse all 21760

How do I get a button to show in a list only when a survey is filled?

$
0
0

I am using cf9 with mySQl 5+. I have two tables:

  1. Signups -  where people signup to take a course.
  2. Course_eval – once the course is completed, the student fills in the course evaluation

 

I use an inner join on userID in both tables.

 

I have a page, showsignups.cfm, that lists all of the students by course. Once a student finishes the survey, a button will show up next to the student in the showsignups.cfm page where it can be clicked on to show the survey by the individual student.

 

My problem is instead of showing all students with or without the survey buttons, it only shows the students who have finished the survey. It should show:

 

Student’s name | survey button

Student’s name |

Student’s name | survey button

Student's name |

 

I thought using a cfloop through the students would give me the effect I want, but alas, no. Here is the code I am using for the cfquery:

 

<cfquery name="getsignups" datasource="#application.dsn#">

select signups.courseTitle,signups.property,signups.calendardate,signups.com pany,signups.firstname,signups.lastname,signups.email,signups.phone,si gnups.userID,signups.signup_id,signups.rid,course_eval.userID,course_e val.id

from signups INNER JOIN course_eval ONsignups.userID = course_eval.userID

where signups.rid = #rid#

</cfquery>

 

(Rid is the courseID)

 

Here is the output I am using:

 

<cfoutput>

<cfloop query="getsignups">

<tr>

<td>#rid# - #firstname# #lastname#  |   <a href="mailto:#email#">#email#</a></td><td>Ph: #phone#</td>

<td width="24"><a href="showsignups.cfm?signup_id=#signup_id#&go=go" class="button">Remove</a></td>

<cfif isdefined("id")>

<td width="24"><a href="../../forms/surveys.cfm?userID=#userID#" class="button">Survey</a></td>

</cfif>

</tr>

</cfloop>           

</cfoutput>

 

I know this is a long post, but I wanted to make sure any body who reads this understands what I am trying to accomplish. Any ideas on what I am doing wrong?


Viewing all articles
Browse latest Browse all 21760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>