This one has got me stuck...
I need to display 2 facility's side by side - with their opening times in the middle. And get each side on left and right to match up with their times.
Problem is - times are in 15 min increments. But sometimes left or right will be book for an hour or different than the 15mins increments.
So just gonna put this out there...
<CFSET pdate = #CREATEODBCDATE(todaydate)#>
<CFSET startdate = #CREATEODBCDATE(todaydate)#>
<CFSET enddate = #CREATEODBCDATE(todaydate)#>
<table>
<tr>
<td valign=top>
<cfinclude template="_left.cfm">
</td>
<td valign=top>
<cfinclude template="_middle.cfm">
</td>
<td valign=top>
<cfinclude template="_right.cfm">
</td>
</tr>
</table>
_LEFT and _RIGHT Basically the same with SAID being SAIDLT and SAIDRT
<cfquery name="schlt" datasource="#ds#">
select * from masterschedule
where said = '#saidlt#' or where said = '#saidrt#'
and schdate = #createODBCDate(pdate)#
order by schstart
</cfquery>
<table cellpadding=20 cellspacing=0 align=center>
<cfoutput query="schlt">
or query="schrt">
<cfquery name="ug" datasource="#ds#">
select * from users
where uid = '#uid#'
</cfquery>
<tr bgcolor=<cfif (sch.currentRow MOD 2 EQ 0)>e8e8e8
<cfelse>
f7f7f7</cfif>>
<td class=verd10 valign=middle>
#Timeformat(schstart, 'H:mm TT')#
<br>#Timeformat(schend, 'H:mm TT')#
</td>
<td class=verd11 valign=middle align=center>#ug.username#</td>
</tr>
</cfoutput>
</table>
_MIDDLE
<cfquery name="sadd" datasource="#ds#">
select * from subarena
where said = '#said#'
</cfquery>
<cfoutput>
<cfset hrdiv = 60 / #sadd.increment#>
<cfset hrsdiff1 = (DateFormat( todaydate, "yyyy-mm-dd" ) & " " & "#TimeFormat(sadd.topen)#") />
<cfif sadd.tclose lte sadd.topen>
<cfset hrsdiff2 = (DateFormat( todaydate, "yyyy-mm-dd" ) & " " & "#TimeFormat(sadd.tclose)#") />
<cfset hrsdiff2 = #DateAdd('d', 1, '#hrsdiff2#')#>
<cfelse>
<cfset hrsdiff2 = (DateFormat( todaydate, "yyyy-mm-dd" ) & " " & "#TimeFormat(sadd.tclose)#") />
</cfif>
<cfset loopreps = (#Abs(DateDiff("h", hrsdiff1, hrsdiff2))# * hrdiv) - 1>
</cfoutput>
<cfset schdate = '#startdate#'>
<cfloop index="dtToday" from="#StartDate#" to="#EndDate#">
<cfoutput>
<cfset usedate="#CreateODBCDate(dttoday)#">
<cfset stime = (DateFormat( usedate, "yyyy-mm-dd" ) & " " & "#TimeFormat(sadd.topen)#") />
<cfoutput>
<table cellpadding=20 cellspacing=0 align=center>
<cfset etime = #DateAdd('n', sadd.increment, '#stime#')#>
<tr bgcolor=e8e8e8>
<td class=verd10 valign=middle>
#Timeformat(stime, 'H:mm TT')#
<br>#Timeformat(etime, 'H:mm TT')#
</td>
</tr>
</table>
</cfoutput>
<cfloop index="incr" from="1" to="#loopreps#">
<cfoutput>
<cfset stime = #DateAdd('n', sadd.increment, '#stime#')#>
<cfset etime = #DateAdd('n', sadd.increment, '#stime#')#>
<table cellpadding=20 cellspacing=0 align=center>
<tr bgcolor=e8e8e8>
<td class=verd10 valign=middle>
#Timeformat(stime, 'H:mm TT')#
<br>#Timeformat(etime, 'H:mm TT')#
</td>
</tr>
</table>
</cfoutput>
</cfloop>
<cfset schdate = #DateAdd('d', 1, '#schdate#')#>
</cfoutput>
</cfloop>