Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
92 lines (77 sloc) 2.12 KB
<cfsetting enablecfoutputonly=true>
<!---
Name : textviewer.cfm
Author : Raymond Camden
Created : September 16, 2004
Last Updated : September 16, 2004
History :
Purpose :
--->
<cfimport taglib="../tags/" prefix="tags">
<cfif not isDefined("url.questionidfk")>
<cfabort>
</cfif>
<cfset question = application.question.getQuestion(url.questionidfk)>
<cfset qt = application.questiontype.getQuestionType(question.questiontypeidfk)>
<cfmodule template="../handlers/#qt.handlerRoot#/stats.cfm"
questionidfk="#url.questionidfk#"
r_data="data"
/>
<cfparam name="url.start" default="1">
<cfset perpage = 20>
<tags:layout templatename="plain" title="Text Answers">
<cfif question.questiontype is "Attachment">
<cfoutput>
<h2>Attachments for #question.question#</h2>
</cfoutput>
<cfelse>
<cfoutput>
<h2>Text Answers for #question.question#</h2>
</cfoutput>
</cfif>
<cfif data.recordCount is 0>
<cfoutput>
<p>
There are no results for this answer.
</p>
</cfoutput>
<cfelse>
<cfif data.recordCount gt perpage>
<cfoutput>
<p align="right">
</cfoutput>
<cfif url.start gt 1>
<cfoutput>
<a href="textviewer.cfm?questionidfk=#url.questionidfk#&start=#url.start-perpage#">Previous</a>
</cfoutput>
</cfif>
<cfif (url.start + perpage - 1) lt data.recordCount>
<cfoutput>
<a href="textviewer.cfm?questionidfk=#url.questionidfk#&start=#url.start+perpage#">Next</a>
</cfoutput>
</cfif>
</cfif>
<cfoutput>
<p>
<table width="100%" border="1">
</cfoutput>
<cfset column = listFirst(data.columnlist)>
<cfoutput query="data" startrow="#url.start#" maxrows="#perpage#">
<cfset val = data[column][currentRow]>
<tr
<cfif currentRow mod 2>bgcolor="yellow"</cfif>
>
<td>#currentRow#</td>
<cfif question.questiontype is "Attachment">
<td width="95%"><a href="attachmentviewer.cfm?attachment=#urlEncodedFormat(val)#" target="_blank">#val#</a></td>
<cfelse>
<td width="95%">#val#</td>
</cfif>
</tr>
</cfoutput>
<cfoutput>
</table>
</p>
</cfoutput>
</cfif>
</tags:layout>