Re: CF Query Driven Calendar

2001-02-22 Thread Jamie Jackson

We use this one.
http://devex.allaire.com/developer/gallery/info.cfm?ID=CA3472D2-2830-11D4-AA9700508B94F380method=Full

On Thu, 22 Feb 2001 16:13:07 -, in cf-talk you wrote:

Hi all.  Does anyone know where I can hold of  aquery driven Events calendar
which I need to incorporate into a site urgently.  
Basically need a calendar which shows daily events (input via back end admin
and stored in SQL Server db)..these events can be for one or multiple days.
Must have facility to be able to traverse thru months...

Hope someone can help...it will save me some time!

Regards,

Nick Betts
Software Engineer






~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: CF Query Driven Calendar

2001-02-22 Thread Dylan Bromby

you can modify this calendar i wrote. save it as calendar.cfm somewhere.

!---*CALENDAR STARTS*---
HTML
HEAD
TITLECalendar v1.0/TITLE
/HEAD
BODY BGCOLOR="FF" LINK="FF" ALINK="FF" VLINK="FF"
FORM ACTION="calendar.cfm" METHOD="POST"
CFOUTPUT
SELECT NAME="current_month"
CFLOOP INDEX="month" FROM="1" TO="12"
OPTION VALUE="#month#"CFIF #month# EQ #DateFormat(Now(), 'm')#
SELECTED/CFIF#MonthAsString(month)#
/CFLOOP
/SELECT
SELECT NAME="current_day"
CFLOOP INDEX="day" FROM="1" TO="31"
OPTION VALUE="#day#"CFIF #day# EQ #DateFormat(Now(), 'd')#
SELECTED/CFIF#day#
/CFLOOP
/SELECT
SELECT NAME="current_year"
CFLOOP INDEX="year" FROM="2001" TO="2020"
OPTION VALUE="#year#"CFIF #year# EQ #DateFormat(Now(), '')#
SELECTED/CFIF#year#
/CFLOOP
/SELECT
INPUT TYPE="SUBMIT" NAME="make_calendar" VALUE="Make Calendar"
/CFOUTPUT
/FORM
CFIF #ParameterExists(make_calendar)#

CFPARAM NAME="start" DEFAULT="0"
CFPARAM NAME="current_day" DEFAULT=#DateFormat(Now(), 'd')#
CFPARAM NAME="current_month" DEFAULT=#DateFormat(Now(), 'm')#
CFPARAM NAME="current_year" DEFAULT=#DateFormat(Now(), '')#
CFSET current_row = 1
CFSET current_first_day = #current_month#"/1/"#current_year#
CFSET current_last_day =
#current_month#"/"#DaysInMonth(Now())#"/"#current_year#
CFSET current_date = #current_month#"/"#current_day#"/"#current_year#

TABLE CELLPADDING="5" CELLSPACING="0" BORDER="0" WIDTH="600"
TR
TD ALIGN="LEFT" VALIGN="BOTTOM"
CFOUTPUT
A
HREF="calendar.cfm?make_calendar=current_month=current_day=current_year="

FONT FACE="VERDANA,ARIAL,HELVETICA" SIZE="1" COLOR="669966"
CFTRY
B#DateFormat(current_date - DaysInMonth(current_date-1), '
')#/B
CFCATCH TYPE="ANY"
Sorry, that is not a valid date.
CFABORT
/CFCATCH
/CFTRY
/FONT
/A
/CFOUTPUT
/TD
TD ALIGN="CENTER" VALIGN="BOTTOM"
FONT FACE="VERDANA,ARIAL,HELVETICA" SIZE="5" COLOR="669966"
CFTRY
CFOUTPUT
B#DateFormat(current_date, ' ')#/B
/CFOUTPUT
CFCATCH TYPE="ANY"
Sorry, that is not a valid date.
/CFCATCH
/CFTRY
/FONT
/TD
TD ALIGN="RIGHT" VALIGN="BOTTOM"
CFOUTPUT
A
HREF="calendar.cfm?make_calendar=current_month=current_day=current_year="

FONT FACE="VERDANA,ARIAL,HELVETICA" SIZE="1" COLOR="669966"
B#DateFormat(current_date + DaysInMonth(current_date+1), '
')#/B
/FONT
/A
/CFOUTPUT
/TD
/TR
/TABLE
TABLE CELLPADDING="5" CELLSPACING="3" BORDER="0" WIDTH="600"
TR
CFOUTPUT
CFLOOP INDEX="day" FROM="1" TO="7"
TD BGCOLOR="FFCC66"
FONT FACE="VERDANA,ARIAL,HELVETICA" SIZE="1" COLOR="CC6600"
B#DayOfWeekAsString(DayOfWeek(day))#/B
/FONT
/TD
/CFLOOP
/CFOUTPUT
/TR
CFLOOP INDEX="rows" FROM ="1" TO="6"
TR
CFLOOP INDEX="cols" FROM="1" TO="7"
CFIF #current_row# LTE 
#DaysInMonth(DateFormat(current_date))# AND
#current_row# GTE 1
CFIF #DateFormat(current_first_day, '')# IS
#DayOfWeekAsString(cols)#
CFSET start = 1
/CFIF
CFIF #start# EQ 1
CFOUTPUT
CFSET begin_day = 
#CreateDateTime(current_year, current_month,
current_row,
0, 0, 1)#
CFSET end_day = #CreateDateTime(current_year, 
current_month,
current_row,
23, 59, 59)#
CFIF #DateFormat(current_date, 'd')# EQ 
#current_row#


TD BGCOLOR="0099CC" HEIGHT="60" 
WIDTH="80" ALIGN="LEFT" VALIGN="TOP"
FONT FACE="VERDANA,ARIAL,HELVETICA" 
SIZE="1" COLOR="99"
B#current_row#/B
/FONT
/TD
CFELSE
TD BGCOLOR="E6E6E6" HEIGHT="60" 
WIDTH="80" ALIGN="LEFT" VALIGN="TOP"
FONT FACE="VERDANA,ARIAL,HELVETICA" 
SIZE="1" COLOR="44"
#current_row#
/FONT
/TD