Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
Franklin LO #1
Generate a calander
Hi everyone,
I would like to generate 12 tables of the calander for the whole year like
this:
sun mon tue wed thur fri sat
Wk1 5 0 3 5 0 4 6
Wk2 2 2 5 9 1 3 7
Wk3 1 1 1 2 3 5 9
All the data are store in the database. The number in the calander are the
number of people who will attend the course. What is the fastest way / smartest
way to generate the tables for the whole year? Please give me some hints
FRANKLIN
Franklin LO Guest
-
calander control
where can i find a nice looking calander control to implement in an html page ? cheers -
Calander Component
Would anyone out there like to share the CF calendar component that was in DRK 3. I would like to see if I can make it work for my company. ... -
Calander Form
I have a worm form that sends appointment details to me via e-mail it arrives like this: On 2004-07-13 at 14:37:27, The following information... -
Cant add events to HTML controls in a Calander control
Im not getting any error messages but the event is not going off when i click the button it just posts back to the same page. I know this code has... -
Calander For Field in form and in subform
ACCESS XP 2002 I have a form that when the user picks the field DATEIN, that I need a calendar to popup, let the user select the date and that... -
jdeline #2
Re: Generate a calander
If you are not interested in the date but only in the week, you can easiely do
by creating a 52 row table - Wk1 through Wk52. Your database can have one
column named weekNumber, and 7 columns for the days of the week. The database
would have 52 records, corresponding to the 52 rows in the table.
jdeline Guest
-
jorgepino #3
Re: Generate a calander
Here is something i created while ago
let me know if you need me to make easier to read
<cfset weekstotal = 0>
<CFif ParameterExists(session.Mnt_Emp_statusID)>
<cfset statusID = #session.Mnt_Emp_statusID#>
<cfset Empid = #session.Mnt_emp_Id#>
<cfelse>
<cfset statusID = #session.Emp_statusID#>
<cfset Empid = #session.Emp_ID#>
</CFif>
<cfif ParameterExists(url.newdate)>
<cfset weeknow = #week(url.newdate)#>
<cfelseif ParameterExists(form.tdate)>
<cfset weeknow = #week(form.tdate)#>
<cfelseif ParameterExists(url.week)>
<cfset weeknow = #url.week#>
<cfelse>
<cfset weeknow = #Week(now())#>
</cfif>
<cfset weekbefore = weeknow - 1>
<cfset weekafter = weeknow + 1>
<table border="1" width="100%" cellpadding="0" cellspacing="0"
bordercolor="#DFDFDF">
<cfloop index = "LoopCountM" from = 1 to = 12>
<cfset thismonthdays = #DaysInMonth(CreateDate(2005, LoopCountM, 1))# >
<cfloop index = "LoopCount" from = 1 to = #thismonthdays#>
<cfset dayofthemonth = #CreateDate(2005, LoopCountM, LoopCount)#>
<cfif #weeknow# eq #Week(dayofthemonth)#>
<cfif #DayofWeekAsString(DayOfWeek(dayofthemonth))# is "Sunday"><cfset
dayone = #DateFormat(dayofthemonth, "m/dd/yyyy")#> <tr><cfif not
ParameterExists(url.print)><td><cfoutput><a href="index.cfm?module=time&<cfif
ParameterExists(url.page)>page=#Url.page#&</cfif>week=#weekbefore#"> <<
</a></cfoutput></td></cfif></cfif>
<cfoutput>
<td class="small" align="center" valign="top" bgcolor="#IIf(LoopCountM Mod
2, DE('ffffff'), DE('99FF00'))#" <cfif dayofthemonth eq
#todaydate#>class="red"</cfif>>
<cfset date1 = #DateFormat(dayofthemonth, "mm/dd/yyyy")#>
<cfinclude template="qry_gethoursempl.cfm">
<cfinclude template="qry_holidaydates.cfm">
<a href="index.cfm?module=time&<cfif
ParameterExists(url.page)>page=#Url.page#&</cfif>week=#weeknow#&newdate=#date1#"
class="small">
#DateFormat(dayofthemonth, "ddd mm/dd")#</a><cfif holidaydates.Holiday neq
''><BR>#holidaydates.Holiday#</cfif><BR>
#gethoursempl.THour#
<cfif gethoursempl.THour eq ""><cfset THour= 0><cfelse><cfset THour=
#gethoursempl.THour#></cfif>
<cfset weekstotal = weekstotal + THour>
</td>
</cfoutput>
<cfif #DayofWeekAsString(DayOfWeek(dayofthemonth))# is "Saturday"><cfset
daytwo = #DateFormat(dayofthemonth, "m/dd/yyyy")#><cfif not
ParameterExists(url.print)><cfoutput><cfif #weekstotal# gt 0><td
align="center">Total<BR><strong>#weekstotal#</strong></td></cfif><td><a
href="index.cfm?module=time&<cfif
ParameterExists(url.page)>page=#Url.page#&</cfif>week=#weekafter#"> >>
</a></td></cfoutput></cfif></tr></cfif>
</cfif>
</cfloop>
</cfloop>
<cfif not ParameterExists(url.print)>
<tr><td colspan="7" align="center">
<cfoutput><a href="index.cfm?module=time&<cfif
ParameterExists(url.page)>page=#Url.page#&</cfif>" class="small">Today
Date</a></cfoutput></td>
<td colspan="2" class="small" align="center">
<SCRIPT language=javascript src="/pop-up.js" type=text/javascript></SCRIPT>
<cfoutput><a
href="javascript:openNaviLGR('print.cfm?module=tim ecard_prt&week=#weeknow#&print
=yes');"><img src="images/icon_print.gif" border="0"></a></cfoutput></td></tr>
</cfif>
</table>
jorgepino Guest



Reply With Quote

