<cfsetting enablecfoutputonly=true>
<!---
	Name         : surveys.cfm
	Author       : Raymond Camden 
	Created      : September 6, 2004
	Last Updated : September 6, 2004
	History      : 
	Purpose		 : 
--->
<cfimport taglib="../tags/" prefix="tags">

<tags:layout templatename="admin" title="Survey Editor">

	<!--- handle deletions --->
	<cfif isDefined("form.mark") and len(form.mark)>
		<cfloop index="id" list="#form.mark#">
			<cfset application.survey.deleteSurvey(id)>
		</cfloop>
		<cfoutput>
		<p>
		<b>Survey(s) deleted.</b>
		</p>
		</cfoutput>
	</cfif>
	
	<!--- get surveys --->
	<cfset surveys = application.survey.getSurveys()>
	
	<tags:datatable data="#surveys#" list="name,description,active" editlink="surveys_edit.cfm" linkcol="name" label="Survey"
					deleteMsg="Warning - this will delete the survey including all related questions and responses.">
		<tags:datacol colname="name" label="Name" width="200" />	
		<tags:datacol colname="description" label="Description" width="400" />	
		<tags:datacol colname="active" label="Active" width="50" format="YesNo" />	
	</tags:datatable>

</tags:layout>

<cfsetting enablecfoutputonly=false>