root/trunk/website/soundings/handlers/truefalse/stats.cfm @ 42

Revision 5, 1.2 kB (checked in by DanWilson, 17 years ago)

Initial Commit Of ModelGlue? Website (upgrade to blogcfc 511)

Line 
1<cfsetting enablecfoutputonly=true>
2<!---
3        Name         : handlers/truefalse/stats.cfm
4        Author       : Raymond Camden
5        Created      : September 21, 2004
6        Last Updated : March 30, 2006
7        History      : tableprefix fix (rkc 3/30/06)
8        Purpose          : Supports True/False, Yes/No
9--->
10
11<cfparam name="attributes.questionidfk">
12<cfparam name="attributes.r_data" type="variablename">
13
14<cfset data = structNew()>
15
16<cfquery name="totalTrue" datasource="#application.settings.dsn#">
17        select  count(truefalse) as totalTrue
18        from    #application.settings.tableprefix#results
19        where   questionidfk = <cfqueryparam cfsqltype="CF_SQL_VARCHAR" maxlength="35" value="#attributes.questionidfk#">
20        and             truefalse = 1
21</cfquery>
22<cfquery name="totalFalse" datasource="#application.settings.dsn#">
23        select  count(truefalse) as totalFalse
24        from    #application.settings.tableprefix#results
25        where   questionidfk = <cfqueryparam cfsqltype="CF_SQL_VARCHAR" maxlength="35" value="#attributes.questionidfk#">
26        and             truefalse = 0
27</cfquery>
28
29<cfset data.true = totalTrue.totalTrue>
30<cfset data.false = totalFalse.totalFalse>
31
32<cfset caller[attributes.r_data] = data>                                
33<cfsetting enablecfoutputonly=false>
34
35<cfexit method="exittag">
Note: See TracBrowser for help on using the browser.