<cfsetting enablecfoutputonly=true>
<!---
	Name         : handlers/truefalse/stats.cfm
	Author       : Raymond Camden 
	Created      : September 21, 2004
	Last Updated : March 30, 2006
	History      : tableprefix fix (rkc 3/30/06)
	Purpose		 : Supports True/False, Yes/No
--->

<cfparam name="attributes.questionidfk">
<cfparam name="attributes.r_data" type="variablename">

<cfset data = structNew()>

<cfquery name="totalTrue" datasource="#application.settings.dsn#">
	select	count(truefalse) as totalTrue
	from	#application.settings.tableprefix#results
	where	questionidfk = <cfqueryparam cfsqltype="CF_SQL_VARCHAR" maxlength="35" value="#attributes.questionidfk#">
	and		truefalse = 1
</cfquery>
<cfquery name="totalFalse" datasource="#application.settings.dsn#">
	select	count(truefalse) as totalFalse
	from	#application.settings.tableprefix#results
	where	questionidfk = <cfqueryparam cfsqltype="CF_SQL_VARCHAR" maxlength="35" value="#attributes.questionidfk#">
	and		truefalse = 0
</cfquery>

<cfset data.true = totalTrue.totalTrue>
<cfset data.false = totalFalse.totalFalse>

<cfset caller[attributes.r_data] = data>				
<cfsetting enablecfoutputonly=false>

<cfexit method="exittag">