|
|
|
<%
strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mapPath("db/coutet.mdb")
col1="F9E597"
col2="FAF4DF"
set objConn=Server.CreateObject("ADODB.Connection")
Set objrecs=Server.CreateObject("ADODB.Recordset")
objConn.open strConnect
weeks=78
thisDay = formatDateTime(date(),vbLongDate)
nextSaturday = thisDay
' response.write weekdayName(weekday(thisDay))
for f=1 to 7
if weekdayName(weekday(dateAdd("d",f,thisDay))) = "Saturday" then
nextSaturday = dateAdd("d",f,thisDay)
exit for
end if
next
'response.write formatDateTime(nextSaturday,vbLongDate)
%>
<%
response.write year(nextSaturday)
currentYear=year(nextSaturday)
currentMonth = month(nextSaturday)
%>
- weeks available
commencing Saturday
|
|
Price |
<%
for f=0 to 77
if currentYear <> year(dateAdd("d",f*7,nextSaturday)) then
%>
<%
response.write year(dateAdd("d",f*7,nextSaturday))
currentYear=year(dateAdd("d",f*7,nextSaturday))
%>
|
<% end if
%>
<%
strSQL="SELECT * FROM specialDates WHERE sDate=#" & formatDateTime(dateAdd("d",f*7,nextSaturday),vbLongDate) & "#"
objrecs.Open strSQL, objConn
sdetails=""
if objrecs.EOF=False then sDetails=objrecs("sDetail")
objrecs.Close
strSQL="SELECT * FROM unavailabledates WHERE weekstarting=#" & formatDateTime(dateAdd("d",f*7,nextSaturday),vbLongDate) & "#"
objrecs.Open strSQL, objConn
if objrecs.EOF=true then booked=0 else booked=1
objrecs.Close
if currentMonth <> month(dateAdd("d",f*7,nextSaturday)) then
currentMonth=month(dateAdd("d",f*7,nextSaturday))
response.write ("
| | ")
if currentCol=col1 then
currentCol=col2
else
currentCol=col1
end if
%>
>
<%
else
if currentCol=col1 then
currentCol=col2
else
currentCol=col1
end if
%>
| >
<%
end if
if booked=1 then
response.write "" & formatDateTime(dateAdd("d",f*7,nextSaturday),vbLongDate) & " - BOOKED"
else
response.write formatDateTime(dateAdd("d",f*7,nextSaturday),vbLongDate)
end if
%>
|
<%=sDetails%>
|
<%
currentDay = dateAdd("d",f*7,nextSaturday)
strSQL="SELECT * FROM avail_prices ORDER BY startDate ASC"
objrecs.Open strSQL, objConn
do while objrecs.EOF=false
if objrecs("startDate")>currentDay then exit do
currentPrice = objrecs("price")
objrecs.movenext
loop
response.write currentPrice
Objrecs.Close
%>
|
<%
next
ObjConn.Close
set objConn=Nothing
set objrecs=Nothing
%>
|
|
|  |