The code for which i am getting error Invalid date mask. (mask=mmmm
d, 'yy, specified format=mmmm d, 'yy) is as follows
<cfinclude template = "/includes/admin_top.cfm" />
<!--- abort if missing ID # --->
<cfif form.su_id EQ "">
<cfoutput>#application.UDFs.ErrorPage("Missing Survey
ID","032205-1658")#</cfoutput>
</cfif>
<!--- abort if ID # is not a number (will cause SQL query to break) ---
>
<cfif NOT IsNumeric(form.su_id)>
<cfoutput>#application.UDFs.ErrorPage("Invalid Survey
ID","032205-1659")#</cfoutput>
</cfif>
<!--- abort if this survey is not in the user's view list --->
<cfif ListFind(session.su_view_list, form.su_id) LT 1>
<cfoutput>#application.UDFs.ErrorPage("You do not have permission to
view this Survey & its Results","032305-1651")#</cfoutput>
</cfif>
<cfparam name="form.start_m" default="" />
<cfparam name="form.start_d" default="" />
<cfparam name="form.start_y" default="" />
<cfparam name="url.start_date" default="" />
<cfif form.start_m IS NOT "" AND form.start_d IS NOT "" AND
form.start_y IS NOT "">
<cfset url.start_date = "#form.start_y#-
#application.UDFs.PrefixZeroes(form.start_m,2)#-
#application.UDFs.PrefixZeroes(form.start_d,2)#" />
</cfif>
<cfif url.start_date IS "">
<!--- if not start date, default to today --->
<cfset url.start_date = DateFormat(Now(), "yyyy-mm-dd") />
<cfset range_verbiage = "Today" />
<cfelse>
<cfset range_verbiage = DateFormat(url.start_date, "mm/dd/yyyy") />
</cfif>
<cfparam name="form.end_m" default="" />
<cfparam name="form.end_d" default="" />
<cfparam name="form.end_y" default="" />
<cfparam name="url.end_date" default="" />
<cfif form.end_m IS NOT "" AND form.end_d IS NOT "" AND form.end_y IS
NOT "">
<cfset url.end_date = "#form.end_y#-
#application.UDFs.PrefixZeroes(form.end_m,2)#-
#application.UDFs.PrefixZeroes(form.end_d,2)#" />
</cfif>
<cfif url.end_date IS NOT "">
<cfset range_verbiage = range_verbiage & " through " &
DateFormat(url.end_date, "mm/dd/yyyy") />
</cfif>
<cfparam name="url.range" default="" />
<cfif url.range IS "week">
<cfset range_verbiage = "This Week" />
<cfelseif url.range IS "month">
<cfset range_verbiage = "This Month" />
<cfelseif url.range IS "all">
<cfset range_verbiage = "All Survey" />
</cfif>
<!--- get survey info --->
<cftry>
<cfquery name="survey_info" datasource="#APPLICATION.db#">
SELECT su_title, su_type, su_anon, su_ssl, su_active,
su_opendate,
su_closedate,
(SELECT COUNT(qu_id) FROM questions WHERE
qu_su_id = su_id)
num_questions,
(SELECT COUNT(usr_id) FROM users WHERE
usr_su_id = su_id)
num_submissions
FROM surveys
WHERE su_id = <cfqueryparam value="#form.su_id#"
cfsqltype="cf_sql_integer" />
</cfquery>
<cfcatch>
<cfoutput>#application.UDFs.ErrorPage("Error retrieving Survey
Details from database","032305-1652",cfcatch,true)#</cfoutput>
</cfcatch>
</cftry>
<cfif survey_info.recordCount LT 1>
<cfoutput>#application.UDFs.ErrorPage("Error retrieving Survey
Details from database (No Results Returned)","032305-1653")#</
cfoutput>
</cfif>
<!--- set the survey url --->
<cfif survey_info.su_ssl>
<cfset su_url = APPLICATION.SSLWebRoot&"survey.cfm?
su_id="&form.su_id />
<cfelse>
<cfset su_url = APPLICATION.WebRoot&"survey.cfm?su_id="&form.su_id />
</cfif>
<!--- get responses to survey --->
<cftry>
<cfquery name="submits_qry" datasource="#APPLICATION.db#"
blockfactor="100">
SELECT usr_id, usr_fname, usr_lname, usr_email, usr_empid,
usr_stid,
usr_modified, usr_created,
(SELECT COUNT(res_id) FROM responses WHERE
res_usr_id = usr_id) AS
num_responses
FROM users
WHERE usr_su_id = <cfqueryparam value="#form.su_id#"
cfsqltype="cf_sql_integer" />
<cfif url.range IS "week">AND usr_created >
'#DateFormat(DateAdd("w", -1, Now()), "yyyy-mm-dd")# 00:00:00'
<cfelseif url.range IS "month">AND usr_created >
'#DateFormat(DateAdd("m", -1, Now()), "yyyy-mm-dd")# 00:00:00'
<cfelseif url.range IS NOT "all">
<cfif url.start_date IS NOT "">AND usr_created
>=
'#url.start_date# 00:00:00'</cfif>
<cfif url.end_date IS NOT ""> AND usr_created
<= '#url.end_date#
11:59:59'</cfif>
</cfif>
ORDER BY usr_created DESC
</cfquery>
<cfcatch>
<cfoutput>#application.UDFs.ErrorPage("Error retrieving
#application.UDFs.properCase(survey_info.su_type)# Questions from
database","032305-1655",cfcatch,true)#</cfoutput>
</cfcatch>
</cftry>
<cfset thisnum_submissions = submits_qry.recordCount />
<!--- get if user owns this survey --->
<cfset this_su_own=ListFind(session.su_own_list, form.su_id) />
<cfoutput query="survey_info">
<!--- Bread Crumbs --->
<ul class="crumbtrail">
<li><a href="main.cfm">Home</a></li>
<li><a href="surv_view.cfm?
su_id=#form.su_id#">#Mid(application.UDFs.stripHTML(su_title),
1,36)#<cfif Len(application.UDFs.stripHTML(su_title)) GT 36>...</
cfif></a></li>
<li><a href="surv_report.cfm?su_id=#form.su_id#">View
Results</a></
li>
<li>List Results</li>
</ul>
<div class="header">
Reporting for "#su_title#"
</div>
<!--- path to calendar files --->
<cfset calendar_path = "../includes/calendar/" />
<!--- set the start and end years of the calendar dropdown --->
<cfset year_dropdown_start = 2004 />
<cfset year_dropdown_end = DateFormat(Now(),"yyyy") />
<!-- import the calendar styles (only need to do this once on a page)
-->
<link rel="stylesheet" type="text/css" media="all"
href="#calendar_path#system.css" title="system" />
<link href="#calendar_path#zpcal.css" rel="stylesheet" type="text/
css" />
<!-- import the calendar scripts (only need to do this once on a
page) -->
<script type="text/javascript" src="#calendar_path#utils.js"></
script>
<script type="text/javascript" src="#calendar_path#calendar.js"></
script>
<script type="text/javascript" src="#calendar_path#calendar-en.js"></
script>
<script type="text/javascript" src="#calendar_path#calendar-
setup.js"></script>
<script type="text/javascript">
<!--
function copyURLtoClipboard()
{
if( window.clipboardData && clipboardData.setData )
clipboardData.setData("text", "#su_url#");
else alert("Internet Explorer 5+ required to use this
feature.");
}
function ValidateForm (myForm)
{
var start_m =
myForm.start_m[myForm.start_m.selectedIndex].value;
var start_d =
myForm.start_d[myForm.start_d.selectedIndex].value;
var start_y =
myForm.start_y[myForm.start_y.selectedIndex].value;
var end_m =
myForm.end_m[myForm.end_m.selectedIndex].value;
var end_d =
myForm.end_d[myForm.end_d.selectedIndex].value;
var end_y =
myForm.end_y[myForm.end_y.selectedIndex].value;
var start_date = parseInt(start_y*10000) +
parseInt(start_m*100) +
parseInt(start_d);
var end_date = parseInt(end_y*10000) +
parseInt(end_m*100) +
parseInt(end_d);
var error_string = "";
if ((start_m != "" && (start_d == "" || start_y == ""))
||
(start_d != "" && (start_m == "" || start_y == "")) || (start_y != ""
&& (start_d == "" || start_m == ""))) error_string += "- Invalid Start
Date\n";
else if ((end_m != "" && (end_d == "" || end_y == ""))
|| (end_d !=
"" && (end_m == "" || end_y == "")) || (end_y != "" && (end_d == "" ||
end_m == ""))) error_string += "- Invalid End Date\n";
else if (start_date >= end_date) error_string += "The
Start Date
must be before the End Date\n";
if (error_string != "")
{
window.alert ("Your form has the following data
errors:\n\n" +
error_string);
return false;
}
return true;
}
-->
</script>
<cf_jAccordian bgColor="FFFFFF" width="100%" multiple="true">
<cf_jAccordianPane label="Submission Details" open="true"
iconclosed="../images/triangle.gif" icon="../images/opentriangle.gif">
<table align="left" width="100%" cellspacing="4">
<tr bgcolor="##EEEEEE">
<td
class="textbold"><strong>Title:</strong></td>
<td>#su_title#</td>
</tr>
<tr>
<td valign="top" class="textbold">
<strong>#application.UDFs.properCase(survey_info.su_type)# URL:</
strong>
</td>
<td valign="top" class="smalltext">
<script type="text/javascript">
<!--
if(
window.clipboardData && clipboardData.setData ) {
document.write('<input name="copyurlbutton" id="copyurlbutton"
type="button" value="Copy URL" onclick="copyURLtoClipboard();"
height="18" width="58" title="Copy this URL to your clipboard"
class="boxbutton" />');
}
-->
</script>
<a href="#su_url#"
target="_blank">#su_url#</a>
</td>
</tr>
<tr bgcolor="##EEEEEE">
<td class="textbold"
valign="top">Status:</td>
<td valign="top">
This
#application.UDFs.properCase(su_type)# is <strong>
<cfif su_type IS "survey" AND
DateFormat(su_opendate,
"yyyymmdd") GT DateFormat(Now(), "yyyymmdd")>
NOT YET OPEN
<cfelseif su_type IS "survey"
AND DateFormat(su_opendate,
"yyyymmdd") LTE DateFormat(Now(), "yyyymmdd") AND
DateFormat(su_closedate, "yyyymmdd") GT DateFormat(Now(), "yyyymmdd")>
OPEN
<cfelseif su_type IS "survey">
CLOSED
<cfelseif su_type IS "form" AND
su_active>
ACTIVE
<cfelseif su_type IS "form" AND
NOT su_active>
INACTIVE
</cfif></strong>
and has
<strong>#survey_info.num_submissions#</strong>
Submission<cfif num_submissions NEQ 1>s</cfif>
</td>
</tr>
<tr class="noprint">
<td class="textbold" valign="top"
nowrap="nowrap">List
Submissions From:</td>
<td valign="top" width="100%"><nobr />
<a
href="#CGI.SCRIPT_NAME#?su_id=#form.su_id#">Today</
a>
<a
href="#CGI.SCRIPT_NAME#?su_id=#form.su_id#&range=week">This
Week</a>
<a
href="#CGI.SCRIPT_NAME#?su_id=#form.su_id#&range=month">This
Month</a>
<a
href="#CGI.SCRIPT_NAME#?su_id=#form.su_id#&range=all">All</a>
<span class="smalltext">(warning, may take some time to load)</
span>
</td>
</tr>
<form name="changeDateRange"
action="#CGI.SCRIPT_NAME#"
method="post" onSubmit="return ValidateForm(this);">
<input type="hidden" name="su_id"
value="#form.su_id#" />
<tr class="noprint">
<td rowspan="2" class="textbold"
style="text-align:right"
valign="top">or </td>
<td>
<!--- set the default values
for the dropdowns (leave empty to
have no date selected) --->
<cfset sel_startmonth =
form.start_m />
<cfset sel_startyear =
form.start_y />
<cfset sel_startday =
form.start_d />
<script type="text/javascript">
<!--
function
update_startCal(cal) {
var date =
cal.date;
var selectMonth
= document.getElementById("start_m");
selectMonth.selectedIndex = date.getMonth()+1;
var selectDay =
document.getElementById("start_d");
selectDay.selectedIndex = (date.getDate());
var selectYear
= document.getElementById("start_y");
selectYear.selectedIndex = (date.getFullYear() -
#year_dropdown_start#+1);
}
//-->
</script>
From:
<select name="start_m"
id="start_m" class="formfield">
<option
value=""></option>
<cfloop index="i"
from="1" to="12">
<option
value="#i#" <cfif sel_startmonth EQ i>
selected="selected"</cfif>>#DateFormat(CreateDateTime(0,i,
1,0,0,0),"mmm")#</option>
</cfloop>
</select>
/
<select name="start_d"
id="start_d" class="formfield">
<option
value=""></option>
<cfloop index="i"
from="1" to="31"><option value="#i#" <cfif
sel_startday EQ i> selected="selected"</cfif>>#i#</option></cfloop>
</select>
/
<select name="start_y"
id="start_y" class="formfield">
<option
value=""></option>
<cfloop index="i"
from="#year_dropdown_start#"
to="#year_dropdown_end#"><option value="#i#" <cfif sel_startyear EQ i>
selected="selected"</cfif>>#i#</option></cfloop>
</select>
<a href="##"
id="startcal_button" onclick="return false;"><img
src="#calendar_path#icons/tinycal-icon.gif" alt="calendar icon"
title="View Calendar" style="border:0px" /></a>
<script type="text/javascript">
<!-- to hide script
contents from old browsers
Zapatec.Calendar.setup({
button :
"startcal_button", // What will trigger the popup
of the calendar
onUpdate :
update_startCal,
showsTime :
false //don't show time, only date
});
// end hiding contents
from old browsers -->
</script>
</td>
</tr>
<tr class="noprint">
<td>
<!--- set the default values
for the dropdowns (leave empty to
have no date selected) --->
<cfset sel_endmonth =
form.end_m />
<cfset sel_endyear = form.end_y
/>
<cfset sel_endday = form.end_d
/>
<script type="text/javascript">
<!--
function
update_endCal(cal) {
var date =
cal.date;
var selectMonth
= document.getElementById("end_m");
selectMonth.selectedIndex = date.getMonth()+1;
var selectDay =
document.getElementById("end_d");
selectDay.selectedIndex = (date.getDate());
var selectYear
= document.getElementById("end_y");
selectYear.selectedIndex = (date.getFullYear() -
#year_dropdown_start#+1);
}
//-->
</script>
To:
<select name="end_m" id="end_m"
class="formfield">
<option
value=""></option>
<cfloop index="i"
from="1" to="12">
<option
value="#i#" <cfif sel_endmonth EQ i>
selected="selected"</cfif>>#DateFormat(CreateDateTime(0,i,
1,0,0,0),"mmm")#</option>
</cfloop>
</select>
/
<select name="end_d" id="end_d"
class="formfield">
<option
value=""></option>
<cfloop index="i"
from="1" to="31"><option value="#i#" <cfif
sel_endday EQ i> selected="selected"</cfif>>#i#</option></cfloop>
</select>
/
<select name="end_y" id="end_y"
class="formfield">
<option
value=""></option>
<cfloop index="i"
from="#year_dropdown_start#"
to="#year_dropdown_end#"><option value="#i#" <cfif sel_endyear EQ i>
selected="selected"</cfif>>#i#</option></cfloop>
</select>
<a href="##" id="endcal_button"
onclick="return false;"><img
src="#calendar_path#icons/tinycal-icon.gif" alt="calendar icon"
title="View Calendar" style="border:0px" /></a>
<script type="text/javascript">
<!-- to hide script
contents from old browsers
Zapatec.Calendar.setup({
button :
"endcal_button", // What will trigger the popup
of the calendar
onUpdate :
update_endCal,
showsTime :
false //don't show time, only date
});
// end hiding contents
from old browsers -->
</script>
<input type="submit"
name="submit" value="Go" class="boxbutton"
title="Filter Results by these dates" />
</td>
</tr>
</form>
</table>
</cf_jAccordianPane>
<!--- List Submissions --->
<cf_jAccordianPane label="#range_verbiage#'s Submissions
(#thisnum_submissions#) <span
class=""smalltext""><em>#DateFormat(Now(), "mm/dd/yy")#</em></span>"
open="true" iconclosed="#APPLICATION.SSLWebRoot#images/triangle.gif"
icon="#APPLICATION.SSLWebRoot#images/opentriangle.gif">
<table align="left" cellpadding="2" class="text"
width="100%">
<tr bgcolor="##DDDDDD">
<td class="noprint"> </td>
<td class="textbold"
align="center">Date</td>
<td class="textbold"
align="center">Time</td>
<td class="textbold"
align="center">User</td>
<cfif survey_info.num_questions GT
0><td class="textbold"
align="center">Questions<br />Answered</td></cfif>
</tr>
<cfif thisnum_submissions GT 0>
<cfloop query="submits_qry">
<tr <cfif
submits_qry.currentRow MOD 2 EQ 0>bgcolor="##EEEEEE"</
cfif>>
<td nowrap="nowrap"
class="noprint">
<a
href="res_view.cfm?su_id=#form.su_id#&usr_id=#usr_id#"><img
src="../images/viewicon.gif" width="21" height="15" alt="View this
Submission" border="0" /></a>
<cfif
this_su_own>
<a
href="res_delete.cfm?su_id=#form.su_id#&usr_id=#usr_id#">
<img
src="../images/delicon.gif" width="14" height="15"
alt="Delete this Submission" border="0" />
</a>
</cfif>
</td>
<td align="center"
valign="top" class="textbold"><nobr /
>#DateFormat(usr_created, "mmmm d, 'yy")#</td>
<td align="center"
valign="top" class="textbold" nobr /
>#TimeFormat(usr_created, "HH:mm")#</td>
<td valign="top"
width="100%">
<cfif
survey_info.su_anon>
Anonymous
<cfelseif
usr_fname IS NOT "" OR usr_lname IS NOT "">
#usr_fname# #usr_lname#
<cfif
usr_empid IS NOT "">
(Employee ID## #usr_empid#)
<cfelseif usr_stid IS NOT "">
(Student ID## #usr_stid#)
</cfif>
<cfelseif
usr_email IS NOT "">
<a
href="mailto:#usr_email#">#usr_email#</a>
</cfif>
<cfif
usr_modified IS NOT "">
-
<em>Last modified at #TimeFormat(usr_modified, "HH:mm
tt")# on #DateFormat(usr_modified, "mmmm d, yyyy")#</em>
</cfif>
</td>
<cfif
survey_info.num_questions GT 0>
<td
align="center" valign="top">#num_responses#/
#survey_info.num_questions#</td>
</cfif>
</tr>
</cfloop>
<cfelse>
<tr><td width="100%" colspan="5">There
are no submissions for
#range_verbiage#.</td></tr>
</cfif>
</table>
</cf_jAccordianPane>
</cf_jAccordian>
</cfoutput>
<cfinclude template = "../includes/admin_bottom.cfm">
--
Open BlueDragon Public Mailing List
http://www.openbluedragon.org/ http://twitter.com/OpenBlueDragon
mailing list - http://groups.google.com/group/openbd?hl=en
!! save a network - please trim replies before posting !!