Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trying to refresh my calendar, without refreshing the entire page.

Status
Not open for further replies.

wrighterb

Programmer
Feb 20, 2007
80
US
Trying to refresh my calendar, without refreshing the entire page.

Any Ideas where to start

<style type="text/css">
.cal_Red {
Background: #cc0000;
color: #000000;
FONT-FAMILY: Verdana,Arial, Helvetica;
FONT-SIZE: 10px;
FONT-WEIGHT: normal;
text-align: center;
width: 35px;
border-width: 1px;
border-style: outset;
}
.cal_Green {
Background: #009900;
color: #000000;
FONT-FAMILY: Verdana,Arial, Helvetica;
FONT-SIZE: 10px;
FONT-WEIGHT: normal;
text-align: center;
width: 35px;
border-width: 1px;
border-style: outset;
}
.cal_Yellow {
Background: #ffff00;
color: #000000;
FONT-FAMILY: Verdana,Arial, Helvetica;
FONT-SIZE: 10px;
FONT-WEIGHT: normal;
text-align: center;
width: 35px;
border-width: 1px;
border-style: outset;
}
.cal_ededed {
Background: #ededed;
color: #000000;
FONT-FAMILY: Verdana,Arial, Helvetica;
FONT-SIZE: 10px;
FONT-WEIGHT: normal;
text-align: center;
width: 35px;
border-width: 1px;
border-style: outset;
}
.cal_Struct {
cellpadding: 2;
cellspacing: 0;
border-width: 1px;
border-style: outset;
text-align: center;
width: 230px;
}
.cal_Month {
Background: #4682b4;
color: #000000;
}
.cal_AlignTop {
vertical-align: top;
}
.stext {
COLOR: #000000;
FONT-FAMILY: Verdana,Arial, Helvetica;
FONT-SIZE: 10px;
FONT-WEIGHT: normal;
text-align: center;
}
</style>

<cfoutput>
<cfparam name="ID" default="1">
<cfparam name="form.arrive" default="">
<cfparam name="arrive" default="form.arrive">
<cfparam name="attributes.ds" default="mb_stayinthefloridakeys_data">
<cfquery name="qGetDates" datasource="#request.dsn#">
select *
from calendar_dates
where p_id = #ID#
</cfquery>

<cfparam name="monthlist" default="#qGetDates.d_list#">
<cfparam name="pmonthlist" default="#qGetDates.d_pending#">

<cfparam name="currdate" default="#month(now())#/1/#year(now())#">
<cfparam name="url.currdate" default="#month(now())#/1/#year(now())#">

<cfset currday = dayofweek(currdate)>
<cfset startdays = currday - 1>

<table class="cal_AlignTop">
<tr>
<td class="cal_AlignTop">
<cfset columns = 0>
<cfloop from=1 to="#cookie.showmonths#" index="calmonth">
<cfif columns eq 1 or columns eq 3 or columns eq 5 or columns eq 7 or columns eq 9 or columns eq 11>
</td>
<td class="cal_AlignTop">
</cfif>
<cfif columns eq 2 or columns eq 4 or columns eq 6 or columns eq 8 or columns eq 10>
</td>
</tr>
</table>
<table class="cal_AlignTop">
<tr>
<td class="cal_AlignTop">
</cfif>
<a name="Cal"></a>
<cfset counter = 1>
<table class="cal_Struct">
<tr class="cal_Month">

<td class="stext" width=35>
<cfif datecompare('#month(now())#/1/#year(now())#',currdate)>
<a href="rental_details.cfm?ID=#ID#&currdate=#dateadd('m',-1,currdate)#&##Cal">
<img src="prev.gif" border="0" alt="Previous Month"></a><cfelse><img src="spacer.gif" width="35" height="2"></cfif></td>
<td class="stext" width=165><strong>#dateformat(currdate,'mmmm yyyy')#</strong></td>
<td class="stext" width=35><a href="rental_details.cfm?ID=#ID#&currdate=#dateadd('m',1,currdate)#&arrive=#form.arrive#&##Cal" ><img src="next.gif" border="0" alt="Next Month"></a></td>



</tr>
</table>

<table class="cal_Struct">

<tr bgcolor="ecf5fd">
<td class="stext" width="35"><strong>Su</strong></td>
<td class="stext" width="35"><strong>Mo</strong></td>
<td class="stext" width="35"><strong>Tu</strong></td>
<td class="stext" width="35"><strong>We</strong></td>
<td class="stext" width="35"><strong>Th</strong></td>
<td class="stext" width="35"><strong>Fr</strong></td>
<td class="stext" width="35"><strong>Sa</strong></td>
</tr>

<tr>
<cfloop from=1 to="#startdays#" index="sday">
<td class="cal_ededed">&nbsp;</td>
<cfset counter = counter + 1>
</cfloop>

<cfloop from="1" to="#daysinmonth(currdate)#" index="thisday">
<cfif listfindnocase(monthlist,'#month(currdate)#/#thisday#/#year(currdate)#') gt 0 OR datecompare('#month(currdate)#/#thisday#/#year(currdate)#',now()) lt 1>

<td class="cal_Red"><cfif thisday lt 10>0</cfif>#thisday#</td>
<cfelseif listfindnocase(pmonthlist,'#month(currdate)#/#thisday#/#year(currdate)#') gt 0>

<td class="cal_Yellow"><cfif thisday lt 10>0</cfif>#thisday#</td>
<cfelse>
<td class="cal_Green"><cfif thisday lt 10>0</cfif>#thisday#</td>
</cfif>

<cfif counter eq 7>
<cfset counter = 0>
</tr>
<tr>
</cfif>
<cfset counter = counter + 1>
</cfloop>
<cfif counter lte 7>
<cfset counter = 7 - counter>
<cfloop from=0 to="#counter#" index="eday">
<td class="cal_ededed">&nbsp;</td>
</cfloop>
</cfif>
</tr>
</table>
<cfset currdate = dateadd('m',1,currdate)>
<cfset currday = dayofweek(currdate)>
<cfset startdays = currday - 1>
<cfset columns = columns + 1>
</cfloop>
</td></tr></table>
</td>
</tr>
</table>

</cfoutput>
 
You could only do that client side. Check the javascript forum.

Lyndon

---People Remember about 10% of what you say ---They never forget how you made them feel. Covey
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top